plot.countries: Basic plot function for 'countries' objects

View source: R/functions.R

plot.countriesR Documentation

Basic plot function for countries objects

Description

As the plot method of sf, this function is intended to obtain quickly a map for a set of countries. Countries' boundaries are represented and filling can be used, some cities can also be represented and labels can be added. ggplot is used and should be used directly when more enhanced maps are required

Usage

## S3 method for class 'countries'
plot(
  x,
  ...,
  labels = NULL,
  fill = NULL,
  capital = NULL,
  centroid = NULL,
  bks = NULL,
  n = 6,
  style = NULL,
  palette = NULL,
  bw = FALSE
)

Arguments

x

a countries object,

...

further arguments (currently unused)

labels

a character vector containing the variables that should be labeled: country, capital and/or towns

fill

a variable use to fill countries' polygons

capital, centroid

a variable associated with the shape or the size of points

bks

an optional vector of breaks in order to use a continuous variable for fill

n

the number of class (passed to classIntervals)

style

the style (passed to classIntervals)

palette

the palette (selected in scale_fill_brewer)

bw

a boolean, if TRUE, a black and white map is produced

Value

a gg object.

Examples

we <- countries("Western Europe")
plot(we)

necountries documentation built on April 4, 2025, 1:43 a.m.