Package 'flightsbr'

Title: Download Flight and Airport Data from Brazil
Description: Download flight and airport data from Brazil’s Civil Aviation Agency (ANAC) <https://www.gov.br/anac/pt-br>. The data covers detailed information on aircraft, airports, and airport operations registered with ANAC. It also includes data on airfares, all international flights to and from Brazil, and domestic flights within the country.
Authors: Rafael H. M. Pereira [aut, cre] , Ipea - Institute for Applied Economic Research [cph, fnd]
Maintainer: Rafael H. M. Pereira <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0999
Built: 2024-10-24 17:14:22 UTC
Source: https://github.com/ipeagit/flightsbr

Help Index


flightsbr: Download Flight and Airport Data from Brazil

Description

Download flight and airport data from Brazil’s Civil Aviation Agency (ANAC) https://www.gov.br/anac/pt-br. The data includes detailed information on all aircrafts, aerodromes, airports, and airport movements registered in ANAC, and on every international flight to and from Brazil, as well as domestic flights within the country.

Usage

Please check the vignettes and data documentation on the website.

Author(s)

Maintainer: Rafael H. M. Pereira [email protected] (ORCID)

Other contributors:

  • Ipea - Institute for Applied Economic Research [copyright holder, funder]

See Also

Useful links:


Check the date of the latest airfare data available

Description

Check the date of the latest airfare data available

Usage

latest_airfares_date(dom = TRUE)

Arguments

dom

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

Value

A numeric date in the format yyyymm.

See Also

Other support function: latest_flights_date()

Examples

## Not run:  if (interactive()) {

latest_date <- latest_airfares_date()

}
## End(Not run)

Check the date of the latest flight data available

Description

Check the date of the latest flight data available

Usage

latest_flights_date()

Value

A numeric date in the format yyyymm.

See Also

Other support function: latest_airfares_date()

Examples

## Not run:  if (interactive()) {

latest_date <- latest_flights_date()

}
## End(Not run)

Download aircraft data from Brazil

Description

Download data of all aircraft registered in the Brazilian Aeronautical Registry (Registro Aeronáutico Brasileiro - RAB), organized by the Brazilian Civil Aviation Agency (ANAC). A description of all variables included in the data is available at https://www.gov.br/anac/pt-br/sistemas/rab.

Usage

read_aircraft(date = 202001, showProgress = TRUE, cache = TRUE)

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. The function also accepts a vector of dates, like c(202201, 202301) or c(2022, 2024).

showProgress

Logical. Defaults to TRUE display progress.

cache

Logical. Whether the function should read cached data downloaded previously. Defaults to TRUE. If FALSE, the function will always download the data and overwrite cached data.

Value

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

See Also

Other download flight data: read_aircrafts(), read_flights()

Examples

## Not run:  if (interactive()) {
# Read aircraft data
aircraft <- read_aircraft(date = 202001,
                            showProgress = TRUE)


}
## End(Not run)

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,
  cache = TRUE
)

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. The function also accepts a vector of dates, like c(202201, 202301) or c(2022, 2024).

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.

cache

Logical. Whether the function should read cached data downloaded previously. Defaults to TRUE. If FALSE, the function will always download the data and overwrite cached data.

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)

Download airport movement data from Brazil

Description

Download airport movements data from Brazil’s Civil Aviation Agency (ANAC). The data covers all passenger, aircraft, cargo and mail movement data from airports regulated by ANAC. Data only available from Jan 2019 onwards. A description of all variables included in the data is available at https://www.anac.gov.br/acesso-a-informacao/dados-abertos/areas-de-atuacao/operador-aeroportuario/dados-de-movimentacao-aeroportuaria/60-dados-de-movimentacao-aeroportuaria.

Usage

read_airport_movements(date = 202001, showProgress = TRUE, cache = TRUE)

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. The function also accepts a vector of dates, like c(202201, 202301) or c(2022, 2024).

showProgress

Logical. Defaults to TRUE display progress.

cache

Logical. Whether the function should read cached data downloaded previously. Defaults to TRUE. If FALSE, the function will always download the data and overwrite cached data.

Value

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

Examples

## Not run:  if (interactive()) {
# Read airport movement data
amov202006 <- read_airport_movements(date = 202006)

amov2020 <- read_airport_movements(date = 2020)
}
## End(Not run)

Download airports data from Brazil

Description

Download data of all airports and aerodromes registered in Brazil’s Civil Aviation Agency (ANAC). Data source: https://www.gov.br/anac/pt-br/acesso-a-informacao/dados-abertos/areas-de-atuacao/aerodromos. The data dictionary for public airports can be found at https://www.anac.gov.br/acesso-a-informacao/dados-abertos/areas-de-atuacao/aerodromos/lista-de-aerodromos-publicos-v2/70-lista-de-aerodromos-publicos-v2. The data dictionary for private airports can be found at https://www.anac.gov.br/acesso-a-informacao/dados-abertos/areas-de-atuacao/aerodromos/lista-de-aerodromos-privados-v2.

Usage

read_airports(type = "all", showProgress = TRUE, cache = TRUE)

Arguments

type

String. Whether the function should download data on all, public or private airports. Defaults to all, returning fewer columns. Downloading public and private airports separately will return the full set of columns available for each of those data sets.

showProgress

Logical. Defaults to TRUE display progress.

cache

Logical. Whether the function should read cached data downloaded previously. Defaults to TRUE. If FALSE, the function will always download the data and overwrite cached data.

Value

A ⁠"data.table" "data.frame"⁠ object.

Examples

## Not run:  if (interactive()) {
# Read airports data
all_airports <- read_airports(type = 'all')

public_airports <- read_airports(type = 'public')

private_airports <- read_airports(type = 'private')
}
## End(Not run)

Download flight data from Brazil

Description

Download flight data from Brazil’s Civil Aviation Agency (ANAC). The data includes detailed information on every international flight to and from Brazil, as well as domestic flights within the country. The data include flight-level information of airports of origin and destination, flight duration, aircraft type, payload, and the number of passengers, and several other variables. A description of all variables included in the data is available at https://www.gov.br/anac/pt-br/assuntos/regulados/empresas-aereas/Instrucoes-para-a-elaboracao-e-apresentacao-das-demonstracoes-contabeis/descricao-de-variaveis.

Usage

read_flights(
  date = 202001,
  type = "basica",
  showProgress = TRUE,
  select = NULL,
  cache = TRUE
)

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. The parameter also accepts a vector of dates such as c(202001, 202006, 202012).

type

String. Whether the data set should be of the type basica (flight stage, the default) or combinada (On flight origin and destination - OFOD).

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.

cache

Logical. Whether the function should read cached data downloaded previously. Defaults to TRUE. If FALSE, the function will always download the data and overwrite cached data.

Value

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

See Also

Other download flight data: read_aircraft(), read_aircrafts()

Examples

## Not run:  if (interactive()) {
# Read flights data
f201506 <- read_flights(date = 201506)

f2015 <- read_flights(date = 2015)
}
## End(Not run)