rotasym (version 1.0-5)

check_unit_norm: Checking of unit-norm data

Description

Utility for normalizing data without unit norms.

Usage

check_unit_norm(x, warnings = TRUE)

Arguments

x

observations claimed to have unit norms. Either a matrix of size c(nx, p) or a vector of length p.

warnings

whether to show warnings if the normalization of x happened.

Value

A curated version of x with unit-norm observations and possible zeros excluded.

Examples

Run this code
# NOT RUN {
check_unit_norm(c(sqrt(2), sqrt(2), 0) / 2)
check_unit_norm(1:3, warnings = FALSE)
check_unit_norm(rbind(c(0, 0, 0), c(0, 0, 1), 1:3, c(NA, 0, 1)),
                warnings = FALSE)
# }

Run the code above in your browser using DataLab