4/15/2019

R Cartography Package

Cartography Package

The R Cartography Package was created as a tool for R users to create high-quality thematic maps that are often only able to be created through classical GIS software.

This package allows R users to easily create and integrate detailed maps in to their R workflow.

The package utilizes spatial objects from both sf or sp packages to create maps.

Symbology

The functions within the package are all essentially different styles of map functions (Typology,Proportional Symbols, Choropleth,Dot Densities). These functions are able to be placed on a map as individual layers, the benefit of this is multiple functions can be utilized on the same map.

The two main arguments utilized within the functions are "x" and "var". - "x" represents a spatial object, most commonly an "sf". - "var" argument represents the name of the variable that will be mapped.

As mentioned above "sp" objects can be utilized however, they are called through the "spdf" (Spatial-DataFrame) and "DF" commands rather than the "sf" argument.

Transformations

A set of functions or commands was included to allow users to transform and create various spatial objects.

"getGridLayer": Transforms polygons to Grid layers. Only able to be used in "choroLayer()" or "propSymbolLayer()" style maps.

Polygons to Grid.

Transformations cont.

"getBorders": Transforms polygons to borders. Only available for the "discLayer()" style maps.

Polygons to Borders.

Transformations cont.

"getPencilLayer": Transforms polygons to pencil lines to give a colored pencil style theme.

Polygons to Pencil Lines.

Color Palettes

In addition to being able to utilize the color palettes available in R, the package also includes 16 original color palettes. These palettes can be customized and combined.

Sequential palettes:

blue.pal, orange.pal, red.pal, brown.pal, green.pal, purple.pal, pink.pal wine.pal, grey.pal, turquoise.pal, sand.pal, taupe.pal, kaki.pal, harmo.pal

Qualitative palettes:

pastel.pal, multi.pal

Color Palettes continued

library(cartography)

# Display All Color Palettes
display.carto.all()

Color Palettes continued

# Display One Color Palette
display.carto.pal("harmo.pal")

Legends

There are 8 different types or styles of legends available through the package. Although legends are automatically displayed for each of the functions they can be customized and transformed within the "legend*()" command.

  1. "legendChoro()"
  2. "legendTypo()"
  3. "legendCirclesSymbols()"
  4. "legendSquaresSymbols()"
  5. "legendBarsSymbols()"
  6. "legendGradLines()"
  7. "legendPropLines()"
  8. "legendPropTriangles()"

Legends Contin.

Dans Cool Legends.

Map Examples

Choropleth Map

Colored Pencil and Typologies Map

Proportional Symbols over Street Map

## Data and map tiles sources:
## © OpenStreetMap contributors. Tiles style under CC BY-SA, www.openstreetmap.org/copyright.

Proportional Symbols and Typology Map

Square Grid Map

Hexagonal Grid Map

Map Labeling Regions

Isoleth Map

Dicontinuities Maps