Learn R Programming

rnaturalearth (version 0.0.0.9000)

ne_countries: Get natural earth world country polygons

Description

returns world country polygons at a specified scale, or points of tiny_countries

Usage

ne_countries(scale = 110, type = "countries", continent = NULL, country = NULL, geounit = NULL, sovereignty = NULL)

Arguments

scale
scale of map to return, one of 110, 50, 10 or 'small', 'medium', 'large'
type
country type, one of 'countries', 'map_units', 'sovereignty', 'tiny_countries'
continent
a character vector of continent names to get countries from.
country
a character vector of country names.
geounit
a character vector of geounit names.
sovereignty
a character vector of sovereignty names.

Value

SpatialPolygonsDataFrame or SpatialPointsDataFrame object.

Examples

Run this code
spdf_world <- ne_countries()
spdf_africa <- ne_countries(continent = 'africa')
spdf_france <- ne_countries(country = 'france')
spdf_tiny_countries <- ne_countries(type = 'tiny_countries', scale = 50)

if (require(sp)) {
  plot(spdf_world)
  plot(spdf_africa)
  plot(spdf_france)
  plot(spdf_tiny_countries)   
}

Run the code above in your browser using DataLab