Learn R Programming

spinifex (version 0.3.2)

proto_frame_cor2: Tour proto for frames square correlation

Description

Adds text to the animation, the frame and its specified correlation.

Usage

proto_frame_cor2(
  text_size = 4,
  row_index = TRUE,
  xy_position = c(0.7, -0.1),
  ...
)

Arguments

text_size

Size of the text. defaults to 4.

row_index

A numeric or logical index of rows to subset to. Defaults to NULL, all observations.

xy_position

Vector of the x and y position, the fraction of the range of the data in each direction. The projection data is contained in (0, 1) in each direction. Defaults to c(.7, -.1), in the bottom right.

...

Optionally, pass additional arguments to stats::cor, specifying the type of within frame correlation.

See Also

stats::cor

Examples

Run this code
# NOT RUN {
library(spinifex)
dat     <- scale_sd(penguins[, 1:4])
clas    <- penguins$species
gt_path <- save_history(dat, grand_tour(), max_bases = 5)

ggt <- ggtour(gt_path, dat, angle = .3) +
  proto_default(aes_args = list(color = clas, shape = clas)) +
  proto_frame_cor2(xy_position = c(.5, 1.1))
# }
# NOT RUN {
animate_plotly(ggt)
# }

Run the code above in your browser using DataLab