Description Usage Arguments Value Examples
This function returns the correlations between different variables.
1 2 3 4 5 6 7 8 |
df |
The data set for which correlations are required |
comparison_var |
The variable to compare to |
other_vars |
variables for which correlation with comparison_var is required. If not supplied, all variables will be used. |
method |
The method used to perform the correlation test as defined in 'cor.test'. Defaults to pearson. |
drop_columns |
A character vector specifying column classes to drop. Defaults to c("factor","character") |
... |
Other arguments to 'cor.test' see ?cor.test for details |
A data.frame object containing correlations between comparison_var and each of other_vars
1 2 3 4 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.