View source: R/cor_with_target.R
cor_with_target | R Documentation |
This function correlates a set of target variables (target) with a set of other variables (withvars). The general goal is to avoid sifting through gargantuan correlation matrices when only some cells are of interest a priori.
cor_with_target(
df,
omit = NULL,
target,
withvars = NULL,
pmin = NULL,
partial = NULL,
absrmin = NULL,
digits = 3,
prewhiten = FALSE,
orderbyr = FALSE
)
df |
The data.frame containing data to be correlated |
omit |
A vector of variables that should not be included in the |
target |
A vector of variable names that are correlated with |
withvars |
A vector of variable names, each of which is correlates with each |
pmin |
The highest correlation p-value that should be included in the output (e.g., to omit non-sig correlations) |
partial |
A character vector of variable names to partial out of the target correlations |
absrmin |
The minimum absolute r value to print |
digits |
The number of digits to return for correlations and p values |
prewhiten |
Whether to remove the temporal autocorrelation structure of each variable prior correlation (using ARIMA) |
orderbyr |
Whether to sort the correlation output by the magnitude of the correlation |
A list of correlations where each element is a vector of a target variable with all withvvars
Michael Hallquist
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.