Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rowScales

Rowwise Scaling


Description

Scales each row of a matrix such that the values in this row have zero mean and a standard deviation of 1.

Usage

rowScales(X, add.stats = FALSE)

Arguments

X

a numeric matrix whose rows should be scaled. Missing values are allowed.

add.stats

should the rowwise means and standard deviations of X be returned?

Value

If add.stats = FALSE, a matrix of the same dimensions as X with a rowwise mean of zero and a rowwise standard deviation of 1. If add.stats = TRUE, a list containing this matrix and the rowwise means and standard deviations of the input matrix.

Author(s)

Holger Schwender, holger.schwender@udo.edu

See Also

Examples

## Not run: 
# Generate a matrix containing data for 10 categorical 
# variables with levels 1, 2, 3.

mat <- matrix(sample(3, 500, TRUE), 10)

rowScales(mat)


## End(Not run)

scrime

Analysis of High-Dimensional Categorical Data Such as SNP Data

v1.3.5
GPL-2
Authors
Holger Schwender, with a contribution of Arno Fritsch
Initial release
2018-12-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.