Learn R Programming

spinifex (version 0.2.5)

play_tour_path: Render display of a provided tour path

Description

Takes the result of tourr::save_history() or manual_tour(), interpolates over the path and renders into a selected render_type.

Usage

play_tour_path(
  tour_path,
  data = NULL,
  angle = 0.15,
  render_type = render_plotly,
  rescale_data = FALSE,
  ...
)

Arguments

tour_path

The result of tourr::save_history() or manual_tour().

data

Optional, number of columns must match that of tour_path.

angle

Target distance (in radians) between steps. Defaults to .15.

render_type

Graphics to render to. Defaults to render_plotly, alternative use render_gganimate.

rescale_data

When TRUE scales the data to between 0 and 1. Defaults to FALSE.

...

Optionally pass additional arguments to the render_type for projection point aesthetics; geom_point(aes(...)).

Examples

Run this code
# NOT RUN {
flea_std <- tourr::rescale(tourr::flea[, 1:6])
tpath <- tourr::save_history(flea_std, tour_path = tourr::grand_tour(), max = 3)
class <- tourr::flea$species

# }
# NOT RUN {
play_tour_path(tour_path = tpath, data = flea_std)

play_tour_path(tour_path = tpath, data = flea_std, angle = .25, fps = 4,
  render_type = render_gganimate, color = class, shape = class, axes = "bottomleft")
# }

Run the code above in your browser using DataLab