Learn R Programming

ade4 (version 1.2-2)

scalewt: Centring and Scaling a Matrix of Any Weighting

Description

transforms a numeric matrix in a centred and scaled matrix for any weighting.

Usage

scalewt(X, wt = rep(1, nrow(X)), center = TRUE, scale = TRUE)

Arguments

X
a numeric matrix (like object)
wt
a vector of weighting
center
a logical value indicating whether the array should be centred
scale
a logical value indicating whether the array should be scaled

Value

  • returns a centred, scaled matrix

Examples

Run this code
scalewt(matrix(1:12,4,3))
scale((matrix(1:12,4,3)))
scale(matrix(1,4,3))
scalewt(matrix(1,4,3))

Run the code above in your browser using DataLab