grouped_rowcenter: Center matrix rows by subsets of columns

View source: R/grouped_rowcenter.R

grouped_rowcenterR Documentation

Center matrix rows by subsets of columns

Usage

grouped_rowcenter(m, groups = split_by_sample_names(colnames(m)), by = "mean")

Arguments

m

a matrix

groups

list of character vectors specifying the column ids to center by. Default: split_by_sample_names(colnames(m))

by

how centering should be performed. One of 'mean' or 'median'. Default: 'mean'

Value

A row-centered matrix, centered within groups and with the order of cells within groups retained. The matrix has the same number of rows as <m> and as many columns as there are cell ids in groups.


jlaffy/scalop documentation built on April 13, 2025, 7:34 a.m.