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))
then
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