Example Shiny apps

One of my favorite things to do with R is create apps using Shiny that showcase whatever I just used R to accomplish. It's one of the best ways for sharing and communicating not only the results of statistical analysis but also the analysis itself. It allows others to become an active participant in the analytical workflow, reproducing parts of the process in their browser interactively, even if they don't have a quantitative background or know any programming. Here are a few example apps:

  • Alaska and western Canada historical and projected climate analysis. This app examines observed data and climate model output for a number of spatial domains and time periods. It uses complete spatial samples from which any statistic can be computed, rather than offering users only pre-aggregated data. The datset backend is powered by Amazon Web Services. It supports millions of datasets, each of which can be further manipulated by the user including on the fly calculation of marginal distributions. The app also offers dynamic report generation based on custom data selections.
  • Wildfire model output. Results from Alaska wildfire modeling simulations are available in interactive form, including the ability to interact with plots directly, for example in order to subset data points and update regression models.
  • Interactive documents are useful for embedding Shiny widgets in regular web pages. Shiny Server required.
  • The Northwest Territories climate projections app combines access to annual time series data at point locations with spatially explicit regional raster data for decadal averages. The entire background of the app is an interactive map.
  • AR5/CMIP5 climate model evaluation. Comprehensive, detailed results from a statistical analysis comparing global GCM performance over Alaska and other spatial domains showcases the relative model performance and selection criteria resulting in the composite GCM used for Alaska-centric analyses at SNAP.
  • Community-level climate projections for thousands of locations throughout Alaska and western Canada are accessible by interactive menu or map. For each location the decadal future temperature and preciptation outlook is shown.

Selected R packages

Here are some R packages I've made for a broad range of purposes.

  • epubr: A package for reading EPUB files. epubr reads and parses metadata and text content of EPUB files into a tidy data frame for text analysis.
  • tiler: A package for creating map tiles. tiler creates map tiles for use with packages like leaflet. Tiles can be geographic or non-geographic (simple coordinate reference system).
  • rtrek: A package for all things Star Trek. Use rtrek to access and analyze Star Trek universe datasets.
  • trekfont: A fun add-on data package containing 107 Star Trek fonts.
  • rockchain: A package for blockchain integration. rockchain interfaces with select APIs for accessing Bitcoin wallet data and general cryptocurrency market cap data.
  • memery: A fun package for combining statistical graphs with attention-grabbing memes. It supports static memes and animated gifs. Perfect for data nerds.
  • tabr: A package for programmatic authoring of guitar tablature in R. tabr connects to the open source LilyPond sheet music engraving program to produce high quality tabs and sheet music.
  • rvtable: A package to assist with chaining big data through multiple stages of an analysis with minimal overhead by modeling empirically estimated probability density functions to robustly reduce large samples with minimal, controlled information loss. rvtable stores continuous densities in tidy tibble data frames.
  • mapmate: A package to assist with simple globe animations. This package is primarily an encapsulation of small, reproducible educational examples based on an approach I've used in the past for globe animations. It is not meant for heavy, generalized production.
  • SNAPverse: The SNAP R package ecosystem. This is a collection of related R packages that combine to support various aspects of data access, manipulation, graphing, analysis and presentation of publicly available datasets produced by the Scenarios Network for Alaska and Arctic Planning at the Univeristy of Alaska Fairbanks.

rtrek

All things Star Trek

tabr

Guitar tablature with R

Static and dynamic data visualizations

I enjoy producing data visualizations ranging from simple graphs to complex animations and videos. Data and the results of data analysis should be presented in clear, simple forms. This usually means static graphics with minimal ink, little or no color, among handful of other graphing best practices. But there are also times when it is important to grab an audience's attention. Here are some example animations I've created based on spatio-temporal datasets.

  • Top left: Web traffic over a given time period. Perhaps most appropriately summarized using a table of aggregate values. A simple graph would definitely be more than enough to clearly convey the pertinent information. But web traffic is boring and such a table or plot will not be attention-grabbing. To achieve the latter, I combined 3D and movement: moving great circle arc segments to convey directional connections between geolocations, an orthographic projection for the globe view rather than a flat map, and finally Earth rotation and a changing observer perspective.
  • Top right: Similar to the previous network animation, but this time a flat map so that all connections can be seen at once. Fewer types of moving parts, but many more network connections overall. Instead of national boundary polygons, I used city points to infer continents and population density.
  • Bottom left: This animation is a demonstration of animating semi-random pathway traversal along the grid cell borders of a rasterized dataset. This is another technique I like to apply to make othwerwise-bland animations involving change over time and other transitions in raster maps more eye-catching.
  • Bottom right: In this 3D Earth animation I focused on spatially explicit change over time in historical and projected climate anomalies while overlaying a time series growth animation from left to right representing the global average. A useful way to share both spatial information and aggregate trends that is still meaningful and informative even though the focus is on grabbing viewers' attention by not falling back on the same old recycled stale maps and charts that put people to sleep.

Visualizations based in analysis

All visualizations are data-driven and flow from upstream, programmatic statistical analysis and mathematical computation. The before and after slider panel below highlights two examples.

  • Left: spatial climate model downscaling of low resolution GCM output over Alaska.
  • Right: network data as great circle arc traversal projected onto a rotating 3D globe.

Drag the centered slider up and down to see the before and after. If it's not working try refreshing the page.