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.
Here I share R code I used to produce animated great circle arcs on top of a rotating 3D Earth. The code is not entirely reproducible but you should be able to use what is shared here to create your own video frames given your unique data and computing environment and resources.
The WordPress blog is not the most elegant for displaying lots of code so go to the original full post.
When I make great circle animations, at the core of the process is always an R function that transforms a series of coordinates describing points along a great circle arc into multiple series of great circle arc segments. The goal is simple: plot a series of line segments, saving each plot as a subsequent still frame, rather than plotting the original entire arc as a single plot. The input is generally a data table (much faster to work with than a data frame if you have a lot of data) with longitude and latitude columns where the coordinates in each row describe a subsequent point along one of my paths. I also use a third column to provide a unique group ID for each path to keep them distinct.
For the blog readers, just a quick heads up that I have posted a new R data animation to YouTube. A complete post will follow, but for now here is the video. It displays the social network of SNAP Shiny app users over about the past year and a half using great circle trajectories on a rotating 3D Earth. It’s best in 1080p, but still somewhat degraded for streaming. I’ll post the raw source video later as well, which is crystal clear.
I used geolocation data from Google Analytics. I routed all the traffic randomly through either Fairbanks, AK or Denver, CO to complete the network since those two places best describe where my apps come from. It’s great to see how many people connect to the apps and from where; too many people to plot as a single static graphic without some of the essence of the data being lost.
As usual, the still frames of the rotating globe, its surface texture, country boundaries and great circle paths are all made in R. It’s basically a series of plots made with ggplot2.