library(spinifex)
dat <- scale_sd(penguins_na.rm[, 1:4])
clas <- penguins_na.rm$species
## 2D case:
bas <- basis_pca(dat)
mv <- manip_var_of(bas)
mt_path <- manual_tour(bas, mv)
ggt <- ggtour(mt_path, dat) +
proto_default(aes_args = list(color = clas, shape = clas))
# \donttest{
animate_plotly(ggt)
# }
library(spinifex)
## 1D case:
gt_path <- save_history(dat, grand_tour(d = 1), max_bases = 3)
ggt <- ggtour(gt_path, dat) +
proto_default1d(aes_args = list(fill = clas, color = clas))
# \donttest{
animate_plotly(ggt)
# }
Run the code above in your browser using DataLab