Computes coefficients for every pair of selected variables. Pearson's correlation is used when both variables are numeric and pass a Shapiro-Wilk normality check; Spearman's correlation is used otherwise.

corfun(data, variables)

Arguments

data

A data frame containing the variables.

variables

Character vector naming at least two variables.

Value

Invisibly returns a lower-triangular numeric matrix.

Examples

data("data_s")
corfun(data_s, c("sDurLog", "speakingRate", "typeOfS"))
#>              sDurLog speakingRate typeOfS
#> sDurLog                                  
#> speakingRate  -0.237                     
#> typeOfS        0.206         0.16