Learn R Programming

spinifex (version 0.2.5)

view_manip_space: Plot projection frame and return the axes table.

Description

Uses base graphics to plot the circle with axes representing the projection frame. Returns the corresponding table.

Usage

view_manip_space(
  basis,
  manip_var,
  tilt = 1/12 * pi,
  lab = paste0("V", 1:nrow(basis)),
  manip_col = "blue",
  z_col = "red"
)

Arguments

basis

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

manip_var

Number of the column/dimension to rotate.

tilt

angle in radians to rotate the projection plane. Defaults to pi * 5/12.

lab

Optional, character vector of p length, add name to the axes in the reference frame, typically the variable names.

manip_col

String of the color to highlight the manip_var.

z_col

Color to illustrate the z direction or out of the projection plane.

Value

ggplot object of the basis.

Examples

Run this code
# NOT RUN {
flea_std <- tourr::rescale(tourr::flea[, 1:6])
rb <- tourr::basis_random(ncol(flea_std), 2)

view_manip_space(basis = rb, manip_var = 4)
# }

Run the code above in your browser using DataLab