Learn R Programming

spinifex (version 0.2.5)

render_: Prepate the ggplot object before passing to either animation package.

Description

Typically called by render_plotly() or render_gganimate(). Takes the result of array2df(), and renders them into a ggplot2 object.

Usage

render_(slides, axes = "center", manip_col = "blue", ...)

Arguments

slides

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

axes

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

manip_col

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

...

Optionally passes arguments to the projection points inside the aesthetics; geom_point(aes(...)).

Examples

Run this code
# NOT RUN {
flea_std <- tourr::rescale(tourr::flea[, 1:6])
rb <- tourr::basis_random(n = ncol(flea_std))
mtour <- manual_tour(basis = rb, manip_var = 4)
sshow <- array2df(array = mtour, data = flea_std)

render_(slides = sshow)

render_(slides = sshow, axes = "bottomleft", 
        col = tourr::flea$species, pch = tourr::flea$species, cex = 2, alpha = .5)
        
render_(slides = sshow, axes = "bottomleft", 
        col = tourr::flea$species, pch = tourr::flea$species, cex = 2, alpha = .5)
# }

Run the code above in your browser using DataLab