array2df: Turns a tour path array into a long data frame.
Description
Typically called by a wrapper function, play_manual_tour or
play_tour_path. Takes the result of tourr::save_history() or
manual_tour() and restructures the data from an array to a long data frame
for use in ggplots.
Usage
array2df(array, data = NULL, lab = NULL)
Arguments
array
A (p, d, n_slides) array of a tour, the output of
manual_tour().
data
Optional, (n, p) dataset to project, consisting of numeric
variables.
lab
Optional, labels for the reference frame of length 1 or the
number of variables used. Defaults to an abbreviation of the variables.
Value
A list containing an array of basis slides (p, d, n_slides) and
an array of data slides (n, d, n_slides) if data is present.