safe_row_l2_normalize: Safe L2 row normalization

View source: R/utils.R

safe_row_l2_normalizeR Documentation

Safe L2 row normalization

Description

Helper function for Kaiser normalization to handle rows with zero (or numerically zero) norm, which results in a divide by zero error in the stats::varimax() implementation.

Usage

safe_row_l2_normalize(x, eps = 1e-10)

Arguments

x

A matrix to row normalize.

eps

Tolerance to use when assessing if squared L2 row norm is numerically larger or smaller than zero.

Value

The row-rescaled matrix


RoheLab/vsp documentation built on Nov. 6, 2024, 10:08 p.m.