Title: | Download Data from Brazil's Origin Destination Surveys |
---|---|
Description: | Download data from Brazil's Origin Destination Surveys. The package covers both data from household travel surveys, dictionaries of variables, and the spatial geometries of surveys conducted in different years and across various urban areas in Brazil. For some cities, the package will include enhanced versions of the data sets with variables "harmonized" across different years. |
Authors: | Haydee Svab [aut, cre], Beatriz Milz [aut] , Diego Rabatone Oliveira [aut], Rafael H. M. Pereira [aut] |
Maintainer: | Haydee Svab <[email protected]> |
License: | GPL (>=3) |
Version: | 0.1.0 |
Built: | 2024-11-25 05:40:23 UTC |
Source: | https://github.com/hsvab/odbr |
These datasets contain the dictionary for the OD surveys in Sao Paulo. Each row describes one column of the survey data frame.
od_sao_paulo_1977_not_harmonized_dictionary_en od_sao_paulo_1977_not_harmonized_dictionary_es od_sao_paulo_1977_not_harmonized_dictionary_pt od_sao_paulo_1987_not_harmonized_dictionary_en od_sao_paulo_1987_not_harmonized_dictionary_es od_sao_paulo_1987_not_harmonized_dictionary_pt od_sao_paulo_1997_not_harmonized_dictionary_en od_sao_paulo_1997_not_harmonized_dictionary_es od_sao_paulo_1997_not_harmonized_dictionary_pt od_sao_paulo_2007_not_harmonized_dictionary_en od_sao_paulo_2007_not_harmonized_dictionary_es od_sao_paulo_2007_not_harmonized_dictionary_pt od_sao_paulo_2017_not_harmonized_dictionary_en od_sao_paulo_2017_not_harmonized_dictionary_es od_sao_paulo_2017_not_harmonized_dictionary_pt
od_sao_paulo_1977_not_harmonized_dictionary_en od_sao_paulo_1977_not_harmonized_dictionary_es od_sao_paulo_1977_not_harmonized_dictionary_pt od_sao_paulo_1987_not_harmonized_dictionary_en od_sao_paulo_1987_not_harmonized_dictionary_es od_sao_paulo_1987_not_harmonized_dictionary_pt od_sao_paulo_1997_not_harmonized_dictionary_en od_sao_paulo_1997_not_harmonized_dictionary_es od_sao_paulo_1997_not_harmonized_dictionary_pt od_sao_paulo_2007_not_harmonized_dictionary_en od_sao_paulo_2007_not_harmonized_dictionary_es od_sao_paulo_2007_not_harmonized_dictionary_pt od_sao_paulo_2017_not_harmonized_dictionary_en od_sao_paulo_2017_not_harmonized_dictionary_es od_sao_paulo_2017_not_harmonized_dictionary_pt
A data frame with 4 columns:
Name of the variable
Description of the variable
Examples of the categories in the variable
Class of the variable
An object of class data.table
(inherits from data.frame
) with 76 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 76 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 93 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 93 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 93 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 110 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 76 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 110 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 124 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 76 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 124 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 128 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 76 rows and 4 columns.
An object of class data.table
(inherits from data.frame
) with 128 rows and 4 columns.
https://transparencia.metrosp.com.br/dataset/pesquisa-origem-e-destino
This dataset has the list of OD surveys available in the package.
metadata
metadata
metadata
A data frame with 4 columns:
City name
Year of the survey
A logical value showing whether the dataset was harmonized
Language of the dictionary
Return the data dictionary of a specific Origin
Destination Survey, if available. This dictionary is intended to be used to
understand the data downloaded using the odbr::read_od
function. It will
contain the list of variables and, for each variable, a simple description,
the available categories and its class (factor, numeric, etc).
read_dictionary( city = "São Paulo", year = 2017, harmonize = FALSE, language = "pt" )
read_dictionary( city = "São Paulo", year = 2017, harmonize = FALSE, language = "pt" )
city |
Character. City of reference. Defaults to "São Paulo". |
year |
Numeric. Year of reference in the format |
harmonize |
Logical. When |
language |
Character. The language of data dictionary to be opened.
Options include |
A "data.frame"
object.
library(odbr) # return data dictionary from OD Surveys, as data.frame, at a given city and year df <- read_dictionary( city = "Sao Paulo", year = 2017, harmonize = FALSE, language = "pt" )
library(odbr) # return data dictionary from OD Surveys, as data.frame, at a given city and year df <- read_dictionary( city = "Sao Paulo", year = 2017, harmonize = FALSE, language = "pt" )
read_map()
download the geodetic data for a specific Origin Destination survey
and return it as an sf dataframe. It uses the cached data file if it was
previously downloaded to avoid extra networking consumption. To understand
the returned dataframe format, please reefer to the read_dictionary()
function for the same survey cohort.
It is also necessary to specify the geometry granularity wanted, be it
"municipality", "district" or "zone" level of details. Of course, not all
geometries are available for all surveys.
read_map(city = "São Paulo", year = 2017, harmonize = FALSE, geometry = "zone")
read_map(city = "São Paulo", year = 2017, harmonize = FALSE, geometry = "zone")
city |
Character. City of reference. Defaults to "São Paulo". |
year |
Numeric. Year of reference in the format |
harmonize |
Logical. When |
geometry |
Character. The type of spatial data to be opened. Options
include |
An "sf" "data.frame"
object
library(odbr) # return zone data from OD Surveys database as sf object at a given city and year df <- read_map( city = "Sao Paulo", year = 2017, harmonize = FALSE, geometry = "zone" ) #' # return district data from OD Surveys database as sf object at a given city and year df <- read_map( city = "Sao Paulo", year = 2017, harmonize = FALSE, geometry = "district" ) # return municipality data from OD Surveys database as sf object at a given city and year df <- read_map( city = "Sao Paulo", year = 2017, harmonize = FALSE, geometry = "municipality" )
library(odbr) # return zone data from OD Surveys database as sf object at a given city and year df <- read_map( city = "Sao Paulo", year = 2017, harmonize = FALSE, geometry = "zone" ) #' # return district data from OD Surveys database as sf object at a given city and year df <- read_map( city = "Sao Paulo", year = 2017, harmonize = FALSE, geometry = "district" ) # return municipality data from OD Surveys database as sf object at a given city and year df <- read_map( city = "Sao Paulo", year = 2017, harmonize = FALSE, geometry = "municipality" )
read_od()
download the data for a specific Origin Destination survey and
return it as a dataframe. It uses the cached data file if it was previously
downloaded to avoid extra networking consumption. To understand the returned
dataframe format, please reefer to the read_dictionary()
function for the
same survey cohort.
read_od(city = "São Paulo", year = 2017, harmonize = FALSE)
read_od(city = "São Paulo", year = 2017, harmonize = FALSE)
city |
Character. City of reference. Defaults to "São Paulo". |
year |
Numeric. Year of reference in the format |
harmonize |
Logical. When |
A "data.frame"
object.
library(odbr) # return data from OD Surveys database as data.frame df <- read_od( city = "Sao Paulo", year = 2017, harmonize = FALSE )
library(odbr) # return data from OD Surveys database as data.frame df <- read_od( city = "Sao Paulo", year = 2017, harmonize = FALSE )