MyNixOS website logo
Description

Manual Tours, Manual Control of Dynamic Projections of Numeric Multivariate Data.

Data visualization tours animates linear projection of multivariate data as its basis (ie. orientation) changes. The 'spinifex' packages generates paths for manual tours by manipulating the contribution of a single variable at a time Cook & Buja (1997) <doi:10.1080/10618600.1997.10474754>. Other types of tours, such as grand (random walk) and guided (optimizing some objective function) are available in the 'tourr' package Wickham et al. <doi:10.18637/jss.v040.i02>. 'spinifex' builds on 'tourr' and can render tours with 'gganimate' and 'plotly' graphics, and allows for exporting as an .html widget and as an .gif, respectively. This work is fully discussed in Spyrison & Cook (2020) <doi:10.32614/RJ-2020-027>.

CRAN Status Badge Codecov test coverage CRAN Downloads Each Month

spinifex spinifex R package!

About tours

Data visualization tour is a class of linear projections that are animate small changes in a projection basis over time. Shadows are an example of a 3D object casting a 2D linear projection. Imagine a bar stool cast a circular shadow of its seat. Watching the shadow alone, a rotation of the objection would quickly give structural information about the object; when the legs are rotated into frame you can be more certain the object is a bar stool. In the same way, a tour watches a lower-dimensional projection of the data object. The object permanence of the observations between frames holds structural information that is revealed as the object is rotated.

Scope

Such visualizations are applicable to numeric matrices which could be approximations of component spaces or feature decomposition of non-tabular data. Continuous quantitative variables are preferred, although ordinal discrete variables can also be used. Mapping color and/or shape to a (supervised) class tends to be helpful.

Description

The tourr R package implements grand tours (constrained random walks in the basis), projection pursuit (basis anneals to some objective function), and several other variants and options of visualization tours.

Grand tour

The work and contribution of spinifex are primarily two-fold. The addition of manual tours which allow for user defined (and interactive!) control of the basis. Secondly, a layered API to create tour elements that mirrors the additive creation of ggplot2 visuals. The extension to gganimate and plotly graphics packages, which allow for more control over display and exporting .gif, .mp4, and .html widgets of tours. The later can also consume tours produced in tourr!

We see that bill length is important for separating the orange and green species. Let's change its contribution with a manual tour:

Manual tour

Getting started

#install.packages("spinifex")             ## Install from CRAN
library("spinifex")                       ## Load into session
run_app("radial_tour")                    ## Run a local shiny app, showing radial tours
vignette("getting started with spinifex") ## Introduction to tours and spinifex
vignette("ggproto api")                   ## Introduction to the new ggproto api
?ggtour                                   ## Examples and links to ggproto functions
help(package = "spinifex")                ## Review the package contents and documentation

ggproto API

The ggproto API is a layered approach to the composition of animated tours, it should feel similar to the composition of ggplots.

FamilyFunctionRelated toDescription
processingscale_01/sd-scale each column to [01]/std dev away from the mean
processingbasis_pca/olda/...Rdimtools::do.*basis of orthogonal component spaces
processingbasis_half_circle-basis with uniform contribution across half of a circle
processingbasis_guidedtourr::guided_toursilently return the basis from a guided tour
tour pathmanual_tour-basis and interpolation information for a manual tour
tour pathsave_historytourr::save_historysilent extended wrapper returning other tour arrays
displayggtourggplot2::ggplotcanvas and initialization for a tour animation
displayproto_point/textgeom_point/textadds observation points/text
displayproto_density/2dgeom_density/2dadds density curve/2d contours
displayproto_hexgeom_hexadds hexagonal heatmap of observations
displayproto_basis/1d-adds adding basis visual in a unit-circle/-rectangle
displayproto_origin/1d-adds reference mark in the center of the data
displayproto_default/1d-wrapper for proto_* point + basis + origin
displayfacet_wrap_tourggplot2::facet_wrapfacets on the levels of variable
displayappend_fixed_y-add/overwrite a fixed vertical position
animationanimate_plotlyplotly::ggplotlyrender as an interactive html widget
animationanimate_gganimategganimate::animaterender as a gif, mp4, or other video format
animationfilmstrip-static gpplot faceting on the frames of the animation

Reporting issues

Please submit bug reports, errors, and feature requests to https://github.com/nspyrison/spinifex/issues.

Metadata

Version

0.3.7.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows