Learn R Programming

spinifex (version 0.2.5)

oblique_basis: Return the basis of an oblique frame

Description

Rotates a basis returning (p, 2) basis describing oblique_frame() Used to create an oblique tour by small changes to the rotation.

Usage

oblique_basis(basis = NULL, manip_var, theta = NULL, phi = NULL)

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

Number of the column/dimension to rotate.

theta

Angle in radians of "in-plane" rotation, on the xy plane of the reference frame. Required, no default. If left NULL, will initialize the radial angle of the manip_var.`

phi

Phi is angle in radians of the "out-of-plane" rotation, the z-axis of the reference frame. Required, no default.

Value

(p, 2) matrix of the rotated basis.

Examples

Run this code
# NOT RUN {
rb    <- tourr::basis_random(n = 6)
theta <- runif(1, 0, 2*pi)
phi   <- runif(1, 0, 2*pi)

oblique_basis(basis = rb, manip_var = 4, theta, phi)
# }

Run the code above in your browser using DataLab