4/15/2019
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.
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.
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.
"getBorders": Transforms polygons to borders. Only available for the "discLayer()" style maps.
Polygons to Borders.
"getPencilLayer": Transforms polygons to pencil lines to give a colored pencil style theme.
Polygons to Pencil Lines.
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.
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
pastel.pal, multi.pal
library(cartography) # Display All Color Palettes display.carto.all()
# Display One Color Palette
display.carto.pal("harmo.pal")
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.
Dans Cool Legends.
## Data and map tiles sources: ## © OpenStreetMap contributors. Tiles style under CC BY-SA, www.openstreetmap.org/copyright.