safescale: safescale

View source: R/misc.R

safescaleR Documentation

safescale

Description

Equivalent to 'base::scale', but handling missing values and null variance a bit more elegantly.

Usage

safescale(x, center = TRUE, byRow = FALSE)

Arguments

x

A matrix.

center

Logical, whether to center values.

byRow

Logical, whether to scale by rows instead of columns.

Value

A scaled matrix.

Examples

m <- matrix(rnorm(100), nrow=10)
m.scaled <- safescale(m)

plger/sechm documentation built on Nov. 15, 2024, 5:08 a.m.