check_unit_norm: Checking of unit-norm data

View source: R/auxiliary.R

check_unit_normR Documentation

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.

Author(s)

Eduardo García-Portugués, Davy Paindaveine, and Thomas Verdebout.

Examples

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)

rotasym documentation built on Aug. 19, 2023, 9:06 a.m.