Skip to contents

Perform rapid (parallel) unweighted and weighted (partial) correlations on a matrix

Usage

fcor(x, covs = NULL, covs_alt = NULL, w = NULL, n_cores = 1, verbose = FALSE)

Arguments

x

matrix of variables over which to calculate pairwise correlations

covs

matrix of variables that serve as covariates

covs_alt

alternate matrix of variables that serve as covariates when pairwise correlation is not complete

w

vector of weights

n_cores

number of cores over which to parallelize

verbose

logical; report what correlations are being calculate

Value

data.table of pairwise correlations

Examples

if (FALSE) { # \dontrun{
data        <- data.frame(matrix(rnorm(100 * 50), ncol = 50))
covs        <- data.frame(matrix(rnorm(100 * 2), ncol = 2))
names(covs) <- c("C1", "C2")
wgt <- 1/runif(100)

fcor(x = data, covs = covs, w = wgt, n_cores = 1, verbose = TRUE)
} # }