
Download microdata of death records from Brazil's census
Source:R/read_mortality.R
read_mortality.RdDownload microdata of death records from Brazil's census. Data collected in the sample component of the questionnaire.
Usage
read_mortality(
year,
columns = NULL,
add_labels = NULL,
merge_households = FALSE,
as_data_frame = FALSE,
showProgress = TRUE,
cache = TRUE,
verbose = TRUE
)Arguments
- year
Numeric. Year of reference in the format
yyyy.- columns
String. A vector of column names to keep. The rest of the columns are not read. Defaults to
NULLand read all columns.- add_labels
Character. Whether the function should add labels to the responses of categorical variables. When
add_labels = "pt", the function adds labels in Portuguese. Defaults toNULL.- merge_households
Logical. Indicate whether the function should merge household variables to the output data. Defaults to
FALSE.- as_data_frame
Logical. When
FALSE(Default), the function returns an Arrow Dataset, which allows users to work with larger-than-memory data. IfTRUE, the function returnsdata.frame.- showProgress
Logical. Defaults to
TRUEdisplay download progress bar. The progress bar only reflects only the downloading time, not the time to load the data to memory.- cache
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,censobrwill download the file and store it locally so that the file only needs to be download once. IfFALSE, the function will download the data again and overwrite the local file.- verbose
A logical. Whether the function should print informative messages. Defaults to
TRUE.
See also
Other Microdata:
read_emigration(),
read_families(),
read_households(),
read_population()
Examples
library(censobr)
# return data as arrow Dataset
df <- read_mortality(
year = 2010,
showProgress = FALSE
)
#> ℹ Downloading data and storing it locally for future use.
# dplyr::glimpse(df)
# return data as data.frame
df <- read_mortality(
year = 2010,
as_data_frame = TRUE,
showProgress = FALSE
)
#> ℹ Reading data cached locally.
# dplyr::glimpse(df)