ScaleLazily: Scale rows or columns to a desired total.

View source: R/MatrixLazyEval_convenience.R

ScaleLazilyR Documentation

Scale rows or columns to a desired total.

Description

Scale rows or columns to a desired total.

Usage

ScaleLazily(M, do_rows = T, desired_sum = 1)

Arguments

M

Any matrix with a multiplication operator and nrow/ncol methods defined. Usually from the Matrix package.

do_rows

If true, the rows are scaled so every row has the desired sum. If false, the columns are centered so every column has the desired sum.

This method is LAZY – calculations are put off until later, not triggered by calling this function.

desired_sum

Desired sum for each row or column.


ekernf01/MatrixLazyEval documentation built on July 24, 2022, 2:42 a.m.