odbr provides helpful functions to download Data from Brazil’s Origin Destination Surveys both the survey data and its maps, and also the surveys data dictionaries that explains each variable.The package provides databases, maps, and data dictionaries in English,Portuguese, and Spanish. Furthermore, it is possible to download harmonized data across different cohorts for the same city.
obs.: The package is still under development. At the moment, odbr only includes raw data from the 1977 to 2017 OD surveys from São Paulo, but it is being expanded to cover more years and cities.
You can install the development version of odbr from CRAN with:
# install from CRAN
install.packages("odbr")
library(odbr)
You can install the development version of odbr from GitHub with:
# or use the development version with latest features
::install_github("hsvab/odbr")
devtoolslibrary(odbr)
The package currently includes 2 main functions to download census data:
read_od()
read_map()
odbr also includes a support function to help users navigate databases, providing convenient information on data variables through data dictionaries in 3 languages (English - en, Portuguese from Brazil - pt, and Spanish - es):
read_dicitionary()
The syntax of all odbr
functions operate on the same logic so it becomes intuitive to download any data set using a single line of code. Like this:
library(odbr)
# Return data from OD Surveys database as data.frame
read_od(
df <-city = "Sao Paulo",
year = 1977,
harmonize = FALSE
)
# Return zone data from OD Surveys database as sf object at a given city and year
read_map(
df <-city = "Sao Paulo",
year = 1977,
harmonize = FALSE,
geometry = "zone"
)
# Return data dictionary from OD Surveys, as data.frame, at a given city and year
read_dictionary(
df <-city = "Sao Paulo",
year = 1977,
harmonize = FALSE,
language = "pt"
)
The original geodetic reference system remained unchanged.
City | Years available | Harmonized | Dictionary languages | Source |
---|---|---|---|---|
São Paulo | 1977, 1987, 1997, 2007, 2017 | No | en, es, pt-br | Metrô-SP |
There is no harmonized data available yet.
All harmonized datasets use geodetic reference system “SIRGAS2000”, CRS(4674).