Skip to content

Commit

Permalink
trim white space from region
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Arel-Bundock committed Mar 3, 2019
1 parent 09a77e2 commit 70fe97f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ LazyData: yes
Type: Package
LazyLoad: yes
Encoding: UTF-8
Version: 2.5.1-9000
Version: 2.6.0
URL: https://www.github.com/vincentarelbundock/WDI
Date: 2018-12-05
Date: 2019-03-02
Depends:
R (>= 3.1.0)
Imports:
Expand Down
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Version 2.6.0 (2019-02-??)
Version 2.6.0 (2019-03-02)
--------------------------

* `start` and `end` are NULL as default and download all available years.
* `label` attribute to the return data.frame includes descriptive labels for each
* `WDIbulk` function to download all of WDI
* WDIcache and data trim whitespace from region names

Version 2.5.1 (2018-12-05)
--------------------------
Expand Down
7 changes: 7 additions & 0 deletions R/WDI.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# https://stackoverflow.com/questions/9439256/how-can-i-handle-r-cmd-check-no-visible-binding-for-global-variable-notes-when#comment20826625_12429344
# 2012 hadley says "globalVariables is a hideous hack and I will never use it"
# 2014 hadley updates his own answer with globalVariables as one of "two solutions"
globalVariables(c('year', 'value', 'Country.Name', 'Country.Code', 'Indicator.Name', 'Indicator.Code'))

#' WDI: World Development Indicators (World Bank)
#'
#' Downloads the requested data by using the World Bank's API, parses the
Expand Down Expand Up @@ -229,6 +234,8 @@ WDIcache = function(){
out = list('series'=series_dat, 'country'=country_dat)
out$series = iconv(out$series, to = 'utf8')
out$country = iconv(out$country, to = 'utf8')
# some regions have extra whitespace in wb data
out$country[, 'region'] = base::trimws(out$country[, 'region'])
return(out)
}

Expand Down
2 changes: 0 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
This is a minor release of WDI. No change to functionality.

The UTF-8 strings in the data file are intentional and required for proper functionality.

Vincent Arel-Bundock
Binary file modified data/WDI_data.RData
Binary file not shown.

0 comments on commit 70fe97f

Please sign in to comment.