Tour a high dimensional dataset
limn_tour(
tour_data,
cols,
color = NULL,
tour_path = tourr::grand_tour(),
rescale = clamp,
morph = "center",
gadget_mode = TRUE
)a data.frame to tour
Columns to tour. This can use a tidyselect specification
such as tidyselect::starts_with().
A variable mapping to the color aesthetic, if NULL points will be colored black.
the tour path to take, the default is tourr::grand_tour()
but also works with tourr::guided_tour().
A function that rescales cols, the default is to
clamp() the data to lie in the hyperdimensional unit cube. To not perform
any scaling use identity().
One of c("center", "centre", "identity", "radial")
that rescales each projection along the tour path. The default
is to center the projections and divide by half range. See morph_center()
for details.
Run the app as a shiny::runGadget() which will load
the app in the RStudio Viewer pane or a browser (default = TRUE). If FALSE
will return a regular shiny app object that could be used to deploy the app
elsewhere.
The tour interface loads a shiny app either in the Viewer pane if you are using Rstudio or in a browser window. After iterating through the tour and and highlighting subsets of interest, you can click the 'Done' button. This will return a named list with two elements:
selected_basis: a matrix consisting of the final projection selected
tour_brush_box: a list consisting of the bounding box of brush
tour_half_range: the current value of half range parameter
The tour interface consists of two views:
the tour view which is a dynamic scatterplot
the axis view which shows the direction and magnitude of the basis vectors being generated.
There are several other user controls available:
A play button, that when pressed will start the tour animation.
A pause button, that when pressed will pause the tour animation.
The title of the view includes the half range. The half range is a scale factor for projections and can be thought of as a way of zooming in and out on points. It can be modified by scrolling (via a mouse-wheel movement). Double-click to reset to the default tour view.
If categorical variable has been used, the legend can be toggled to highlight categories of interest with shift + mouse click. Multiple categories can be selected in this way. To reset double click the legend title.
Brushing is activated by moving the mouse on the tour view. If the tour animation a brush event will pause it.
# NOT RUN {
if (interactive()) {
# tour the first ten columns of the fake tree data
# loads the default interface
limn_tour(fake_trees, dim1:dim10)
# perform the same action but now coloring points
limn_tour(fake_trees, dim1:dim10, color = branches)
}
# }
Run the code above in your browser using DataLab