, see ggtour
.
Takes the result of tourr::save_history()
or manual_tour()
, interpolates
over the path and renders into a specified render_type
.
play_tour_path(
tour_path,
data = NULL,
angle = 0.05,
render_type = render_plotly,
...
)
The result of tourr::save_history()
or manual_tour()
.
Optional, number of columns must match that of tour_path
.
Target distance (in radians) between steps. Defaults to .05.
Graphics to render to. Defaults to render_plotly
,
alternative use render_gganimate
.
Optionally pass additional arguments to render_
and the
function used in render_type
.
render_
For arguments to pass into ...
.
library(spinifex)
message("It's suggested to switch to the proto api, see `?ggtour` to get started.")
#> It's suggested to switch to the proto api, see `?ggtour` to get started.
dat_std <- scale_sd(wine[, 2:6])
clas <- wine$Type
bas <- basis_pca(dat_std)
gt_path <- save_history(dat_std, tour_path = tourr::grand_tour(), max = 5)
# \donttest{
suppressWarnings(
play_tour_path(tour_path = gt_path, data = dat_std)
)
suppressWarnings(
play_tour_path(tour_path = gt_path, data = dat_std,
axes = "bottomleft", angle = .08, fps = 8,
aes_args = list(color = clas, shape = clas),
identity_args = list(size = 1.5, alpha = .7),
ggproto =
list(ggplot2::theme_void(), ggplot2::ggtitle("My title")),
render_type = render_gganimate)
)
## Saving a .gif(may require additional setup)
if(FALSE){ ## Don't accidentally save file
## Export plotly .html widget
play_tour_path(tour_path = gt_path, data = dat_std,
render_type = render_plotly,
html_filename = "myRadialTour.html")
## Export gganimate .gif
play_tour_path(tour_path = gt_path, data = dat_std,
render_type = render_gganimate,
gif_path = "myOutput", gif_filename = "myRadialTour.gif")
}# }