correlation {radiant.basics} | R Documentation |
Calculate correlations for two or more variables
Description
Calculate correlations for two or more variables
Usage
correlation(
dataset,
vars = "",
method = "pearson",
hcor = FALSE,
hcor_se = FALSE,
data_filter = "",
envir = parent.frame()
)
Arguments
dataset |
Dataset |
vars |
Variables to include in the analysis. Default is all but character and factor variables with more than two unique values are removed |
method |
Type of correlations to calculate. Options are "pearson", "spearman", and "kendall". "pearson" is the default |
hcor |
Use polycor::hetcor to calculate the correlation matrix |
hcor_se |
Calculate standard errors when using polycor::hetcor |
data_filter |
Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000") |
envir |
Environment to extract data from |
Details
See https://radiant-rstats.github.io/docs/basics/correlation.html for an example in Radiant
Value
A list with all variables defined in the function as an object of class compare_means
See Also
summary.correlation
to summarize results
plot.correlation
to plot results
Examples
correlation(diamonds, c("price", "carat")) %>% str()
correlation(diamonds, "x:z") %>% str()