create_manip_space: Create a manipulation space to rotate the manipulation...

View source: R/1_manual_tour.r

create_manip_spaceR Documentation

Create a manipulation space to rotate the manipulation variable in.

Description

Typically called by manual_tour(). Creates a (p, d) orthonormal matrix, the manipulation space from the given basis right concatenated with a zero vector, with manip_var set to 1.

Usage

create_manip_space(basis, manip_var = manip_var_of(basis))

Arguments

basis

A (p, d) orthonormal numeric matrix, the linear combination the original variables contribute to projection frame. Required, no default.

manip_var

The number of the variable/column to rotate. Defaults to manip_var_of(basis), the variable with the largest contribution in the basis.

Value

A (p, d + 1) orthonormal matrix, the manipulation space to manipulate the projection in.

See Also

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

Examples

library(spinifex)
dat <- scale_sd(wine[, 2:6])
bas <- basis_pca(dat)
mv  <- manip_var_of(bas)
create_manip_space(basis = bas, manip_var = mv)

## d = 1 case 
bas1d <- basis_pca(dat, d = 1)
mv    <- manip_var_of(bas1d)
create_manip_space(bas1d, mv)

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