# NOT RUN {
library(spinifex)
dat <- scale_sd(penguins[, 1:4])
clas <- penguins$species
## 2D case:
gt_path <- save_history(dat, grand_tour(), max_bases = 5)
ggt <- ggtour(gt_path, dat, angle = .1) +
proto_point(list(color = clas, shape = clas)) +
proto_origin() ## `+` in center
# }
# NOT RUN {
animate_plotly(ggt)
# }
# NOT RUN {
## 1D case:
gt_path1d <- save_history(dat, grand_tour(d = 1), max_bases = 5)
ggt <- ggtour(gt_path1d, dat) +
proto_density(list(fill = clas, color = clas)) +
proto_origin1d() ## Adds line at 0.
# }
# NOT RUN {
animate_plotly(ggt)
# }
Run the code above in your browser using DataLab