In vattrs[[name]][index] <- value : number of items to replace is not a multiple of replacement length
0
0
Entering edit mode
3.5 years ago
ks.sholohova ▴ 30

Hello everyone!

I was trying to build a microbiome network in R using the example from the book. However, I got this error while converting a qraph network to igraph network. Here is the code for it.

  #get the data amgut1.filt, it could be derived from github. Besides, load some useful libraries.

library(devtools)
library(igraph)
library(qgraph)
devtools::install_github("zdk123/SpiecEasi")

data("amgut1.filt")

Now we have a file.

ebic.cor <- cor_auto(amgut1.filt)
#cor_auto suppose to count correlations.

#we try to find a graph with the best EBIC
ebic.graph <- EBICglasso(ebic.cor, ncol(amgut1.filt), 0.5)

#then build a qgraph network
ebic.qgnet <- qgraph(ebic.graph, DoNotPlot = TRUE)

#but we need an igraph network,so ...
ebic.net <- as.igraph(ebic.qgnet, attributes = TRUE)

After running the last line, I had this error.

In vattrs[[name]][index] <- value : number of items to replace is not a multiple of replacement length

Does anyone had the same error while converting a qgraph network to igraph network.? If so, I would highly appreciate the help with resolving this question.

Thanks in advance, Kseniia

R microbiome network • 1.2k views
ADD COMMENT
0
Entering edit mode

using the example from the book

What book are you referring to?

ADD REPLY

Login before adding your answer.

Traffic: 2641 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6