cor0 | R Documentation |
Wraps typical workflow of
df %>% as.matrix() %>% Hmisc::rcorr() %>% broom::tidy()
.
Respects grouped dataframes a la dplyr
.
cor0(.data, pattern = NULL)
.data |
Dataframe. |
pattern |
Optional vector of patterns to match for (i.e., filter for) in the resulting two columns with variable names. Useful if only interested in correlations with a specific variable (e.g., the outcome). |
Drops all factors with more than 2 levels and throws a warning.
Silently converts factors with 2 levels to numerics via as.numeric(x) - 1
.
cor0(mtcars)
# with factors and missing data
cor0(mice::boys)
# with a filter applied
cor0(mtcars, "mpg")
cor0(mtcars, c("mpg", "cyl"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.