Skip to contents

Calculates Pearson correlation coefficients for all numeric variables. Rounds the outcome to desired decimals. Outputs a matrix or a dataframe (longer matrix)

Usage

corr_matrix(df, decimals = 2)

Arguments

df

tibble, the input dataframe

decimals

int, the number of decimals

Value

a generic correlation matrix and its longer form that can be passed to other functions in this package.

Examples

corr_matrix(tibble::tibble(x = 1:5, y = 2:6))