Manual
User Manual:
Open the PDF directly: View PDF .
Page Count: 9
Package
June 17, 2019
Type Package
Title Loads shapefiles of the Brazilian Institute of Geography and Statistics (IBGE)
Version 0.02
Date 2019-06-13
URL https://github.com/ipeaGIT/geobr
BugReports https://github.com/ipeaGIT/geobr/issues
Description geobr provides easy access to shapefiles of the Brazilian
Institute of Geography and Statistics (IBGE) and loads into R as 'sf' objects.
It includes a wide set of geographic datasets availabe at various geographic scales and for vari-
ous years.
License MIT + file LICENSE
Encoding UTF-8
LazyData TRUE
Depends R (>= 3.4.0)
Suggests dplyr,
ggplot2,
mapview,
knitr,
rmarkdown
Imports httr,
readr,
sf
RoxygenNote 6.1.1
VignetteBuilder knitr
Rtopics documented:
read_census_tract...................................... 2
read_meso_region...................................... 3
read_micro_region ..................................... 3
read_municipality...................................... 4
read_municipality2 ..................................... 5
read_state .......................................... 6
read_statistical_grid..................................... 6
read_weighting_area .................................... 7
1
![](asset-2.png)
2read_census_tract
Index 9
read_census_tract Download shape files of census sectors of the Brazilian Population
Census
Description
Download shape files of census sectors of the Brazilian Population Census
Usage
read_census_tract(CODE, year = NULL, zone = "urban")
Arguments
CODE One can either pass the 7-digit code of a Municipality or the 2-digit code of a
State.If CODE="all", all census sectors of the country are loaded.
year the year of the data download (defaults to 2010)
zone "urban" or "rural" for separation in the year 2000
See Also
Other general area functions: read_meso_region,read_micro_region,read_municipality2,
read_municipality,read_state,read_statistical_grid,read_weighting_area
Examples
## Not run:
# Exemplos
dados <- read_census_tract(year=2010)
dados <- read_census_tract(123,2010)
dados <- read_census_tract("df",2010)
dados <- read_census_tract(1302603,2010)
dados <- read_census_tract(35)
dados <- read_census_tract(14,2010)
dados <- read_census_tract()
# mapa
library(mapview)
mapview(dados)
## End(Not run)
![](asset-3.png)
read_meso_region 3
read_meso_region Download shape files of meso region.
Description
Download shape files of meso region.
Usage
read_meso_region(cod_meso, year = NULL)
Arguments
cod_meso The 4-digit code of a meso region. If a two-digit code of a state is passed, the
function will load all meso regions of that state. If cod_meso="all", all meso
regions of the country are loaded.
year Year of the data (defaults to 2010)
See Also
Other general area functions: read_census_tract,read_micro_region,read_municipality2,
read_municipality,read_state,read_statistical_grid,read_weighting_area
Examples
## Not run:
library(geobr)
# Read all meso regions of a state at a given year
meso <- read_meso_region(cod_meso=12, year=2017)
# Read all meso regions of the country at a given year
meso <- read_meso_region(cod_meso="all", year=2010)
## End(Not run)
read_micro_region Download shape files of micro region.
Description
Download shape files of micro region.
Usage
read_micro_region(cod_micro, year = NULL)
![](asset-4.png)
4read_municipality
Arguments
cod_micro 5-digit code of a micro region. If the two-digit code of a state is passed, the
function will load all micro regions of that state. If cod_micro="all", all micro
regions of the country are loaded.
year Year of the data (defaults to 2010)
See Also
Other general area functions: read_census_tract,read_meso_region,read_municipality2,
read_municipality,read_state,read_statistical_grid,read_weighting_area
Examples
## Not run:
library(geobr)
# Read all micro regions of a state at a given year
micro <- read_micro_region(cod_micro=12, year=2017)
# Read all micro regions at a given year
micro <- read_micro_region(cod_micro="all", year=2010)
## End(Not run)
read_municipality Download shape files of municipalities
Description
Download shape files of municipalities
Usage
read_municipality(cod_muni, year = NULL)
Arguments
cod_muni The 7-digit code of a municipality. If the two-digit code of a state is used,
the function will load all municipalities of that state. If cod_muni="all", all
municipalities will be loaded.
year Year of the data (defaults to 2010)
See Also
Other general area functions: read_census_tract,read_meso_region,read_micro_region,
read_municipality2,read_state,read_statistical_grid,read_weighting_area
![](asset-5.png)
read_municipality2 5
Examples
## Not run:
library(geobr)
# Read specific municipality at a given year
mun <- read_municipality(cod_muni=1200179, year=2017)
# Read all municipalities of a state at a given year
mun <- read_municipality(cod_muni=12, year=2010)
## End(Not run)
read_municipality2 Download shape files of municipalities
Description
Download shape files of municipalities
Usage
read_municipality2(cod_muni, year = NULL)
Arguments
cod_muni The 7-digit code of a municipality. If the two-digit code of a state is used,
the function will load all municipalities of that state. If cod_muni="all", all
municipalities will be loaded.
year Year of the data (defaults to 2010)
See Also
Other general area functions: read_census_tract,read_meso_region,read_micro_region,
read_municipality,read_state,read_statistical_grid,read_weighting_area
Examples
## Not run:
library(geobr)
# Read specific municipality at a given year
mun <- read_municipality(cod_muni=1200179, year=2017)
# Read all municipalities of a state at a given year
mun <- read_municipality(cod_muni=12, year=2010)
## End(Not run)
![](asset-6.png)
6read_statistical_grid
read_state Download shape files of Brazilian states
Description
Download shape files of Brazilian states
Usage
read_state(cod_uf, year = NULL)
Arguments
cod_uf The two-digit code of a state. If cod_uf="all", all states will be loaded.
year Year of the data (defaults to 2010)
See Also
Other general area functions: read_census_tract,read_meso_region,read_micro_region,
read_municipality2,read_municipality,read_statistical_grid,read_weighting_area
Examples
## Not run:
library(geobr)
# Read specific municipality at a given year
uf <- read_state(cod_uf=12, year=2017)
# Read all states at a given year
ufs <- read_state(cod_uf="all", year=2010)
## End(Not run)
read_statistical_grid Download shape files of IBGE’s statistical grid (200 x 200 meters)
Description
Download shape files of IBGE’s statistical grid (200 x 200 meters)
Usage
read_statistical_grid(cod_grid, year = NULL)
![](asset-7.png)
read_weighting_area 7
Arguments
cod_grid The 7-digit code of a grid quadrant If the two-letter abbreviation of a state is
used, the function will load all grid gradrants that intersect with that state. If
cod_grid="all", the grid of the whole country will be loaded.
year Year of the data (defaults to 2010). The only year available thus far is 2010.
See Also
Other general area functions: read_census_tract,read_meso_region,read_micro_region,
read_municipality2,read_municipality,read_state,read_weighting_area
Examples
## Not run:
library(geobr)
# Read specific municipality at a given year
grid <- read_statistical_grid(cod_grid = 45, year=2010)
# Read all municipalities of a state at a given year
state_grid <- read_statistical_grid(cod_grid = "RJ")
## End(Not run)
read_weighting_area Download shape files of Census Weighting Areas (área de ponder-
ação) of the Brazilian Population Census
Description
Download shape files of Census Weighting Areas (área de ponderação) of the Brazilian Population
Census
Usage
read_weighting_area(cod_weighting, year = NULL)
Arguments
year the year of the data download (defaults to 2010)
CODE One can either pass the 7-digit code of a Municipality or the 2-digit code of a
State. The function will load the shape files of all weighting areas in the specified
geography
See Also
Other general area functions: read_census_tract,read_meso_region,read_micro_region,
read_municipality2,read_municipality,read_state,read_statistical_grid
8read_weighting_area
Examples
## Not run:
library(geobr)
dados <- read_weighting_area(year=2010)
dados <- read_weighting_area(3500000,2010)
dados <- read_weighting_area(123,2010)
dados <- read_weighting_area("df",2010)
dados <- read_weighting_area(1302603,2010)
dados <- read_weighting_area(35)
dados <- read_weighting_area(14,2010)
dados <- read_weighting_area("all")
# map it
library(mapview)
mapview(dados)
## End(Not run)