Learn R Programming

corrtable (version 0.1.1)

save_correlation_matrix: Creates and save to file a fully formatted correlation matrix, using correlation_matrix and Hmisc::rcorr in the backend

Description

Creates and save to file a fully formatted correlation matrix, using correlation_matrix and Hmisc::rcorr in the backend

Usage

save_correlation_matrix(df, filename, ...)

Value

'csv' file. No value is returned.

Arguments

df

dataframe; passed to correlation_matrix

filename

either a character string naming a file or a connection open for writing. "" indicates output to the console; passed to write.csv

...

any other arguments passed to correlation_matrix

Examples

Run this code
# \donttest{
save_correlation_matrix(df = iris,
                        filename = 'iris-correlation-matrix.csv')

save_correlation_matrix(df = mtcars,
                        filename = 'mtcars-correlation-matrix.csv',
                        digits = 3,
                        use = 'lower')
                        # }

Run the code above in your browser using DataLab