manip_var_of: Suggest a manipulation variable.

View source: R/0_util.r

manip_var_ofR Documentation

Suggest a manipulation variable.

Description

Find the column number of the variable with the rank-ith largest contribution of the basis. Useful for identifying a variable to change the contribution of in a manual tour, it's manip_var argument.

Usage

manip_var_of(basis, rank = 1)

Arguments

basis

Numeric matrix (p x d), orthogonal liner combinations of the variables.

rank

The number, specifying the variable with the rank-th largest contribution. Defaults to 1.

Value

Numeric scalar, the column number of a variable.

See Also

Other manual tour adjacent functions: create_manip_space(), interpolate_manual_tour(), manual_tour(), rotate_manip_space()

Examples

dat <- scale_sd(wine[, 2:6])
bas <- basis_pca(dat)

manip_var_of(basis = bas) ## Variable with the largest contribution
manip_var_of(basis = bas, rank = 5) ## Variable with 5th-largest contribution

spinifex documentation built on March 31, 2022, 9:06 a.m.