powered by
This function returns the correlations between different variables.
get_var_corr( df, comparison_var = NULL, other_vars = NULL, method = "pearson", drop_columns = c("factor", "character"), ... )
A data.frame object containing correlations between comparison_var and each of other_vars
The data set for which correlations are required
The variable to compare to
variables for which correlation with comparison_var is required. If not supplied, all variables will be used.
The method used to perform the correlation test as defined in 'cor.test'. Defaults to pearson.
A character vector specifying column classes to drop. Defaults to c("factor","character")
Other arguments to 'cor.test' see ?cor.test for details
# Get correlations between all variables get_var_corr(mtcars,"mpg") # Use only a few variables get_var_corr(mtcars,"mpg", other_vars = c("disp","drat"), method = "kendall",exact=FALSE)
Run the code above in your browser using DataLab