| 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] (ORCID: <https://orcid.org/0000-0003-2125-7465>), Arthur Bazolli [ctb], Ipea - Institute for Applied Economic Research [cph, fnd] |
| Maintainer: | Rafael H. M. Pereira <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.0.9000 |
| Built: | 2026-11-16 17:10:43 UTC |
| Source: | https://github.com/ipea/flightsbr |
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.
Please check the vignettes and data documentation on the website.
Maintainer: Rafael H. M. Pereira [email protected] (ORCID)
Authors:
Rafael H. M. Pereira [email protected] (ORCID)
Other contributors:
Arthur Bazolli [email protected] [contributor]
Ipea - Institute for Applied Economic Research [copyright holder, funder]
Useful links:
Report bugs at https://github.com/ipea/flightsbr/issues
Check the date of the latest airfare data available
latest_airfares_date(dom = TRUE)latest_airfares_date(dom = TRUE)
dom |
Logical. Defaults to |
A numeric date in the format yyyymm.
Other support function:
latest_flights_date()
## Not run: if (interactive()) { latest_date <- latest_airfares_date() } ## End(Not run)## Not run: if (interactive()) { latest_date <- latest_airfares_date() } ## End(Not run)
Check the date of the latest flight data available
latest_flights_date()latest_flights_date()
A numeric date in the format yyyymm.
Other support function:
latest_airfares_date()
## Not run: if (interactive()) { latest_date <- latest_flights_date() } ## End(Not run)## Not run: if (interactive()) { latest_date <- latest_flights_date() } ## End(Not run)
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.
read_aircraft(date = NULL, showProgress = TRUE, cache = TRUE)read_aircraft(date = NULL, showProgress = TRUE, cache = TRUE)
date |
Numeric. Date of the data in the format |
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read cached data downloaded
previously. Defaults to |
A "data.table" "data.frame" object. Columns of counts and
measures are numeric; codes and identifiers (e.g. flight numbers,
serial numbers, airport codes) are character, keeping leading
zeros. A column with some values that are not numbers stays
character, with a message.
Other download flight data:
read_aircrafts(),
read_flights()
## Not run: if (interactive()) { # Read aircraft data aircraft <- read_aircraft(date = 202409, showProgress = TRUE ) } ## End(Not run)## Not run: if (interactive()) { # Read aircraft data aircraft <- read_aircraft(date = 202409, showProgress = TRUE ) } ## End(Not run)
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.
read_airfares( date = NULL, domestic = TRUE, showProgress = TRUE, select = NULL, cache = TRUE )read_airfares( date = NULL, domestic = TRUE, showProgress = TRUE, select = NULL, cache = TRUE )
date |
Numeric. Date of the data in the format |
domestic |
Logical. Defaults to |
showProgress |
Logical. Defaults to |
select |
A vector of column names or positions to keep. The order that
the columns passed determines the order of the columns in the result.
In |
cache |
Logical. Whether the function should read cached data downloaded
previously. Defaults to |
ANAC has changed the column names of these files several times. All files
are returned with the names ANAC uses in its current files
(nr_ano_referencia, nr_mes_referencia, sg_empresa_icao,
sg_icao_origem, sg_icao_destino, nr_tarifa, nr_assentos and, for
international flights, sg_icao_retorno, cd_classe_ida,
cd_classe_volta), so files from different years can be combined.
select accepts these names as well as older names such as "TARIFA" or
"ano".
A "data.table" "data.frame" object.
## 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)## 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 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 March 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.
read_airport_movements(date = NULL, showProgress = TRUE, cache = TRUE)read_airport_movements(date = NULL, showProgress = TRUE, cache = TRUE)
date |
Numeric. Date of the data in the format |
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read cached data downloaded
previously. Defaults to |
A "data.table" "data.frame" object. Columns of counts and
measures are numeric; codes and identifiers (e.g. flight numbers,
serial numbers, airport codes) are character, keeping leading
zeros. A column with some values that are not numbers stays
character, with a message.
## Not run: if (interactive()) { # Read airport movement data amov202006 <- read_airport_movements(date = 202006) amov2020 <- read_airport_movements(date = 2020) } ## End(Not run)## Not run: if (interactive()) { # Read airport movement data amov202006 <- read_airport_movements(date = 202006) amov2020 <- read_airport_movements(date = 2020) } ## End(Not run)
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.
read_airports(type = "all", showProgress = TRUE, cache = TRUE)read_airports(type = "all", showProgress = TRUE, cache = TRUE)
type |
String. Whether the function should download data on |
showProgress |
Logical. Defaults to |
cache |
Logical. Whether the function should read cached data downloaded
previously. Defaults to |
A "data.table" "data.frame" object.
## 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)## 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’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.
read_flights( date = NULL, type = "basica", showProgress = TRUE, select = NULL, cache = TRUE )read_flights( date = NULL, type = "basica", showProgress = TRUE, select = NULL, cache = TRUE )
date |
Numeric. Date of the data in the format |
type |
String. Whether the data set should be of the type |
showProgress |
Logical. Defaults to |
select |
A vector of column names or positions to keep. The order that
the columns passed determines the order of the columns in the result.
In |
cache |
Logical. Whether the function should read cached data downloaded
previously. Defaults to |
A "data.table" "data.frame" object. Columns of counts and
measures are numeric; codes and identifiers (e.g. flight numbers,
serial numbers, airport codes) are character, keeping leading
zeros. A column with some values that are not numbers stays
character, with a message.
Other download flight data:
read_aircraft(),
read_aircrafts()
## Not run: if (interactive()) { # Read flights data f201506 <- read_flights(date = 201506) f2015 <- read_flights(date = 2015) } ## End(Not run)## Not run: if (interactive()) { # Read flights data f201506 <- read_flights(date = 201506) f2015 <- read_flights(date = 2015) } ## End(Not run)