Learn R Programming

GADMTools (version 3.9-1)

gadm_subset: Extract regions

Description

With subset you can extract one or more regions from a country at the current level.

Usage

gadm_subset(x, level = NULL, regions = NULL, usevar = NULL)

gadm.subset(x, level = NULL, regions = NULL, usevar = NULL) # deprecated

Arguments

x

Object gadm_sf or gadm_sp

level

Integer the level at which the regions are extracted from

regions

character vector of named regions

usevar

character name of an other var of the internal dataset of map

Value

Object As input object, gadm_sf or gadm_sp

See Also

listNames

Examples

Run this code
# NOT RUN {
library(GADMTools)
data("Corsica")

Calvi <- gadm_subset(Corsica, 4, "Calvi")
plotmap(Calvi)
# }

Run the code above in your browser using DataLab