library(spinifex)
message("It's suggested to switch to the proto api, see `?ggtour` to get started.")
## Setup
dat_std <- scale_sd(wine[, 2:6])
clas <- wine$Type
bas <- basis_pca(dat_std)
mv <- manip_var_of(bas)
mt <- manual_tour(basis = bas, manip_var = mv)
mt_df_ls <- array2df(basis_array = mt, data = dat_std)
if (FALSE) {
render_gganimate(frames = mt_df_ls)
require("ggplot2")
render_gganimate(
frames = mt_df_ls, axes = "bottomleft",
fps = 10, rewind = TRUE, start_pause = 1, end_pause = 1.5,
aes_args = list(color = clas, shape = clas),
identity_args = list(size = 2, alpha = .7),
ggproto = list(theme_void(),
ggtitle("My title"),
scale_color_brewer(palette = "Set2")))
## Saving a .gif(may require additional setup)
if(FALSE) ## Don't run by mistake
render_gganimate(frames = mt_df_ls, axes = "bottomleft",
gif_filename = "myRadialTour.gif", gif_path = "./output")}
Run the code above in your browser using DataLab