unscale: Unscales a scaled data.frame

Description Usage Arguments Details Value See Also Examples

View source: R/unscale.R

Description

unscale is a generic function that unscale and/or uncenter the columns of a matrix generated by the scale base function

Usage

1

Arguments

x

A numeric matrix.

Details

unscale uses attributes added by the scale function "scaled:scale" and "scaled:center" and use these scaling factor to retrieve the initial matrix. It first unscales and then uncenters.

Value

Return a matrix, uncenterd and unscaled. Attributes "scaled:center" and "scaled:scale" are removed.

See Also

scale

Examples

1
2
3
4
X <- matrix(1:9, ncol = 3)
X.scale <- scale(X, center = TRUE, scale = TRUE)
X.unscale <- unscale(X.scale)
all(X == X.unscale)

timeOmics documentation built on Nov. 8, 2020, 10:58 p.m.