Learn R Programming

spinifex (version 0.1.0)

render_gganimate: Render the slides as a gganimate animation

Description

Takes the result of array2df() and renders them into a gganimate animation.

Usage

render_gganimate(slides, manip_col = "blue", col = "black", pch = 20,
  axes = "center", fps = 3, ...)

Arguments

slides

The result of array2df(), a long df of the projected frames.

manip_col

String of the color to highlight the manip_var. Defaults to "blue".

col

Color of the projected points. Defaults to "black".

pch

Point character of the projected points. Defaults to 20.

axes

Position of the axes: "center", "bottomleft" or "off". Defaults to "center".

fps

Frames/slides shown per second. Defaults to 3.

...

Optional, pass addition arguments to gganimate::transition_states().

Examples

Run this code
# NOT RUN {
flea_std <- tourr::rescale(tourr::flea[, 1:6])

rb <- basis_random(n = ncol(flea_std))
mtour <- manual_tour(basis = rb, manip_var = 4)
sshow <- array2df(array = mtour, data = flea_std)
render_gganimate(slides = sshow)

render_gganimate(slides = sshow, col = col_of(flea$species), 
  axes = "bottomleft", fps = 2)
# }

Run the code above in your browser using DataLab