Skip to content

Commit

Permalink
Merge pull request #15 from tradestatistics/master
Browse files Browse the repository at this point in the history
adds new tables and simplifies some syntax
  • Loading branch information
Pachamaltese authored Aug 8, 2019
2 parents 8571777 + e91894a commit af039f9
Show file tree
Hide file tree
Showing 72 changed files with 3,254 additions and 1,064 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tradestatistics
Type: Package
Title: Open Trade Statistics API Wrapper and Utility Program
Version: 0.2.1
Version: 0.2.2
Authors@R: c(
person(given = "Mauricio",
family = "Vargas",
Expand Down Expand Up @@ -30,6 +30,8 @@ Authors@R: c(
comment = "reviewed an archived package that evolved into the current package for rOpenSci, see https://github.com/ropensci/onboarding/issues/217"),
person(family = "UN Comtrade",
role = "dtc"),
person(family = "The World Bank",
role = "dtc"),
person(family = "Center for International Development at Harvard University",
role = "dtc"),
person(family = "The Observatory of Economic Complexity",
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@

export(ots_country_code)
export(ots_create_tidy_data)
export(ots_inflation_adjustment)
export(ots_product_code)
importFrom(crul,HttpClient)
importFrom(dplyr,as_tibble)
importFrom(dplyr,bind_rows)
importFrom(dplyr,distinct)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,last)
importFrom(dplyr,left_join)
importFrom(dplyr,matches)
importFrom(dplyr,mutate)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,starts_with)
importFrom(dplyr,summarise)
importFrom(jsonlite,fromJSON)
importFrom(magrittr,"%<>%")
importFrom(magrittr,"%>%")
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Version 0.2.2

Adds

* Inflation data
* Inflation adjustment function
* Minor changes in vignettes

# Version 0.2.1

Fixes

* Consistent use of colour vs color, color is used from now
* Fixed available tables description
* Adds `yrp_short` to available tables
* Adds `use_localhost` option for our own server or users who want to clone the
database locally, therefore avoid having a separate branh for server installation

8 changes: 4 additions & 4 deletions R/ots_country_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @keywords functions

ots_country_code <- function(countryname = NULL) {
if(is.null(countryname)) {
if (is.null(countryname)) {
stop(
"
countryname can't be NULL
Expand All @@ -33,8 +33,8 @@ ots_country_code <- function(countryname = NULL) {
countryname <- stringr::str_squish(countryname)
countryname <- stringr::str_trim(countryname)
}
if(any(nchar(countryname) < 1)) {

if (any(nchar(countryname) < 1)) {
stop(
"
countryname can't have zero characters after removing numbers,
Expand Down Expand Up @@ -68,7 +68,7 @@ ots_country_code <- function(countryname = NULL) {
countryname
)

countrycode <- tradestatistics::ots_attributes_countries %>%
countrycode <- tradestatistics::ots_countries %>%
dplyr::filter(
stringr::str_detect(
stringr::str_to_lower(!!sym("country_fullname_english")), countryname
Expand Down
Loading

0 comments on commit af039f9

Please sign in to comment.