Learn R Programming

spinifex (version 0.1.0)

array2df: Turns a tour path array into a long data frame (/tibble)

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 (/tibble) for use in ggplots.

Usage

array2df(array, data = 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.

Value

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

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)
array2df(array = mtour, data = flea_std)
# }

Run the code above in your browser using DataLab