R - rcorr(): correlations for whole dataset

30 May 2020

Correlation tests for whole dataset with rcorr() from Hmisc package

# correlation tests for whole dataset
library(Hmisc)
res <- rcorr(as.matrix(dat)) # rcorr() accepts matrices only

# display p-values (rounded to 3 decimals)
round(res$P, 3)

[ R  function  data_frame  statistics  ]