Adds geom_text() of the projected data.

proto_text(
  aes_args = list(vjust = "outward", hjust = "outward"),
  identity_args = list(nudge_x = 0.05),
  row_index = TRUE
)

Arguments

aes_args

A list of arguments to call inside of aes(). aesthetic mapping of the primary geom. For example, geom_point(aes(color = my_fct, shape = my_fct)) becomes aes_args = list(color = my_fct, shape = my_fct).

identity_args

A list of static, identity arguments passed into the primary geom. For instance, geom_point(size = 2, alpha = .7) becomes identity_args = list(size = 2, alpha = .7). Also passes more foundational arguments such as stat and position, though these have been tested less.

row_index

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

Examples

library(spinifex)
dat     <- scale_sd(penguins_na.rm[, 1:4])
clas    <- penguins_na.rm$species
bas     <- basis_pca(dat)
mv      <- manip_var_of(bas)
gt_path <- save_history(dat, grand_tour(), max_bases = 5)

ggt <- ggtour(gt_path, dat, angle = .2) +
  proto_text(list(color = clas))
#> Warning: .lapply_rep_len: `color` not of length 1 or data; liable to cause cycling issues. Should it be of length 1 or data?
# \donttest{
animate_plotly(ggt)
# } ## Custom labels, subset of points ggt2 <- ggtour(gt_path, dat) + proto_text(list(color = clas, size = as.integer(clas)), list(alpha = .7), row_index = 1:15) # \donttest{ animate_plotly(ggt2)
# }