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.

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

## Setup
dat_std <- scale_sd(wine[, 2:6])
bas <- basis_pca(dat_std)

manip_var_of(basis = bas) ## Variable with the largest contribution
#> Alcohol 
#>       4 
manip_var_of(basis = bas, rank = 5) ## Variable with 5th-largest contribution
#> Magnesium 
#>         2