safeColScale | R Documentation |
safeColScale
is a safe utility for centering and scaling
an input matrix X
. It is intended to avoid the drawback of using
scale
on data with constant variance by inducing adding
a small perturbation to truncate the values in such columns. It also takes
the opportunity to be faster than scale
through relying
on matrixStats or DelayedMatrixStats, depending on the type of
matrix being processed, for a key internal computation.
safeColScale(
X,
center = TRUE,
scale = TRUE,
tol = .Machine$double.eps,
eps = 0.01,
scaled_matrix = FALSE
)
X |
An input |
center |
A |
scale |
A |
tol |
A tolerance level for the lowest column variance (or standard
deviation) value to be tolerated when scaling is desired. The default is
set to |
eps |
The desired lower bound of the estimated variance for a given
column. When the lowest estimate falls below |
scaled_matrix |
A |
A centered and/or scaled version of the input data.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.