diff --git a/R/latest_flights_date.R b/R/latest_flights_date.R index 900d173..24f1c54 100644 --- a/R/latest_flights_date.R +++ b/R/latest_flights_date.R @@ -8,7 +8,7 @@ #' latest_date <- latest_flights_date() #' #'}} -latest_flights_date <- function(){ +latest_flights_date <- function(){ # nocov start # get all dates available all_dates <- get_flight_dates_available() @@ -16,7 +16,7 @@ latest_flights_date <- function(){ # find latest date latest_date <- max(all_dates) return(latest_date) -} +} # nocov end @@ -34,7 +34,7 @@ latest_flights_date <- function(){ #' latest_date <- latest_airfares_date() #' #'}} -latest_airfares_date <- function(dom=TRUE){ +latest_airfares_date <- function(dom=TRUE){ # nocov start # get all dates available all_dates <- get_airfares_dates_available(dom) @@ -42,4 +42,4 @@ latest_airfares_date <- function(dom=TRUE){ # find latest date latest_date <- max(all_dates) return(latest_date) -} +} # nocov end diff --git a/R/utils_aircrafts.R b/R/utils_aircrafts.R index 3211313..dd80abf 100644 --- a/R/utils_aircrafts.R +++ b/R/utils_aircrafts.R @@ -122,7 +122,7 @@ download_aircrafts_data <- function(file_url = parent.frame()$file_url, dest_file = temp_local_file, cache = cache) # check if internet connection worked - if (is.null(check_download)) { # nocov start + if (is.null(check_download)) { message("Problem connecting to ANAC data server. Please try it again.") #nocov return(invisible(NULL)) #nocov } diff --git a/R/utils_airfares.R b/R/utils_airfares.R index 195eb21..9053d30 100644 --- a/R/utils_airfares.R +++ b/R/utils_airfares.R @@ -108,8 +108,8 @@ get_airfares_dates_available <- function(dom) { #' # Generate url #' a <- get_airfares_url(year=2002, month=11) #'}} -get_airfares_url <- function(dom, - date = parent.frame()$date) { # nocov start +get_airfares_url <- function(dom, # nocov start + date = parent.frame()$date) { # nocov end # Domestic flights if( isTRUE(dom) ) { @@ -213,8 +213,8 @@ download_airfares_data <- function(file_urls = parent.frame()$file_urls, cache = cache) # check if internet connection worked if (is.null(check_download)) { # nocov start - message("Problem connecting to ANAC data server. Please try it again.") #nocov - return(invisible(NULL)) #nocov + message("Problem connecting to ANAC data server. Please try it again.") # nocov + return(invisible(NULL)) # nocov } } diff --git a/R/utils_airport_movement.R b/R/utils_airport_movement.R index eca128c..2995f53 100644 --- a/R/utils_airport_movement.R +++ b/R/utils_airport_movement.R @@ -180,6 +180,6 @@ download_airport_movement_data <- function(file_url = parent.frame()$file_url, data.table::setDTthreads(orig_threads) return(dt) -} +} # nocov end diff --git a/R/utils_flightst.R b/R/utils_flightst.R index b8e4efe..2d8cf4f 100644 --- a/R/utils_flightst.R +++ b/R/utils_flightst.R @@ -141,7 +141,7 @@ download_flights_data <- function(file_url = parent.frame()$file_url, if (is.null(check_download)) { # nocov start message("Problem connecting to ANAC data server. Please try it again.") #nocov return(invisible(NULL)) #nocov - } + } # nocov end } diff --git a/cran-comments.md b/cran-comments.md index 7470070..2d86a60 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -10,15 +10,17 @@ Duration: 8m 26.7s # flightsbr dev v1.0.0 -* Major changes: - * Fixed ANAC's broken link of public airports - * Functions `read_flights()`, `read_airport_movements()`, and `read_aircrafts()` now accept vectors of dates like `c(202201, 202301)` or `c(2022, 2024)` - * Functions `read_airports()` and `read_aircrafts()` now has a `cache` parameter. +* Breaking changes: + * The names of all columns in the data outputs are now cleanned with {janitor} + * Function `read_airports()` now downloads v2 version of public airports data. Closes [#41](https://github.com/ipeaGIT/flightsbr/issues/41) +* Major changes: + * Function `read_airfares()` is working again. Closes [#30](https://github.com/ipeaGIT/flightsbr/issues/30). The prices of air tickets are now returned as numeric. + * Function `read_flights()` with fixed decimal values in numeric columns. Closes [#43](https://github.com/ipeaGIT/flightsbr/issues/43) + * Function `read_airports()` with fixed numeric values for `"altitude"` column. Closes [#42](https://github.com/ipeaGIT/flightsbr/issues/42) + * Minor changes: - * Removed dependency on the {httr} package - * Now using curl::multi_download() to download files in parallel. This brings the advantage that the pacakge now automatically detects whether the data file has been updated and should be downloaded again. - * Streamlined functions to simplify package maintenance and improve performance - * Using {fs} to manage file paths and {archive} to unzip files - * Reorganization of internal functions to simplify package maintenance - + * Internally check of the consistency of date inputs. The date input must be consistent in either a 6-digit format `yyyymm` OR a 4-digit format `yyyy`. + * New support function `latest_airfares_date()` + * Fix error that stopped reading aircraft data `read_aircrafts()` for multiple months when the number of collums differed across months. Fixed using `data.table::rbindlist(fill = TRUE)` +