This document is adapted from the Maps section of the Altair Example Gallery.

Our first step is to set up our environment:

library("altair")
library("tibble")
library("purrr")
library("dplyr")

vega_data <- import_vega_data()

Choropleth Map

Altair example

It is not straightforward to preview the topological data, or the unemployment data:

  • The vega_data$us_10m data is in topoJSON, not a data frame
  • The vega_data$unemployment data is in an unparsed format.

Chart

Locations of US Airports

Altair example

Chart

Repeated Choropleth Map

Altair example

Chart

World Projections

Altair example

Please see the Vega documentation for more details on the projections available.