unscale: Un-scale or re-center the scaled or centered Matrix-like...

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

This function revert a Matrix-like object that is scaled or centered via scale.default to data with the original scale/center.

Usage

1

Arguments

x

numeric matrix(like object).

Value

a matrix that are re-centered or un-scaled, based on the value of attributes "scaled:center" and "scaled:scale" of x. If neither of those attributes is specified, x is returned.

See Also

scale

Examples

1
2
3
4
5
6
7
8
require(stats)
x <- matrix(1:10, ncol=2)
unscale(z <- scale(x))

#maybe useful for truncating
trunc <- 1
z[abs(z) > trunc] <- sign(z[abs(z) > trunc])*trunc
unscale(z)

grt documentation built on May 29, 2017, 5:43 p.m.

Search within the grt package
Search all R packages, documentation and source code