Learn R Programming

rotations (version 1.6.5)

plot: Visualizing random rotations

Description

This function produces a 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 static plot uses ggplot2. Interactive plots are no longer supported.

Usage

# S3 method for SO3
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,
  ...
)

# S3 method for Q4 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, ... )

Value

A visualization of rotation data.

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

deprecated; sphereplot was set to be removed from CRAN and was going to take this package down with it

...

parameters passed onto the points layer.

Examples

Run this code
r <- rvmises(200, kappa = 1.0)
Rs <- genR(r)
plot(Rs, center = mean(Rs), show_estimates = "proj.mean", shape = 4)

# \donttest{
  # 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)
 ) +
   ggplot2::aes(size = Z, alpha = Z) +
   ggplot2::scale_size(limits = c(-1, 1), range = c(0.5, 2.5))
# }

Run the code above in your browser using DataLab