diff --git a/DESCRIPTION b/DESCRIPTION index 5f1131a..1fabe09 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: comtradr Title: Interface with the United Nations Comtrade API -Version: 1.0.1 +Version: 1.0.2 Maintainer: Paul Bochtler Authors@R: c( person("Paul", "Bochtler", diff --git a/NEWS.md b/NEWS.md index e968c1b..a95e89d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# comtradr 1.0.2 + +* this is a patch to fix two bugs in the package: + * a missing return in the fcall to tidy_cols did not allow users to set this argument to false, see https://github.com/ropensci/comtradr/issues/88 and commit 6f34592 (thanks @FATelarico) + * a missing parameter in the file size conversion function did not allow the bulk facility to download small files. This has been fixed. + # comtradr 1.0.1 * this is a patch to fix a CRAN policy violation, namely that the cache was written in the wrong directory due to using rappdirs. diff --git a/R/ct_process_response.R b/R/ct_process_response.R index 6ba3b0b..53da327 100644 --- a/R/ct_process_response.R +++ b/R/ct_process_response.R @@ -17,7 +17,8 @@ ct_process_response <- if (bulk) { if (!dir.exists(tools::R_user_dir('comtradr_bulk',which = 'cache'))) { - dir.create(tools::R_user_dir('comtradr_bulk',which = 'cache'), recursive = TRUE) + dir.create(tools::R_user_dir('comtradr_bulk',which = 'cache'), + recursive = TRUE) } filename <- httr2::resp_header(resp, "Content-Disposition") |> stringr::str_remove('.*filename="') |> diff --git a/R/utils.R b/R/utils.R index 225b755..b4728b1 100644 --- a/R/utils.R +++ b/R/utils.R @@ -467,7 +467,7 @@ replace_month <- function(date_str) { #' #' @noRd convert_file_size <- function(file_sizes) { - units <- c(KB = 1024, MB = 1024^2, GB = 1024^3, TB = 1024^4) + units <- c(B = 1, KB = 1024, MB = 1024^2, GB = 1024^3, TB = 1024^4) sapply(file_sizes, function(x) { parts <- strsplit(x, " ")[[1]] number <- as.numeric(parts[1])