comtradr 0.3.0
CRAN release: 2022-04-20
NEW FEATURES
- Modifications to
ct_search()
to add support for commodity codeag6
(#30)
BUG FIXES
Function
ct_register_token()
now checks if the provided token is recognized by the official API and only grants “premium” credentials if it is (#34).Passing an API token string to
ct_register_token()
now properly bumps the hourly rate limit up to 10,000 (#21).In func
ct_search()
, passing a character vector of long-form commodity descriptions to argcommod_codes
will now throw an error prior to making an API call, which would fail (#24).Update the country package data, to stay up to date with the reporter/partner country table that Comtrade is using. This is an update to the file
inst/extdata/country_table.rda
. (#29).In func
ct_search()
, improve error messaging when an input country is invalid. (#31).In func
ct_search()
, fix bug in which running queries using theSITCrev2
commodity type was returning raw HTML (as opposed to json data). (#27).In func
ct_country_lookup()
, removeNA
inputs from multi-country lookups (previouslyNA
was being stringified and included in the pipe-separated regex lookup).
comtradr 0.2.1
CRAN release: 2018-05-05
NEW FEATURES
- Modifications to
ct_search()
to allow for pulling all monthly data for an entire year in a single query (#14) - For function
ct_search()
, expanded the valid input types for argsstart_date
andend_date
(#10).
BUG FIXES
-
ct_search()
now supports all commodity classifications offered by UN Comtrade (#16). - The updates generated by function
ct_update_databases()
are now properly preserved between R sessions (#11). - Passing
"services"
to argtype
within functionct_search()
now uses commodity classificationEB02
by default (previously this would throw an error, fixes #6). - When using commodity classification
EB02
within functionct_search()
, passing"TOTAL"
to argcommod_codes
no longer returns zero results (#7). -
ct_commodity_lookup()
no longer returns zero results when passing all caps input to argsearch_terms
(#9).
comtradr 0.1.0
CRAN release: 2017-10-24
PKG API CHANGES
- Eliminated functions
ct_commodities_table
andct_countries_table
. - Added new functions
ct_update_databases
,ct_use_pretty_cols
,ct_commodity_db_type
,ct_register_token
,ct_get_reset_time
,ct_get_remaining_hourly_queries
. - Renamed functions:
commodity_lookup
is nowct_commodity_lookup
,country_lookup
is nowct_country_lookup
. - The commodity and country reference tables are now saved as cached package data, and accessed by
comtradr
functions when necessary. This replaces the need for functionsct_commodities_table
andct_countries_table
. - Reorder function arguments within function
ct_search
. - Changed some function argument names to ensure
snake_case
is being used throughout the package. -
ct_search
now returns a data frame, as opposed to a list.
MINOR CHANGES
- Added a vignette directory, with an “Intro to comtradr” vignette.
- API requests are now throttled based on the rate limits imposed by the UN Comtrade.
- Added function for setting a valid API key/token (
ct_register_token
). - Appending API metadata to each returned data frame as attributes (url of the API call, date-time of the query, duration of the query in seconds).
- Added package level man page.
- Now using native R errors/warnings, as opposed to nesting API status codes in a returned list.
-
Imports
changes: removedplyr
, addmagrittr
andpurrr
. - Expand and improve test coverage via testthat.
BUG FIXES
- The issues related to type-safety in function
commodity_lookup
have been fixed by importingpurrr
and usingpurrr::map
in place ofsapply
. This fixes issue #2 and issue #3.
comtradr 0.0.2 (2017-07-03)
CRAN release: 2017-07-03
NEW FEATURES
- commodity_lookup(): Expanded function to accept multiple commodities or commodity codes (as either character vector or numeric vector). Also added argument “return_char” that allows the user to specify list output or char vector output, and argument “return_code” that specifies output of commodity descriptions or commodity codes.
MINOR IMPROVEMENTS
- Add unit tests via testthat.