library(spinifex)
dat <- scale_sd(penguins_na.rm[, 1:4])
clas <- penguins_na.rm$species
bas <- basis_pca(dat)
mv <- manip_var_of(bas)
mt_path <- manual_tour(bas, manip_var = mv)
## d = 2 case
message("facet_wrap_tour wants be called early, so that other proto's adopt the facet_var.")
ggt <- ggtour(mt_path, dat, angle = .3) +
facet_wrap_tour(facet_var = clas, ncol = 2, nrow = 2) +
proto_default(aes_args = list(color = clas, shape = clas),
identity_args = list(size = 1.5))
if (FALSE) {
animate_gganimate(ggt) ## May not always play well with plotly
}
Run the code above in your browser using DataLab