I am computing correlations 3 different ways (packages easystats,correlation,Hmisc). I tried the following for this very large dataset choosing a subset of the variables.
corvars are columns (variables) of interest
library(easystats)
e <- correlation(corvars)
library(correlation)
c <- correlation(corvars, include_factors = TRUE)
library(Hmisc)
h <- rcorr(as.matrix(corvars))
Typical output for easystats and correlation looks like:
Parameter1 | Parameter2 | r | 95% CI | t(4158) | p
-------------------------------------------------------------------
X2 | X4 | 0.78 | [0.77, 0.79] | 80.95 | < .001***
X2 | X5 | 0.85 | [0.84, 0.86] | 103.32 | < .001***
X2 | X6 | 0.78 | [0.77, 0.80] | 81.47 | < .001***
e,c and h are truncated due to their length. How can I get these datasets to display or save all rows?
I tried something like the following but it did not work right.
for (i in 1: comb(n,2)){
v <- paste(i)
v2=as.numeric(v)+99
print(e[v:v2,1:10])
}
This is an attempt to automate
print(e[001:100,1:10])
print(e[101:200,1:10])
... etc.
}
I also tried to save to text and csv files.
I am looking for a more general solution. I suspect I may be missing the obvious simple solution? Any suggestions? I am new to big data. Thank you.
MM