as_cor_mat | R Documentation |
Convert a correlation test data frame, returned by the
cor_test()
, into a correlation matrix format.
as_cor_mat(x)
x |
an object of class |
Returns a data frame containing the matrix of the correlation coefficients. The output has an attribute named "pvalue", which contains the matrix of the correlation test p-values.
cor_mat()
, cor_test()
# Pairwise correlation tests between variables #::::::::::::::::::::::::::::::::::::::::::::::: res.cor.test <- mtcars %>% select(mpg, disp, hp, drat, wt, qsec) %>% cor_test() res.cor.test # Convert the correlation test into a correlation matrix #::::::::::::::::::::::::::::::::::::::::::::::: res.cor.test %>% as_cor_mat()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.