
Projects the specified rotation as a 2D ggplot object. One static frame of manual tour. Useful for providing user-guided interaction.
oblique_frame(
basis = NULL,
data = NULL,
manip_var = NULL,
theta = 0L,
phi = 0L,
lab = NULL,
rescale_data = FALSE,
...
)
A (p, d) dim orthonormal numeric matrix. Defaults to NULL, giving a random basis.
A (n, p) dataset to project, consisting of numeric variables.
Number of the variable to rotate.
Angle in radians of "in-projection plane" rotation, on the xy plane of the reference frame. Defaults to 0, no rotation.
Angle in radians of the "out-of-projection plane" rotation, into the z-direction of the axes. Defaults to 0, no rotation.
Optionally, provide a character vector of length p (or 1) to label the variable contributions to the axes, Default NULL, results in a 3 character abbreviation of the variable names.
When TRUE scales the data to between 0 and 1. Defaults to FALSE.
Optionally pass additional arguments to the render_type
for
projection point aesthetics; geom_point(aes(...))
.
A ggplot object of the rotated projection.
# NOT RUN {
flea_std <- tourr::rescale(tourr::flea[,1:6])
rb <- tourr::basis_random(n = ncol(flea_std))
theta <- runif(1, 0, 2*pi)
phi <- runif(1, 0, 2*pi)
oblique_frame(data = flea_std, basis = rb, manip_var = 4, theta, phi)
oblique_frame(data = flea_std, basis = rb, manip_var = 4,
theta = 0, phi = 1,
lab = paste0("MyNm", 3:8), rescale_data = TRUE)
# }
Run the code above in your browser using DataLab