get_brmap: Get a Brazilian territorial map

View source: R/get_brmap.R

get_brmapR Documentation

Get a Brazilian territorial map

Description

Returns a simplified territorial mesh shipped with the package. No network connection is used. Municipal meshes can be selected by milestone edition year; other levels represent the current edition.

Usage

get_brmap(
  level = "country",
  filters = NULL,
  output = c("sf", "data.frame", "sp"),
  year = NULL,
  geo = NULL,
  geo_filter = NULL,
  as = NULL,
  geo.filter = NULL,
  class = NULL
)

Arguments

level

Geographic level in lower snake case. One of '"country"', '"region"', '"state"', '"state_hex"', '"state_region"', '"intermediate_region"', '"immediate_region"', '"mesoregion"', '"microregion"' or '"municipality"'.

filters

Optional named list of code filters. Level shorthands such as 'list(region = 5, state = 50)' are accepted and combined with logical AND.

output

Output type: '"sf"', '"data.frame"' or '"sp"'.

year

Bundled municipal mesh edition. 'NULL' selects the most recent edition. Historical years are available only for municipalities.

geo, geo_filter, as

Deprecated aliases for 'level', 'filters' and 'output'.

geo.filter, class

Older deprecated aliases for 'filters' and 'output'.

Value

An 'sf' object by default. '"data.frame"' removes the geometry; '"sp"' returns a legacy 'Spatial' object and requires package 'sp'.

See Also

[brmap_editions()], [join_brmap()], [plot_brmap()]

Examples

rio <- get_brmap("state", filters = list(state = 33))
municipalities_2010 <- get_brmap(
  "municipality", year = 2010, filters = list(region = 5)
)
plot_brmap(rio)

brazilmaps documentation built on Aug. 4, 2026, 5:07 p.m.