standardise: Standardise data

Description Usage Arguments Details Value Examples

Description

Standardises the columns of a numeric matrix x (similar to R-function scale). If x is a vector, it is treated as a 1-column matrix.

Usage

1

Arguments

x

A numeric matrix (or vector).

scale

A logical; if TRUE each column of x is divided by the square root of the sum of its centred squares.

Details

This function is much faster than scale.

Value

Matrix with centred (and optionally scaled) columns.

Examples

1
2
3
4
x <- matrix(rnorm(100*10), nrow = 100, ncol = 10)
x <- standardise(x)
standard.deviations <- apply(x,2,sd)
print(standard.deviations)

rbvs documentation built on May 2, 2019, 7:31 a.m.