R/1_manual_tour.r
create_manip_space.Rd
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.
create_manip_space(basis, manip_var = manip_var_of(basis))
A (p, d) orthonormal numeric matrix, the linear combination the original variables contribute to projection frame. Required, no default.
The number of the variable/column to rotate. Defaults to
manip_var_of(basis)
, the variable with the largest contribution in the basis.
A (p, d + 1) orthonormal matrix, the manipulation space to manipulate the projection in.
Other manual tour adjacent functions:
interpolate_manual_tour()
,
manip_var_of()
,
manual_tour()
,
rotate_manip_space()
## Setup
dat_std <- scale_sd(wine[, 2:6])
bas <- basis_pca(dat_std)
mv <- manip_var_of(bas)
create_manip_space(basis = bas, manip_var = mv)
#> PC1 PC2 manip_sp
#> Alcohol 0.09339195 0.6578986 0.3355553
#> Malic 0.42873573 -0.1335841 -0.4431762
#> Ash 0.65072062 0.1843494 -0.4291688
#> Alcalinity 0.57844161 -0.4342966 0.6905011
#> Magnesium 0.22233218 0.5715999 0.1732622
## d = 1 case
bas1d <- basis_pca(dat_std, d = 1)
mv <- manip_var_of(bas1d)
create_manip_space(bas1d, mv)
#> PC1 manip_sp
#> Alcohol 0.09339195 -0.08003514
#> Malic 0.42873573 -0.36741847
#> Ash 0.65072062 0.75931724
#> Alcalinity 0.57844161 -0.49571360
#> Magnesium 0.22233218 -0.19053450