Learn R Programming

lares (version 4.1)

corr: Correlation table

Description

This function correlates a whole dataframe, filtering automatically all numerical values.

Usage

corr(df, method = "pearson", logs = TRUE, plot = FALSE, top = NA)

Arguments

df

Dataframe. It doesn't matter if it's got non-numerical columns: they will be filtered!

method

Character. Any of: c("pearson", "kendall", "spearman")

logs

Boolean. Automatically calculate log(values) for numerical variables (not binaries)

plot

Boolean. Do you wish to see a plot?

top

Integer. Select top N most relevant variables? Filtered and sorted by mean of each variable's correlations