Learn R Programming

rotations (version 1.5)

plot.SO3: Visualizing random rotations

Description

This function produces an interactive or static three-dimensional globe onto which one of the columns of the provided sample of rotations is projected. The data are centered around a user-specified rotation matrix. The interactive plot is based on the sphereplot package and the static plot uses ggplot2.

Usage

"plot" (x, center = mean(x), col = 1, to_range = FALSE, show_estimates = NULL, label_points = NULL, mean_regions = NULL, median_regions = NULL, alp = NULL, m = 300, interactive = FALSE, ...)
"plot" (x, center = mean(x), col = 1, to_range = FALSE, show_estimates = NULL, label_points = NULL, mean_regions = NULL, median_regions = NULL, alp = NULL, m = 300, interactive = FALSE, ...)

Arguments

x
n rotations in SO3 or Q4 format.
center
rotation about which to center the observations.
col
integer or vector comprised of 1, 2, 3 indicating which column(s) to display. If length(col)>1 then each eyeball is labelled with the corresponding axis.
to_range
logical; if TRUE only part of the globe relevant to the data is displayed
show_estimates
character vector to specify which of the four estimates of the principal direction to show. Possibilities are "all", "proj.mean", "proj.median", "geom.mean", "geom.median".
label_points
vector of labels.
mean_regions
character vector to specify which of the three confidence regions to show for the projected mean. Possibilities are "all", "trans.theory","trans.bootstrap, "direct.theory", "direct.bootstrap".
median_regions
character vector to specify which of the three confidence regions to show for the projected median. Possibilities are "all", "theory", "bootstrap."
alp
alpha level to be used for confidence regions. See region for more details.
m
number of bootstrap replicates to use in bootstrap confidence regions.
interactive
logical; if TRUE sphereplot is used to create an interactive 3D plot, otherwise ggplot2 is used
...
parameters passed onto the points layer.

Value

A visualization of rotation data.

Examples

Run this code
r <- rvmises(200, kappa = 1.0)
Rs <- genR(r)

plot(Rs, center = mean(Rs), show_estimates = "proj.mean", shape = 4)

## Not run: 
# # Z is computed internally and contains information on depth
# plot(Rs, center = mean(Rs), show_estimates = c("proj.mean", "geom.mean"),
#  label_points = sample(LETTERS, 200, replace = TRUE)) + aes(size = Z, alpha = Z) +
#  scale_size(limits = c(-1, 1), range = c(0.5, 2.5))
# 
# plot(Rs, center = mean(Rs), interactive = TRUE)## End(Not run)

Run the code above in your browser using DataLab