read_airfares {flightsbr}R Documentation

Download data on airfares flights in Brazil

Description

Download data on air fares of domestic and international flights in Brazil. The data is collected by Brazil’s Civil Aviation Agency (ANAC). A description of all variables included in the data for domestic airfares is available at https://www.anac.gov.br/acesso-a-informacao/dados-abertos/areas-de-atuacao/voos-e-operacoes-aereas/tarifas-aereas-domesticas/46-tarifas-aereas-domesticas. A description of all variables included in the data for international airfares is available at https://www.gov.br/anac/pt-br/assuntos/dados-e-estatisticas/microdados-de-tarifas-aereas-comercializadas.

Usage

read_airfares(
  date = 202001,
  domestic = TRUE,
  showProgress = TRUE,
  select = NULL
)

Arguments

date

Numeric. Date of the data in the format yyyymm. Defaults to 202001. To download the data for all months in a year, the user can pass a 4-digit year input yyyy.

domestic

Logical. Defaults to TRUE download airfares of domestic flights. If FALSE, the function downloads airfares of international flights.

showProgress

Logical. Defaults to TRUE display progress.

select

A vector of column names or positions to keep. The rest of the columns are not read. The order that the columns passed determines the order of the columns in the result.

Value

A ⁠"data.table" "data.frame"⁠ object. All columns are returned with class of type "character".

Examples

## Not run:  if (interactive()) {
# Read air fare data
af_201506 <- read_airfares(date = 201506, domestic = TRUE)

af_2015 <- read_airfares(date = 2015, domestic = TRUE)
}
## End(Not run)

[Package flightsbr version 0.4.1 Index]