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_point(aes_args = list(color = clas, shape = clas),
identity_args = list(size = 2, alpha = .7))
# \donttest{
animate_plotly(ggt)
# }
## Select/highlight observations with `row_index`
ggt <- ggtour(gt_path, dat, angle = .3) +
proto_point(aes_args = list(color = clas, shape = clas),
identity_args = list(size = 2, alpha = .7),
row_index = which(clas == levels(clas)[1]),
bkg_color = "grey80") ## FALSE or NULL to skip plotting background
# \donttest{
animate_plotly(ggt)
# }
Run the code above in your browser using DataLab