Turn Place Names into Map Data

A tool for easily matching spatial data when you have a list of place/region names. You might have a data frame that came from a spreadsheet tracking some data by suburb or state. This package can convert it into a spatial data frame ready for plotting. The actual map data is provided by other packages (or your own code).


cartographer

cartographer statusbadge CRANstatus R-CMD-check

If you have a list of place/region names (for example as a column in a data frame) and you’d like to turn that into spatial data, {cartographer} can help. There are 2 steps:

  1. Register the spatial data with {cartographer} using register_map(), or load a package that already did that for you.
  2. Use add_geometry() to turn your ordinary data frame into a spatial one.

Cartographer will be most useful when you are working regularly with data about the same places. You can do the work once to curate your geospatial data, and thereafter you can use cartographer to quickly jump from place names to map data ready to analyse or visualise.

See vignette("cartographer") for examples, and {ggautomap} for some handy ggplot helpers that pull map data using {cartographer}.

Installation

You can install cartographer like so:

# CRAN release
install.packages('cartographer')

# development version
install.packages('cartographer', repos = c('https://cidm-ph.r-universe.dev', 'https://cloud.r-project.org'))

Map data

Some packages provide data that works with {cartographer}:

  • {maps} - some dated example maps of the world and several countries.
  • {rnaturalearth} - countries and states (where available).
  • {nswgeo} - maps of New South Wales, Australia.

Alternatively, you can register your own data using register_map() (see vignette("registering_maps")).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("cartographer")

0.2.2 by Carl Suster, 7 months ago


https://github.com/cidm-ph/cartographer, https://cidm-ph.github.io/cartographer/


Report a bug at https://github.com/cidm-ph/cartographer/issues


Browse source code at https://github.com/cran/cartographer


Authors: Carl Suster [aut, cre] , Western Sydney Local Health District , NSW Health [cph] (2023-2025)


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, rlang, sf

Suggests dplyr, ggplot2, knitr, maps, rnaturalearth, rnaturalearthhires, rmarkdown, testthat


Imported by ggautomap, nswgeo.


See at CRAN