|
From: | Tamas Nepusz |
Subject: | Re: [igraph] Error in igraph trying to plot a co-ocurrence network |
Date: | Fri, 9 Jun 2017 21:50:12 +0200 |
Hi there!
I am very very new at igraph package and just a little more than a rookie in R, so maybe my questions are a bit trivial. I apologize for that.
I am triying to run a script that combines the package 'Spiec-Easi' with 'igraph' to perform a netwowork analysis and its plot.
I have encountered some problems with my data format, but most of them has been overcome. However, I am now facing one that I cannot solve by myself. I copy my whole script and I attach the data in .csv file format just in case you want to have a look at it:
library(devtools)
library(SpiecEasi)
library(igraph)
library(phyloseq)
tabla <- read.csv("tabla_prueba.txt")
rownames(tabla) <- tabla[,1]
tabla <- tabla[,-1]
tabla <- t(tabla)
se.tabla <- spiec.easi(tabla, method='mb', lambda.min.ratio=1e-2, nlambda=20, icov.select.params=list(rep.num=20))
se.tabla <- unlist(se.tabla)
ig.tabla <- adj2igraph(se.tabla$refit)
plot_network(ig.tabla, tabla)
Everything seems to work properly until the very last command, when I get the following:
Error in `$<-.data.frame`(`*tmp*`, "id", value = c(1L, 0L)) : replacement has 2 rows, data has 0
Although it seems to be a very common issue, I have not found any viable solution on Internet.
Can anyone help with this problem?
Thanks a lot!
--
Miguel Ángel Fernández Martínez
PostDoctoral Researcher
Dept. Evolución Molecular, Despacho 10
Tlf.: 91 520 64 33 - Ext. 5415
Centro de Astrobiología (CAB), INTA-CSIC
Madrid, Spain
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |