Learn R Programming

radiant (version 0.1.95)

correlation: Calculate correlations for two or more variables

Description

Calculate correlations for two or more variables

Usage

correlation(dataset, cor_var, data_filter = "", cor_type = "pearson")

Arguments

dataset
Dataset name (string). This can be a dataframe in the global environment or an element in an r_data list from Radiant
cor_var
Variables to include in the analysis
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")
cor_type
Type of correlations to calculate. Options are "pearson", "spearman", and "kendall". "pearson" is the default

Value

A list with all variables defined in the function as an object of class compare_means

Details

See http://vnijs.github.io/radiant/quant/correlation.html for an example in Radiant

See Also

summary.correlation to summarize results

plot.correlation to plot results

Examples

Run this code
result <- correlation("diamonds",c("price","carat","clarity"))
result <- correlation("diamonds",c("price:table"))

Run the code above in your browser using DataLab