Download census tract-level aggregate data from Brazil's censuses.
read_tracts(
year = 2010,
dataset = NULL,
as_data_frame = FALSE,
showProgress = TRUE,
cache = TRUE
)
Numeric. Year of reference in the format yyyy
. Defaults to 2010
.
Character. The dataset to be opened. Options currently include
c("Basico", "Domicilio", "DomicilioRenda", "Responsavel", "ResponsavelRenda", "Pessoa", "PessoaRenda", "Entorno")
.
Preliminary results of the 2022 census are available with "Preliminares"
.
Logical. When FALSE
(Default), the function returns an
Arrow Dataset, which allows users to work with larger-than-memory data.
If TRUE
, the function returns data.frame
.
Logical. Defaults to TRUE
display download progress
bar. The progress bar only reflects only the downloading
time, not the time to load the data to memory.
Logical. Whether the function should read the data cached
locally, which is much faster. Defaults to TRUE
. The first time the
user runs the function, censobr
will download the file and store it
locally so that the file only needs to be download once. If FALSE
,
the function will download the data again and overwrite the local file.
An arrow Dataset
or a "data.frame"
object.
# return data as arrow Dataset
df <- read_tracts(year = 2010,
dataset = 'PessoaRenda',
showProgress = FALSE)
#> Downloading data and storing it locally for future use.
# return data as data.frame
df <- read_tracts(year = 2010,
dataset = 'Basico',
as_data_frame = TRUE,
showProgress = FALSE)
#> Downloading data and storing it locally for future use.