covMat: Compute Sample Covariance Matrix

View source: R/covMat.R

covMatR Documentation

Compute Sample Covariance Matrix

Description

covMat computes the sample covariance matrix of a data set. If a variable in the dataset has zero variance, then its corresponding row and column in the covariance matrix are zero vectors.

Usage

covMat(data, center = TRUE, scale = TRUE, scaled_matrix = FALSE)

Arguments

data

The data for which to compute the sample covariance matrix.

center

A logical indicating whether the target and background data sets should be centered to mean zero.

scale

A logical indicating whether the target and background data sets should be scaled to unit variance.

scaled_matrix

A logical indicating whether to output a ScaledMatrix object. The centering and scaling procedure is delayed until later, permitting more efficient matrix multiplication and row or column sums downstream. However, this comes at the at the cost of numerical precision. Defaults to FALSE.

Value

the covariance matrix of the data.


PhilBoileau/scPCA documentation built on Feb. 6, 2024, 3:33 p.m.