co occurrence network error

Dear all,
I need to create a co-occurrence network with R for my microbiome data.
first I run this command:
co <- print(cooccur(x, spp_names = TRUE))
then co has 4926 rows and 11 columns.
nodes = data.frame(id = 1:nrow(x), label = row.names(x))
edges <- data.frame(from = c(1:nrow(co), "sp1"), to = c(1:nrow(co), "sp2"), color = ifelse(co$p_lt <= 0.05, "#B0B2C1", "#3C3F51"), dashes = ifelse(co$p_lt <= 0.05, TRUE, FALSE))
but there is and error:
Error in data.frame(from = c(1:nrow(co), "sp1"), to = c(1:nrow(co), "sp2"), :
arguments imply differing number of rows: 4927, 4926
could you please help me with this?
I searched but couldn't find anything useful for this
thank you in advance

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.