ocorr | R Documentation |
Calculate correlations by transforming variables into a matrix and then use of hmisc package the rest is data management. Calculates pearson and spearman. Wrapper from Stata.
ocorr( target = NULL, indep = NULL, grpvar = NULL, data = NULL, type = "pearson" )
target |
target variables |
indep |
independent variables, if NULL: target vars will fill this parameter |
grpvar |
Group variable (only one) |
data |
data frame |
type |
Type of correltation "pearson" o "spearman" |
data frame
# library(dplyr); library(Hmisc) # ocorr("mpg", "hp", data = mtcars, type = "spearman") # ocorr(c("mpg", "cyl", "qsec"), c("drat", "hp", "wt"), data = mtcars, grpvar = "am") # ocorr(c("mpg", "cyl", "qsec"), data = mtcars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.