The cartography package allows various cartographic representations such as proportional symbols, chroropleth, typology, flows or discontinuities. In addition it also proposes some useful features like cartographic palettes, layout (scale, north arrow, title…), labels, legends or access to cartographic API to ease the graphic presentation of maps.
Hereunder you will see some maps generated with this package. Main mobilized functions are highlighted below each map.
All scripts used in designing the maps are coming from the package vignette.
Base maps and data on European regions are part of the package.
Click on a map to enlarge.
This map uses the
Colors were selected via the
carto.pal function that proposes a set of cartographic palettes.
Stock & Ratio
labelLayer function places labels on a map. Size, position and aspect of the labels can be set.
getLinkLayer function creates a line layer (SpatialLinesDataFrame) from a list of links.
gradLinkLayer displays these links graduated according to values of a variable.
This map combines a choropleth map and a visualization of discontinuities.
discLayer allow to compute and display these discontinuities.
getGridLayer function builds a regular grid from a SpatialPolygonsDataFrame,
getGridData transforms a dataset to fit in this grid and
choroLayer maps the transformed data.
For all the maps, legends are configurable (text, size, position…). The map layout is set with the
layoutLayer function that allows to choose a title, display a north arrow, a scale, an author and sources.
Some Technical Bits and Pieces
We have tried to minimize the package dependencies. So, only basic graphic functionalities (package
graphics) are needed to display the layers. The only absolutely required packages are
sp (spatial objects handling) and
classInt (discretizations). However, to operate properly, some functions need other packages (
Code of the Cartographic Mix
You can access the code used to generate the cartographic mix here (works with
cartography version >= 1.2).