Cannot build netwrok from sparseDaiblo - extract correlation between variables

I run a sparseDiablo following the tutorial.
I am really interested in extracting the correlation between the relevant variables and I use the network function to do that.

I use then
net_df<-my.network$M_micr_prot %>% as.data.frame()
To extract the values.
However I get an error on the network function:

> network(sgccda.res, blocks = c(1,2),
+         color.node = c('darkorchid','lightgreen'), cutoff = 0.9,
+         multiple = T, hyper = T, directed = F, loops = F, bipartite = T)
Error in matrix(0, ncol = n, nrow = n) : 
  invalid 'nrow' value (too large or NA)

Any idea how to improve this?
I would also be happy if I could just extract all the correlation and then manipulate them in R.
Thank you

hi @sromano,

It doesn’t seem like that you are using the mixOmics network function. Please use mixOmics::network function and see ?mixOmics::network for examples and arguments.

Hope it helps,

Al

1 Like

You are totally right, I did not realize I had another package with a similar function loaded.
Thank you and sorry for the naive question.

On another note, is there any resource I could use to understand what is the difference between the correlation obtained from the function circosPlot and network. With the first, I realized that the correlation of a variable with itself is not 1. So, I am a bit confused.

Thank you!

Hi @sromano,

They both use the same algorithm. As the number of components goes higher, the intergative correlation of variable with itself gets closer to 1. See González I., Lê Cao K.A., Davis M.J., Déjean S. (2012). Visualising associations between paired 'omics' data sets for details .

Al