Learn R Programming

lares (version 4.7)

corr_var: Correlation between variable and dataframe

Description

This function correlates a whole dataframe with a single feature.

Usage

corr_var(df, ..., ignore = NA, method = "pearson", trim = 0,
  clean = FALSE, plot = TRUE, logs = FALSE, dates = TRUE,
  top = NA, ceiling = 100, zeroes = FALSE, save = FALSE,
  subdir = NA, file_name = "viz_corrvar.png")

Arguments

df

Dataframe.

...

Object. Name of the variable to correlate

ignore

Character vector. Which columns do you wish to exlude?

method

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

trim

Integer. Trim words until the nth character for categorical values (applies for both, target and values)

clean

Boolean. Use lares::cleanText for categorical values (applies for both, target and values)

plot

Boolean. Do you wish to plot the result? If set to TRUE, the function will return only the plot and not the result's data

logs

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

dates

Boolean. Do you want the function to create more features out of the date/time columns?

top

Integer. If you want to plot the top correlations, define how many

ceiling

Numeric. Remove all correlations above... Range: (0-100]

zeroes

Do you wish to keep zeroes in correlations too?

save

Boolean. Save output plot into working directory

subdir

Character. Sub directory on which you wish to save the plot

file_name

Character. File name as you wish to save the plot

See Also

Other Exploratory: corr_cross, crosstab, df_str, distr, freqs_df, freqs, gain_lift, get_tweets, missingness, plot_cats, plot_df, plot_nums, tree_var, trendsRelated

Other Correlations: corr_cross, corr_plot, corr