# Example 1: Correlations across entire dataset
sum_cor(
data = iris,
ref_var = "Sepal.Length",
compare_vars = c("Petal.Length", "Petal.Width", "Sepal.Width"),
method = "pearson",
digits = 2,
report = TRUE
)
# Example 2: Correlations by Species
sum_cor(
data = iris,
ref_var = "Sepal.Length",
by = "Species",
compare_vars = c("Petal.Length", "Petal.Width", "Sepal.Width"),
method = "pearson",
digits = 2,
report = TRUE
)
Run the code above in your browser using DataLab