# NOT RUN {
library(spinifex)
dat <- scale_sd(penguins[, 1:4])
clas <- penguins$species
bas <- basis_pca(dat)
mv <- manip_var_of(bas)
mt_path <- manual_tour(bas, manip_var = mv)
ggt <- ggtour(mt_path, dat, angle = .3) +
proto_origin() +
proto_basis() +
proto_point(aes_args = list(color = clas, shape = clas),
identity_args = list(size = 1.5, alpha = .7))
# }
# NOT RUN {
animate_plotly(ggt, width = 700, height = 450) ## pixels only, no resolution argument
## Example saving to a .html widget, may require additional setup.
if(F){
anim <- animate_plotly(ggt, fps = 10,
width = 700, height = 450) ## in pixels
htmlwidgets::saveWidget(widget = anim,
file = "./figures/my_tour.html",
selfcontained = TRUE)}
# }
Run the code above in your browser using DataLab