# 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)
# Fixed y height with related information, independent of a 1D tour
# _eg_ predictions or residuals.
message("don't forget to scale your fixed_y.")
dummy_y <- scale_sd(as.integer(clas) + rnorm(nrow(dat), 0, .5))
gt_path <- save_history(dat, grand_tour(d = 1), max_bases = 5)
message("append_fixed_y wants to be called early so other proto's adopt the fixed_y.")
ggt <- ggtour(gt_path, dat, angle = .3) +
append_fixed_y(fixed_y = dummy_y) + ## insert/overwrites vertical values.
proto_point(list(fill = clas, color = clas)) +
proto_basis1d() +
proto_origin()
# }
# NOT RUN {
animate_plotly(ggt)
# }
Run the code above in your browser using DataLab