Hi,
In the following command what is and why we put: use="p"
. I have been searching it but I haven't found out anything.
ADJ1=abs(cor(DatExprs,use="p"))^6
If someone can help me, I would appreciate!
Thanks,
Silvia
Hi,
In the following command what is and why we put: use="p"
. I have been searching it but I haven't found out anything.
ADJ1=abs(cor(DatExprs,use="p"))^6
If someone can help me, I would appreciate!
Thanks,
Silvia
Hola Silvia,
use
is a parameter passed to the cor()
function, and 'p' relates to 'pairwise.complete.obs'. WGCNA uses cor()
to create the correlation matrix.
If you type this at your command prompt, you will see more information:
?cor
'pairwise.complete.obs' means that we will only include values that are complete across our logical entities that are being correlated.
A quick example:
x <- c(1,2,3,4)
y <- c(5,6,7,7)
If we correlate x and y, we can see that the correlation will be close to 1:
cor(x, y, use = 'p')
[1] 0.9438798
If, however, we introduce an NA in the 4th variable, then that 4th variable will be excluded from the correlation and we will then observe a perfect correlation:
x <- c(1,2,3,4)
y <- c(5,6,7,NA)
cor(x, y, use = 'p')
[1] 1
By the way, I view it as good practice to always fully reference parameter values, so, always use:
cor(..., use = 'pairwise.complete.obs')
Kevin
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Oh, okay
Thank you!!!