mapPlotAnimate: Animated Map Plot

Description Usage Arguments Details Value Examples

View source: R/mattDataViz.R

Description

Generates an animated global map plot of a certain value of data.

Usage

1
2
mapPlotAnimate(data, first_date = NA, last_date = NA,
  selected_value_type = NA, color = "red", alpha = 0.5, fps = 10)

Arguments

data

The data frame that contains the data to be plotted on the world map. This data frame must contain the following columns: "long" (type "numeric"), "lat" (type "numeric"), and "value" (type "numeric").

first_date

This is the first date shown in the animation.

last_date

This is the last date shown in the animation.

selected_value_type

If the data frame contains a column "value_type" with multiple dates, this parameter must specify a specific data value type to be plotted. Options are "cases", "deaths", and "recovered".

color

Color of points on world map. Default is red.

alpha

Transparency level of points on world map. Default is 0.5.

fps

Number of frames displayed per second for the animation. Default is 10.

Details

Note: Expect inconsequential warnings when running this function that do not deter the construction or alter the behavior of the animation plot in any way.

Value

Output is an animated ggplot object which maps the chosen value on a world map using latitude and longitude data over the range of dates specified.

Examples

1
2

smorsink1/ncov2019 documentation built on March 27, 2020, 7:22 p.m.