From 5501b8c565fa320c6b1f1049a190a7d966fb4580 Mon Sep 17 00:00:00 2001 From: Jesse Piburn Date: Fri, 28 Feb 2020 10:51:30 -0500 Subject: [PATCH] update docs --- .Rbuildignore | 2 ++ .gitignore | 2 ++ inst/CITATION | 8 ++++---- vignettes/wbstats.Rmd | 5 +++-- vignettes/wbstats.md | 42 +++++++++++++++++++++--------------------- 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index f9011f2..ecc8e83 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,5 @@ ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +^doc$ +^Meta$ diff --git a/.gitignore b/.gitignore index 807ea25..80db6b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .Rproj.user .Rhistory .RData +doc +Meta diff --git a/inst/CITATION b/inst/CITATION index f16619a..a65331e 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -5,13 +5,13 @@ citEntry(entry = "Manual", author = personList(as.person("Jesse Piburn")), organization = "Oak Ridge National Laboratory", address = "Oak Ridge, Tennessee", - year = "2018", - url = "https://www.ornl.gov/division/csed/gist", + year = "2020", + url = "https://doi.org/10.11578/dc.20171025.1827", textVersion = - paste("Jesse Piburn (2018).", + paste("Jesse Piburn (2020).", "wbstats: Programmatic Access to the World Bank API.", "Oak Ridge National Laboratory.", "Oak Ridge, Tennessee.", - "URL https://www.ornl.gov/division/csed/gist") + "URL https://doi.org/10.11578/dc.20171025.1827") ) diff --git a/vignettes/wbstats.Rmd b/vignettes/wbstats.Rmd index cdcd755..0abb674 100644 --- a/vignettes/wbstats.Rmd +++ b/vignettes/wbstats.Rmd @@ -7,7 +7,7 @@ vignette: > %\VignetteIndexEntry{wbstats} %\VignetteEngine{knitr::knitr} %\VignetteEncoding{UTF-8} - + --- @@ -221,7 +221,8 @@ head(gdp_capita) Because the majority of data available from the World Bank is at the annual resolution, by default dates in `wbstats` are returned as `numeric`s. This default makes common tasks like filtering easier. If you would like the date field to be of class `Date` you can set `date_as_class_date = TRUE` # Some Sharp Corners -There are a few behaviors of the World Bank API that being aware of could help explain some potentially unexpected results. These results are known but no special actions are taken to mitigate them as they are the result of the API itself and artifically limiting the inputs or results could potentially causes problems or create unnecessary rescrictions in the future. +There are a few behaviors of the World Bank API that being aware of could help explain some potentially unexpected results. These results are known but no special actions are taken to mitigate them as they are the result of the API itself and artifically limiting the inputs or results could potentially causes problems or create unnecessary rescrictions in the future. + ## Searching in other languages Not all data sources support all languages. If an indicator does not have a translation for a particular language, the non-supported fields will return as `NA`. This could potentially result in a differing number of matching indicators from `wb_search()` diff --git a/vignettes/wbstats.md b/vignettes/wbstats.md index a3aa6f4..c07134e 100644 --- a/vignettes/wbstats.md +++ b/vignettes/wbstats.md @@ -7,7 +7,7 @@ vignette: > %\VignetteIndexEntry{wbstats} %\VignetteEngine{knitr::knitr} %\VignetteEncoding{UTF-8} - + --- @@ -208,12 +208,12 @@ head(pop_data) #> # A tibble: 6 x 9 #> iso2c iso3c country date SP.POP.TOTL unit obs_status footnote last_updated #> -#> 1 AW ABW Aruba 2000 90853 2020-02-26 -#> 2 AW ABW Aruba 2001 92898 2020-02-26 -#> 3 AW ABW Aruba 2002 94992 2020-02-26 -#> 4 AF AFG Afghanis~ 2000 20779953 2020-02-26 -#> 5 AF AFG Afghanis~ 2001 21606988 2020-02-26 -#> 6 AF AFG Afghanis~ 2002 22600770 2020-02-26 +#> 1 AW ABW Aruba 2000 90853 2020-02-27 +#> 2 AW ABW Aruba 2001 92898 2020-02-27 +#> 3 AW ABW Aruba 2002 94992 2020-02-27 +#> 4 AF AFG Afghanis~ 2000 20779953 2020-02-27 +#> 5 AF AFG Afghanis~ 2001 21606988 2020-02-27 +#> 6 AF AFG Afghanis~ 2002 22600770 2020-02-27 ``` If you are interested in only some subset of countries or regions you can pass along the specific codes to the `country` parameter. The country and region codes and names that can be passed to the `country` parameter as well, most prominently the coded values from the `iso2c` and `iso3c` from the `countries` data frame in `wb_cachelist` or the return of `wb_cache()`. Any values from the above columns can mixed together and passed to the same call @@ -232,13 +232,13 @@ pop_data #> # A tibble: 7 x 9 #> iso2c iso3c country date SP.POP.TOTL unit obs_status footnote last_updated #> -#> 1 AW ABW Aruba 2012 102560 2020-02-26 -#> 2 AF AFG Afghanis~ 2012 31161376 2020-02-26 -#> 3 AL ALB Albania 2012 2900401 2020-02-26 -#> 4 7E ECA Europe &~ 2012 403265869 2020-02-26 -#> 5 8S SAS South As~ 2012 1683747130 2020-02-26 -#> 6 ZG SSF Sub-Saha~ 2012 917726973 2020-02-26 -#> 7 XD HIC High inc~ 2012 1170223344 2020-02-26 +#> 1 AW ABW Aruba 2012 102560 2020-02-27 +#> 2 AF AFG Afghanis~ 2012 31161376 2020-02-27 +#> 3 AL ALB Albania 2012 2900401 2020-02-27 +#> 4 7E ECA Europe &~ 2012 403265869 2020-02-27 +#> 5 8S SAS South As~ 2012 1683747130 2020-02-27 +#> 6 ZG SSF Sub-Saha~ 2012 917726973 2020-02-27 +#> 7 XD HIC High inc~ 2012 1170223344 2020-02-27 ``` As of `wbstats 1.0` queries are now returned in wide format. This was a request made by multiple users and is in line with the principles of [tidy data](https://www.jstatsoft.org/article/view/v059i10). If you would like to return the data in a long format, you can set `return_wide = FALSE` @@ -322,12 +322,12 @@ head(gdp_capita) #> # A tibble: 6 x 8 #> iso2c iso3c country date NY.GDP.PCAP.CD obs_status footnote last_updated #> -#> 1 AW ABW Aruba 2017 25630. 2020-02-26 -#> 2 AF AFG Afghanistan 2018 521. 2020-02-26 -#> 3 AO AGO Angola 2018 3432. 2020-02-26 -#> 4 AL ALB Albania 2018 5269. 2020-02-26 -#> 5 AD AND Andorra 2018 42030. 2020-02-26 -#> 6 AE ARE United Arab~ 2018 43005. 2020-02-26 +#> 1 AW ABW Aruba 2017 25630. 2020-02-27 +#> 2 AF AFG Afghanistan 2018 521. 2020-02-27 +#> 3 AO AGO Angola 2018 3432. 2020-02-27 +#> 4 AL ALB Albania 2018 5269. 2020-02-27 +#> 5 AD AND Andorra 2018 42030. 2020-02-27 +#> 6 AE ARE United Arab~ 2018 43005. 2020-02-27 ``` ### Dates @@ -351,7 +351,7 @@ sum(is.na(cache_en$indicators$indicator)) # spanish cache_es <- wb_cache(lang = "es") sum(is.na(cache_es$indicators$indicator)) -#> [1] 14626 +#> [1] 14628 ```