map_visited_regions: Make a Map with Some Areas Obscured

Description Usage Arguments Details

View source: R/map_functions.R

Description

This function will return a map of a country with only certain regions visible, based on supplying it a list of which regions should be shown.

Usage

1
2
3
4
5
6
7
8
9
map_visited_regions(
  visited_places = NULL,
  countries = "everywhere",
  show_unvisited = FALSE,
  group_London = TRUE,
  add_legend = TRUE,
  uk_countries = FALSE,
  just_London = FALSE
)

Arguments

visited_places

a vector of ISO_3166 values (2-letter country code followed by a dash then a 3-letter region code). Default NULL.

countries

a vector of 2-letter ISO codes that will be passed to ne_states(). Default, "everywhere", will try to generate the list of 2-letter ISO codes based on the vector passed to visited_places.

show_unvisited

boolean; show unvisited places instead of visited ones default FALSE.

group_London

boolean; unite all London boroughs and the City into one map unit called ‘London’. Default TRUE.

add_legend

boolean; include a map legend. Default TRUE.

uk_countries

boolean; display the four main subregions of the UK (England, Scotland, Northern Ireland and Wales). Default FALSE.

just_London

boolean; produce a zoomed-in map of the UK capital. If true, overrides uk_countries and group_London, setting both to FALSE. Default FALSE.

Details

Originally, this function was to show the places we'd visit within a particular country, at the level of the administrative subdivision. The terminology reflects this. Before running this function, you'll need a dataframe that has a variable of ISO_3166_A2 codes for regions. The function will grab the map data based on the country you ask for but in the next version it'll accept an existing sf shape instead. Can return ‘nation’-level of detail for UK but will retain their internal borders and make a nonsense of things if more than one country is included in the map. Uses plotly in the return of the map to allow tooltips and an easier-reading map.


AGDunn/nehnar documentation built on Nov. 15, 2020, 4:08 a.m.