multiCor | R Documentation |
multiCor compute correlation coefficients for one response variable vs multiple predictor (independent) variables. The output is a dataframe ordered by highest to lowest correlation
multiCor(df, response, IVs, method = "spearman")
df |
is dataframe with response variable and predictor variables |
response |
is a character string that is the name of the response variable in df |
IVs |
is a vector of character strings that are the independent variables in df |
method |
is either "spearman" (nonparametric) or "pearson" (parametric) |
z dataframe with the variable name in column 1 and correlation coefficient in column 2. The dataframe is ordered from greatest correlation to least correlation.
data <- dfOptical
multiCor(data,"logEColi",names(data)[-1],"spearman")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.