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

unitize

Convert a Vector to Unit Length


Description

Rescales each column of a matrix to produce vectors of length one.

Usage

unitize(mat)

Arguments

mat

A matrix of real numbers.

Details

No details beyond the simple description are requires; it is implemented exactly the way you would suspect.

Value

A matrix of the same size as the input matrix.

Author(s)

Kevin R. Coombes <krc@silicovore.com>

Examples

simmat <- matrix(rnorm(12), 3, 4)
U <- unitize(simmat)
apply(U^2, 2, sum)  # check unit length
simmat/U            # view normalization factors

Thresher

Threshing and Reaping for Principal Components

v1.1.3
Apache License (== 2.0)
Authors
Kevin R. Coombes
Initial release
2019-12-07

We don't support your browser anymore

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