Here is an assortment of R Shiny apps that you may find useful for exploration if you are in the process of learning Shiny and looking for something different. Some of these apps are very small and simple whereas others are large and complex. This repository provides full code and any necessary accompanying data sets. The repo also links to the apps hosted online at shinyapps.io so that you can run apps in your browser without having to download the entire collection repo to run apps locally. That and other details can be found at the repo linked above. This isn’t a tutorial or other form of support, but it’s plenty of R code to peruse if that is what you are looking for.
shinydashboard package provides functions like
valueBox that conveniently display basic information like summary statistics. In addition to presenting a value and subtitle on a colored background, an icon may be included as well. However, the icon must come from either the Font Awesome or Glyphicon icon libraries and cannot be image files.
I’ve provided a gist that shows how to achieve the use of custom icons with local image files stored in an app’s
www/ directory. It involves overriding a couple functions in
shinydashboard and adding a small bit of custom CSS. Ideally, functionality could be included in future versions of these two packages to allow this in a more robust and complete fashion. But for now, here is a way to do it yourself for value boxes.
mapmate is under development and blog posts can become outdated quickly. Up to date
mapmate documentation and tutorial examples can be found at the official mapmate Github pages.
mapmate has now been updating from version 0.1.0 to 0.2.0 on Github. The key change is the incorporation of new functions, help docs and code examples focused on network maps, which is a more complex map type not previously covered. The new tutorial content below provides a a couple basic code examples for making network maps with
mapmate is aimed at still image sequence generation, allowing the user to exert full control over how still image sequences are used to produce animations subsequently (GUI video editor, ffmpeg, ImageMagick, etc) and not directly at animating from R, the examples here include the use of the
animation package to help you quickly reproduce some basic animated gifs (as long as you have ImageMagick installed on your system). But the takeaway message is that
mapmate now has better support for still image map sequence generation when using the network map type based on great circle arc path traversal.
To install the package:
save_map function in the
mapmate package offers the
type="network" map type. This type of map displays networks or pathways defined by overlapping segments traversing along great circle arcs. This map type can be used to display arbitrary line segments as well if such data is provided, but the provided helper functions used here are aimed specifically at drawing great circles.
mapmate has now been updating from version 0.0.2 to 0.1.0 on Github. The biggest addition is a number of plotting options for making different kinds of maps. The new tutorial content below provides a number of code examples for making a variety of maps and also highlights current limitations associated with certain map types and settings.
Since the code snippets below generate a lot of different plots, the plots are not contained directly in this blog post. See the full tutorial page to see everything. It will also be easier and cleaner to review the examples from there. There is also the accompanying introductory vignette. All can be accessed from the mapmate Github pages.
mapmate is an R package for map- and globe-based data animation pre-production. Specifically,
mapmate functions are used to generate and save to disk a series of global map graphics that make up a still image sequence, which can then be used in video editing and rendering software of the user’s choice. This package does not make simple gif animations directly from R, which can be done with packages like
mapmate is more specific to maps, hence the name, and particularly suited to high-resolution png image sequences of 3D globe plots of the Earth.
mapmate (map animate) is an R package for map animation. It is used to generate and save a sequence of plots to disk as a still image sequence intended for later use in data animation production.
mapmate package is used for map- and globe-based data animation pre-production. Specifically,
mapmate functions are used to generate and save to disk a series of map graphics that make up a still image sequence, which can then be used in video editing and rendering software of the user’s choice. This package does not make simple animations directly within R, which can be done with packages like
mapmate is more specific to maps, hence the name, and particularly suited to 3D globe plots of the Earth.
This introduction covers the following toy examples. Generate a sequence of still frames of:
I have posted a new R data animation video. It’s an example animation of modeled historical and projected global temperature change from 1850 – 2100. The data prep, analysis, full processing and generation of all sets of still frames for each layer in the video are done using R.
Typically an ensemble of models would be used but this video is just to demonstrate a basic animation using one climate model, both with a monthly time series and a monthly 10-year moving average time series. If wondering about the y-axis range, the animation shows anomalies, or delta change, from the climate model’s historical baseline monthly average temperatures using a given climatology window.
In a later video I will use annual and seasonal averages, which will display a smoother signal than monthly series.