array2df: Turns a tour path array into a long data frame

Description Usage Arguments Value Examples

View source: R/array2df.r

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 restuctures the data from an array to a long data frame for use in ggplots.

Usage

1

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.

Value

A list containing the (p, d, n_slides) basis slides array, and the (n, d, n_slides) data slides array.

Examples

1
2
3
4
5
flea_std <- tourr::rescale(tourr::flea[, 1:6])

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

nspyrison/spinifex documentation built on Aug. 23, 2019, 1:21 p.m.