center: Matrix centering

View source: R/server_func.R

centerR Documentation

Matrix centering

Description

Center matrix columns or rows to 0

Usage

center(x, subset = NULL, byColumn = TRUE, scale = FALSE)

Arguments

x

A numeric matrix or data frame. A list of matrices or data frames can also be provided, where they will be cbind-ed to perform the centering.

subset

Encoded value of an index vector indicating the subset of individuals to consider. Default, NULL, all individuals are considered.

byColumn

A logical value indicating whether the input data is centered by column or row. Default, TRUE, centering by column. Constant variables across samples are removed. If FALSE, centering and scaling by row. Constant samples across variables are removed.

scale

A logical value indicating whether the variables should be scaled to have unit variance. Default, FALSE.

Value

The centered matrix.


vanduttran/dsSSCP documentation built on Jan. 17, 2025, 1:47 a.m.