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

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

Examples

library(spinifex)
dat     <- scale_sd(penguins_na.rm[, 1:4])
clas    <- penguins_na.rm$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))
# \donttest{
animate_plotly(ggt)
# }