r - How can I fix this error with plotweb2 in bipartite package? -


i try build tritrophic network using plotweb2 in bipartite. have 2 diferent quantitative adjacency matrix (one linking level 1 2 , linking level 2 3).

the problem become when try use function plotweb2. obtain error:

error in dummy[i] <- dummy[i] - lowfreq[which(names(lowfreq) == names(dummy[i]))] : replacement has length zero

what problem?? suggestions fix it?

my code is:

library(bipartite)  net1<-read.delim("net1.txt", row.names=1) net2<-read.delim("net2.txt", row.names=1)  plotweb2(net1,net2) 

thank in advance.

plotweb2 uses matrices instead of data frames. try converting both objects matrices first

    library(bipartite)     net1<-read.delim("net1.txt", row.names=1) net2<-read.delim("net2.txt", row.names=1)      net1 <- as.matrix(net1)     net2 <- as.matrix(net2)      plotweb2(net1,net2)  

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -