Learn R Programming

spinifex (version 0.2.5)

manual_tour: Produce the series of projection bases to rotate a variable into and out of a projection.

Description

Typically called by array2af(). An array of projections, the radial tour of the manip_var, which is rotated from phi's starting position to phi_max, to phi_min, and back to the start position.

Usage

manual_tour(
  basis = NULL,
  manip_var,
  theta = NULL,
  phi_min = 0L,
  phi_max = 0.5 * pi,
  angle = 0.05,
  ...
)

Arguments

basis

A (p, d) orthonormal numeric matrix. The linear combination the original variables contribute to projection space. Defaults to NULL, generating a random basis.

manip_var

Integer column number or string exact column name of the. variable to manipulate. Required, no default.

theta

Angle in radians of "in-plane" rotation, on the xy plane of the reference frame. Defaults to theta of the basis for a radial tour.

phi_min

Minimum value phi should move to. Phi is angle in radians of the "out-of-plane" rotation, the z-axis of the reference frame. Required, defaults to 0.

phi_max

Maximum value phi should move to. Phi is angle in radians of the "out-of-plane" rotation, the z-axis of the reference frame. Required, defaults to pi/2.

angle

Target distance (in radians) between steps. Defaults to .05.

...

Handles unused arguments that are being also being passed from play_manual_tour() to render_().

Value

A (p, d, 4) history_array of the radial tour. The bases set for phi_start, phi_min, phi_max, and back to phi_start.

Examples

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

manual_tour(basis = rb, manip_var = 4)

manual_tour(basis = rb, manip_var = 6, 
            theta = pi / 2, phi_min = pi / 16, phi_max = pi, angle = .1)
# }

Run the code above in your browser using DataLab