towns {necountries} | R Documentation |
Populated places from naturalearth
Description
Select a set of cities; the set can be defined using the id of the country, the fact that it is a capital and the size
Usage
towns(x, size = NULL, capital = FALSE, crs = NULL, shift = FALSE)
Arguments
x |
a |
size |
the minimum size of the cities that have to be
retrieved (the default value is |
capital |
if |
crs |
an optional crs which is passed to |
shift |
a boolean, if |
Value
a sf
containing five columns:
-
iso2
: the id of the country, -
iso3
: the id of the country, -
name
: the name of the city, -
capital
: a boolean,TRUE
for a capital -
pop
: the population of the city, -
point
: a pointsfc
containing the coordinates of the city
Examples
we <- countries("Western Europe")
towns(we, size = 1E06, capital = TRUE)