View source: R/dthelper-computation-functions.R
cor.with | R Documentation |
Perform correlations with the main variables of interest. Group can be specified to perform correlations within different subsets of the data.
cor.with(df, var, with = colnames(df), group = NULL, dp = 2)
df |
data.frame object |
var |
Variables of main interest |
with |
Variable to correlate with. Defaults to all other in df |
group |
Grouping variable. If specified, correlation will be performed within each group separately |
dp |
Percentage of missing data will be reported. dp allows re-specification of number of decimal places |
id |
Identifier variable. Input as string |
data.frame object
library(car) cor.with(mtcars, var = c("vs"), group = "am") cor.with(mtcars, var = c("vs", "cyl"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.