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