From 01721b8f7a53fe37e1bf4b464a5e872d0a5afbc9 Mon Sep 17 00:00:00 2001 From: Tony Fujs Date: Tue, 20 Sep 2022 10:22:38 +0200 Subject: [PATCH 1/6] Increment version number to 0.0.3.9000 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 754b8fc..2e07226 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: pipr Title: Client for the PIP API -Version: 0.0.3 +Version: 0.0.3.9000 Authors@R: c(person(given = "Tony", family = "Fujs", diff --git a/NEWS.md b/NEWS.md index 96697a4..1a379bf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# pipr (development version) + # pipr 0.0.3 * [Add new ppp_version and release_version parameters](https://github.com/worldbank/pipr/pull/38) From 9bfa686b870892e6e0bb0f1ccd9b4c4134a6e8e2 Mon Sep 17 00:00:00 2001 From: Tony Fujs Date: Mon, 26 Sep 2022 11:25:20 +0200 Subject: [PATCH 2/6] fix named arguments --- R/get_aux.R | 17 ++++++++--------- R/get_stats.R | 36 ++++++++++++++++++------------------ R/utils.R | 51 +++++++++++++++++++++++++++++---------------------- 3 files changed, 55 insertions(+), 49 deletions(-) diff --git a/R/get_aux.R b/R/get_aux.R index a755b27..5dd343d 100644 --- a/R/get_aux.R +++ b/R/get_aux.R @@ -18,7 +18,9 @@ #' # Get countries #' df <- get_aux("countries") #' } -get_aux <- function(table = NULL, version = NULL, api_version = "v1", +get_aux <- function(table = NULL, + version = NULL, + api_version = "v1", format = c("rds", "json", "csv"), simplify = TRUE, server = NULL) { @@ -26,10 +28,6 @@ get_aux <- function(table = NULL, version = NULL, api_version = "v1", api_version <- match.arg(api_version) format <- match.arg(format) - # Check connection - check_internet() - check_api(api_version, server) - # Build query string u <- build_url(server, "aux", api_version = api_version) @@ -38,7 +36,7 @@ get_aux <- function(table = NULL, version = NULL, api_version = "v1", res <- httr::GET(u) parse_response(res, simplify = simplify) } else { - args <- build_args(table = table, version = version, format = format) + args <- build_args(.table = table, .version = version, .format = format) res <- httr::GET(u, query = args, httr::user_agent(pipr_user_agent)) parse_response(res, simplify = simplify) } @@ -276,9 +274,10 @@ get_ppp <- function(version = NULL, api_version = "v1", #' # Short hand to get region_coverage #' get_region_coverage() #' } -get_region_coverage <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_region_coverage <- function(version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("region_coverage", version = version, api_version = api_version, format = format, server = server diff --git a/R/get_stats.R b/R/get_stats.R index 3136f1a..3d24bab 100644 --- a/R/get_stats.R +++ b/R/get_stats.R @@ -92,18 +92,18 @@ get_stats <- function(country = "all", # Build query string args <- build_args( - country = country, - year = year, - povline = povline, - popshare = popshare, - fill_gaps = fill_gaps, - group_by = group_by, - welfare_type = welfare_type, - reporting_level = reporting_level, - version = version, - ppp_version = ppp_version, - release_version = release_version, - format = format + .country = country, + .year = year, + .povline = povline, + .popshare = popshare, + .fill_gaps = fill_gaps, + .group_by = group_by, + .welfare_type = welfare_type, + .reporting_level = reporting_level, + .version = version, + .ppp_version = ppp_version, + .release_version = release_version, + .format = format ) u <- build_url(server, endpoint, api_version) # Send query @@ -129,14 +129,14 @@ get_wb <- function(year = "all", api_version <- match.arg(api_version) format <- match.arg(format) - # Check connection - check_internet() - check_api(api_version, server) - # Build query string args <- build_args( - country = "all", year = year, povline = povline, - group_by = "wb", version = version, format = format + .country = "all", + .year = year, + .povline = povline, + .group_by = "wb", + .version = version, + .format = format ) u <- build_url(server, "pip-grp", api_version) diff --git a/R/utils.R b/R/utils.R index 92deae9..b0e359d 100644 --- a/R/utils.R +++ b/R/utils.R @@ -60,33 +60,40 @@ build_url <- function(server, endpoint, api_version) { #' build_args #' @inheritParams get_stats #' @noRd -build_args <- function(country = NULL, - year = NULL, - povline = NULL, - popshare = NULL, - fill_gaps = NULL, - group_by = NULL, - welfare_type = NULL, - reporting_level = NULL, - table = NULL, - version = NULL, - ppp_version = ppp_version, - release_version = release_version, - format = NULL) { +build_args <- function(.country = NULL, + .year = NULL, + .povline = NULL, + .popshare = NULL, + .fill_gaps = NULL, + .group_by = NULL, + .welfare_type = NULL, + .reporting_level = NULL, + .table = NULL, + .version = NULL, + .ppp_version = NULL, + .release_version = NULL, + .format = NULL) { # Collapse to a single string - if (length(country) > 1) country <- paste0(country, collapse = ",") - if (length(year) > 1) year <- paste0(year, collapse = ",") + if (length(.country) > 1) .country <- paste0(.country, collapse = ",") + if (length(.year) > 1) .year <- paste0(.year, collapse = ",") args <- list( - country = country, year = year, povline = povline, - popshare = popshare, fill_gaps = fill_gaps, - welfare_type = welfare_type, - reporting_level = reporting_level, - group_by = group_by, table = table, - version = version, ppp_version = ppp_version, - release_version = release_version,format = format + country = .country, + year = .year, + povline = .povline, + popshare = .popshare, + fill_gaps = .fill_gaps, + welfare_type = .welfare_type, + reporting_level = .reporting_level, + group_by = .group_by, + table = .table, + version = .version, + ppp_version = .ppp_version, + release_version = .release_version, + format = .format ) + attempt::stop_if_all(args, is.null, "You need to specify at least one argument") args <- purrr::compact(args) From a8e4ff8e4fdff09673e92260a281b8ea33151ce5 Mon Sep 17 00:00:00 2001 From: Tony Fujs Date: Mon, 26 Sep 2022 11:26:32 +0200 Subject: [PATCH 3/6] update unit tests --- tests/testthat/test-get_aux.R | 3 +++ tests/testthat/test-get_stats.R | 2 +- tests/testthat/test-other.R | 9 +++++--- tests/testthat/test-utils.R | 40 ++++++++++++++++----------------- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/tests/testthat/test-get_aux.R b/tests/testthat/test-get_aux.R index 89aed7c..238d342 100644 --- a/tests/testthat/test-get_aux.R +++ b/tests/testthat/test-get_aux.R @@ -19,6 +19,8 @@ test_that("get_aux() works", { expect_true(tibble::is_tibble(res)) res <- get_aux("gdp") expect_true(tibble::is_tibble(res)) + res <- get_aux("countries", version = NULL, api_version = "v1", format = "rds", server = NULL) + expect_true(tibble::is_tibble(res)) # Return custom response list if simplify FALSE res <- get_aux("gdp", simplify = FALSE) @@ -58,3 +60,4 @@ test_that("User agent works", { tmp <- res$response$request$options$useragent expect_identical(tmp, pipr_user_agent) }) + diff --git a/tests/testthat/test-get_stats.R b/tests/testthat/test-get_stats.R index 86e9bef..b1ce935 100644 --- a/tests/testthat/test-get_stats.R +++ b/tests/testthat/test-get_stats.R @@ -23,7 +23,7 @@ test_that("get_stats() works for a single country-year", { test_that("get_stats() works for multiple countries and years", { df <- get_stats(c("AGO", "ALB"), year = 2000) expect_equal(nrow(df), 1) - df <- get_stats(c("AGO", "ALB"), year = c(2000, 2018)) + df <- get_stats(c("AGO"), year = c(2000, 2018)) expect_equal(nrow(df), 2) }) diff --git a/tests/testthat/test-other.R b/tests/testthat/test-other.R index 7b50bac..df4cbff 100644 --- a/tests/testthat/test-other.R +++ b/tests/testthat/test-other.R @@ -2,13 +2,16 @@ dev_host <- gsub("/api|http://", "", Sys.getenv("PIP_DEV_URL")) qa_host <- gsub("/pip|/api|http(s)?://", "", Sys.getenv("PIP_QA_URL")) test_that("health_check() works", { - expect_identical(health_check(), "PIP API is running") + res <- health_check(api_version = "v1") + expect_identical(httr::content(res)[[1]], "PIP API is running") + expect_equal(res$status_code, 200) + expect_invisible(health_check(api_version = "v1")) expect_error(health_check("xx")) skip_if(Sys.getenv("PIPR_RUN_LOCAL_TESTS") != "TRUE") skip_if(is.null(curl::nslookup(dev_host, error = FALSE)), message = "Could not connect to DEV host") - expect_identical(health_check(server = "dev"), "PIP API is running") + expect_identical(httr::content(health_check(api_version = "v1", server = "dev"))[[1]], "PIP API is running") skip_if(is.null(curl::nslookup(qa_host, error = FALSE)), message = "Could not connect to QA host") - expect_identical(health_check(server = "qa"), "PIP API is running") + expect_identical(httr::content(health_check(api_version = "v1", server = "qa"))[[1]], "PIP API is running") }) test_that("get_versions() works", { diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index b0fa642..9eb1fdb 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -14,15 +14,13 @@ test_that("check_internet() works", { test_that("check_api() works", { res <- check_api("v1", server = NULL) - expect_equal(res$status_code, 200) - expect_invisible(check_api("v1")) - expect_error(check_api("xx")) + expect_equal(res, "PIP API is running") }) test_that("check_status() works", { # 200 - res <- check_api("v1") + res <- health_check("v1") parsed <- parse_response(res, simplify = FALSE)$content expect_true(check_status(res, parsed)) @@ -89,81 +87,81 @@ test_that("build_url() throws error for internal URLs if ENV vars are not found" test_that("build_args() works for all individual parameters", { # country - x <- build_args(country = "AGO") + x <- build_args(.country = "AGO") expect_equal(length(x), 1) expect_identical(names(x), "country") expect_identical(x$country, "AGO") - x <- build_args(country = c("ARG", "BRA")) + x <- build_args(.country = c("ARG", "BRA")) expect_equal(length(x), 1) expect_identical(names(x), "country") expect_identical(x$country, "ARG,BRA") # year - x <- build_args(year = "all") + x <- build_args(.year = "all") expect_equal(length(x), 1) expect_identical(names(x), "year") expect_identical(x$year, "all") - x <- build_args(year = c(2008, 2009)) + x <- build_args(.year = c(2008, 2009)) expect_equal(length(x), 1) expect_identical(names(x), "year") expect_identical(x$year, "2008,2009") # povline - x <- build_args(povline = 1.9) + x <- build_args(.povline = 1.9) expect_equal(length(x), 1) expect_identical(names(x), "povline") expect_identical(x$povline, 1.9) # popshare - x <- build_args(popshare = .5) + x <- build_args(.popshare = .5) expect_equal(length(x), 1) expect_identical(names(x), "popshare") expect_identical(x$popshare, .5) # fill_gaps - x <- build_args(fill_gaps = TRUE) + x <- build_args(.fill_gaps = TRUE) expect_equal(length(x), 1) expect_identical(names(x), "fill_gaps") expect_identical(x$fill_gaps, TRUE) # group_by - x <- build_args(group_by = "wb") + x <- build_args(.group_by = "wb") expect_equal(length(x), 1) expect_identical(names(x), "group_by") expect_identical(x$group_by, "wb") # welfare_type - x <- build_args(welfare_type = "all") + x <- build_args(.welfare_type = "all") expect_equal(length(x), 1) expect_identical(names(x), "welfare_type") expect_identical(x$welfare_type, "all") # reporting_level - x <- build_args(reporting_level = "all") + x <- build_args(.reporting_level = "all") expect_equal(length(x), 1) expect_identical(names(x), "reporting_level") expect_identical(x$reporting_level, "all") # reporting_level - x <- build_args(reporting_level = "all") + x <- build_args(.reporting_level = "all") expect_equal(length(x), 1) expect_identical(names(x), "reporting_level") expect_identical(x$reporting_level, "all") # version - x <- build_args(version = "test") + x <- build_args(.version = "test") expect_equal(length(x), 1) expect_identical(names(x), "version") expect_identical(x$version, "test") # format - x <- build_args(format = "json") + x <- build_args(.format = "json") expect_equal(length(x), 1) expect_identical(names(x), "format") expect_identical(x$format, "json") # table - x <- build_args(table = "regions") + x <- build_args(.table = "regions") expect_equal(length(x), 1) expect_identical(names(x), "table") expect_identical(x$table, "regions") @@ -172,7 +170,7 @@ test_that("build_args() works for all individual parameters", { test_that("build_args() works for mulitiple parameters", { # Multiple parameters - x <- build_args(country = "AGO", year = 2008, povline = 1.9) + x <- build_args(.country = "AGO", .year = 2008, .povline = 1.9) expect_equal(length(x), 3) expect_identical(names(x), c("country", "year", "povline")) expect_identical(x$country, "AGO") @@ -180,7 +178,7 @@ test_that("build_args() works for mulitiple parameters", { expect_equal(x$povline, 1.9) # Check that NULL arguments are removed - x <- build_args(country = "AGO", year = 2008, povline = 1.9, group_by = NULL) + x <- build_args(.country = "AGO", .year = 2008, .povline = 1.9, .group_by = NULL) expect_equal(length(x), 3) expect_identical(names(x), c("country", "year", "povline")) expect_identical(x$country, "AGO") @@ -189,7 +187,7 @@ test_that("build_args() works for mulitiple parameters", { }) test_that("build_args() fails when all parameters are NULL", { - expect_error(build_args(country = NULL)) + expect_error(build_args(.country = NULL)) }) test_that("parse_response() works for different formats", { From aa94a011fb091d9c57f291443d9d2478d4995281 Mon Sep 17 00:00:00 2001 From: Tony Fujs Date: Mon, 26 Sep 2022 11:46:52 +0200 Subject: [PATCH 4/6] add new version parameters to all endpoints --- R/get_aux.R | 175 +++++++++++++++++++++++++--------- R/get_stats.R | 4 + man/get_aux.Rd | 6 ++ man/get_countries.Rd | 6 ++ man/get_cpi.Rd | 6 ++ man/get_dictionary.Rd | 6 ++ man/get_gdp.Rd | 6 ++ man/get_hfce.Rd | 6 ++ man/get_incgrp_coverage.Rd | 6 ++ man/get_interpolated_means.Rd | 6 ++ man/get_pop.Rd | 6 ++ man/get_pop_region.Rd | 6 ++ man/get_ppp.Rd | 6 ++ man/get_region_coverage.Rd | 6 ++ man/get_regions.Rd | 6 ++ man/get_stats.Rd | 2 + man/get_survey_means.Rd | 6 ++ 17 files changed, 219 insertions(+), 46 deletions(-) diff --git a/R/get_aux.R b/R/get_aux.R index 5dd343d..c5837b0 100644 --- a/R/get_aux.R +++ b/R/get_aux.R @@ -20,6 +20,8 @@ #' } get_aux <- function(table = NULL, version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), simplify = TRUE, server = NULL) { @@ -36,7 +38,11 @@ get_aux <- function(table = NULL, res <- httr::GET(u) parse_response(res, simplify = simplify) } else { - args <- build_args(.table = table, .version = version, .format = format) + args <- build_args(.table = table, + .version = version, + .ppp_version = ppp_version, + .release_version = release_version, + .format = format) res <- httr::GET(u, query = args, httr::user_agent(pipr_user_agent)) parse_response(res, simplify = simplify) } @@ -52,11 +58,17 @@ get_aux <- function(table = NULL, #' # Short hand to get countries #' get_countries() #' } -get_countries <- function(version = NULL, api_version = "v1", +get_countries <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", format = c("rds", "json", "csv"), server = NULL) { get_aux("countries", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -72,11 +84,17 @@ get_countries <- function(version = NULL, api_version = "v1", #' # Short hand to get regions #' get_regions() #' } -get_regions <- function(version = NULL, api_version = "v1", +get_regions <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", format = c("rds", "json", "csv"), server = NULL) { get_aux("regions", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -93,11 +111,17 @@ get_regions <- function(version = NULL, api_version = "v1", #' # Short hand to get cpi #' get_cpi() #' } -get_cpi <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_cpi <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("cpi", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -113,11 +137,17 @@ get_cpi <- function(version = NULL, api_version = "v1", #' # Short hand to get dictionary #' get_dictionary() #' } -get_dictionary <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_dictionary <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("dictionary", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -133,11 +163,17 @@ get_dictionary <- function(version = NULL, api_version = "v1", #' # Short hand to get gdp #' get_gdp() #' } -get_gdp <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_gdp <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("gdp", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -154,11 +190,17 @@ get_gdp <- function(version = NULL, api_version = "v1", #' # Short hand to get incgrp_coverage #' get_incgrp_coverage() #' } -get_incgrp_coverage <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_incgrp_coverage <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("incgrp_coverage", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -177,11 +219,17 @@ get_incgrp_coverage <- function(version = NULL, api_version = "v1", #' # Short hand to get interpolated_means #' get_interpolated_means() #' } -get_interpolated_means <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_interpolated_means <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("interpolated_means", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -197,11 +245,17 @@ get_interpolated_means <- function(version = NULL, api_version = "v1", #' # Short hand to get hfce #' get_hfce() #' } -get_hfce <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_hfce <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("pce", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -216,11 +270,17 @@ get_hfce <- function(version = NULL, api_version = "v1", #' # Short hand to get pop #' get_pop() #' } -get_pop <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_pop <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("pop", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -235,11 +295,17 @@ get_pop <- function(version = NULL, api_version = "v1", #' # Short hand to get pop_region #' get_pop_region() #' } -get_pop_region <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_pop_region <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("pop_region", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -255,11 +321,17 @@ get_pop_region <- function(version = NULL, api_version = "v1", #' # Short hand to get ppp #' get_ppp() #' } -get_ppp <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_ppp <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("ppp", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -275,11 +347,16 @@ get_ppp <- function(version = NULL, api_version = "v1", #' get_region_coverage() #' } get_region_coverage <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL) { get_aux("region_coverage", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } @@ -296,11 +373,17 @@ get_region_coverage <- function(version = NULL, #' # Short hand to get survey_means #' get_survey_means() #' } -get_survey_means <- function(version = NULL, api_version = "v1", - format = c("rds", "json", "csv"), - server = NULL) { +get_survey_means <- function(version = NULL, + ppp_version = NULL, + release_version = NULL, + api_version = "v1", + format = c("rds", "json", "csv"), + server = NULL) { get_aux("survey_means", - version = version, api_version = api_version, + version = version, + ppp_version = ppp_version, + release_version = release_version, + api_version = api_version, format = format, server = server ) } diff --git a/R/get_stats.R b/R/get_stats.R index 3d24bab..b5782da 100644 --- a/R/get_stats.R +++ b/R/get_stats.R @@ -120,6 +120,8 @@ get_stats <- function(country = "all", get_wb <- function(year = "all", povline = 1.9, version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), simplify = TRUE, @@ -136,6 +138,8 @@ get_wb <- function(year = "all", .povline = povline, .group_by = "wb", .version = version, + .ppp_version = ppp_version, + .release_version = release_version, .format = format ) u <- build_url(server, "pip-grp", api_version) diff --git a/man/get_aux.Rd b/man/get_aux.Rd index 25365a8..06ad9e1 100644 --- a/man/get_aux.Rd +++ b/man/get_aux.Rd @@ -7,6 +7,8 @@ get_aux( table = NULL, version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), simplify = TRUE, @@ -18,6 +20,10 @@ get_aux( \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_countries.Rd b/man/get_countries.Rd index c7bd66a..0be4405 100644 --- a/man/get_countries.Rd +++ b/man/get_countries.Rd @@ -6,6 +6,8 @@ \usage{ get_countries( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_countries( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_cpi.Rd b/man/get_cpi.Rd index 5c7c98d..eaa3038 100644 --- a/man/get_cpi.Rd +++ b/man/get_cpi.Rd @@ -6,6 +6,8 @@ \usage{ get_cpi( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_cpi( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_dictionary.Rd b/man/get_dictionary.Rd index 1e416b2..c0334f1 100644 --- a/man/get_dictionary.Rd +++ b/man/get_dictionary.Rd @@ -6,6 +6,8 @@ \usage{ get_dictionary( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_dictionary( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_gdp.Rd b/man/get_gdp.Rd index 58025fe..b1cd274 100644 --- a/man/get_gdp.Rd +++ b/man/get_gdp.Rd @@ -6,6 +6,8 @@ \usage{ get_gdp( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_gdp( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_hfce.Rd b/man/get_hfce.Rd index 5a2e4a8..5c267b2 100644 --- a/man/get_hfce.Rd +++ b/man/get_hfce.Rd @@ -6,6 +6,8 @@ \usage{ get_hfce( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_hfce( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_incgrp_coverage.Rd b/man/get_incgrp_coverage.Rd index 7a4cab1..774632f 100644 --- a/man/get_incgrp_coverage.Rd +++ b/man/get_incgrp_coverage.Rd @@ -6,6 +6,8 @@ \usage{ get_incgrp_coverage( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_incgrp_coverage( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_interpolated_means.Rd b/man/get_interpolated_means.Rd index 414000a..5434524 100644 --- a/man/get_interpolated_means.Rd +++ b/man/get_interpolated_means.Rd @@ -6,6 +6,8 @@ \usage{ get_interpolated_means( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_interpolated_means( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_pop.Rd b/man/get_pop.Rd index 382fcdf..39c1bad 100644 --- a/man/get_pop.Rd +++ b/man/get_pop.Rd @@ -6,6 +6,8 @@ \usage{ get_pop( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_pop( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_pop_region.Rd b/man/get_pop_region.Rd index 7c1618e..6d9cb8f 100644 --- a/man/get_pop_region.Rd +++ b/man/get_pop_region.Rd @@ -6,6 +6,8 @@ \usage{ get_pop_region( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_pop_region( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_ppp.Rd b/man/get_ppp.Rd index 1ec43db..a61630d 100644 --- a/man/get_ppp.Rd +++ b/man/get_ppp.Rd @@ -6,6 +6,8 @@ \usage{ get_ppp( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_ppp( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_region_coverage.Rd b/man/get_region_coverage.Rd index 6607998..bc2d3cf 100644 --- a/man/get_region_coverage.Rd +++ b/man/get_region_coverage.Rd @@ -6,6 +6,8 @@ \usage{ get_region_coverage( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_region_coverage( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_regions.Rd b/man/get_regions.Rd index 7985ad7..bad0c4f 100644 --- a/man/get_regions.Rd +++ b/man/get_regions.Rd @@ -6,6 +6,8 @@ \usage{ get_regions( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_regions( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} diff --git a/man/get_stats.Rd b/man/get_stats.Rd index b8ea12c..4cf3799 100644 --- a/man/get_stats.Rd +++ b/man/get_stats.Rd @@ -27,6 +27,8 @@ get_wb( year = "all", povline = 1.9, version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), simplify = TRUE, diff --git a/man/get_survey_means.Rd b/man/get_survey_means.Rd index 395a3af..a8e8255 100644 --- a/man/get_survey_means.Rd +++ b/man/get_survey_means.Rd @@ -6,6 +6,8 @@ \usage{ get_survey_means( version = NULL, + ppp_version = NULL, + release_version = NULL, api_version = "v1", format = c("rds", "json", "csv"), server = NULL @@ -14,6 +16,10 @@ get_survey_means( \arguments{ \item{version}{character: Data version. See \code{get_versions()}} +\item{ppp_version}{ppp year to be used} + +\item{release_version}{date when the data was published in YYYYMMDD format} + \item{api_version}{character: API version} \item{format}{character: Response format either of c("rds", "json", "csv")} From 8b4bbf24c8f40d5b76101741f3aefcdb6403043d Mon Sep 17 00:00:00 2001 From: Tony Fujs Date: Mon, 26 Sep 2022 11:53:19 +0200 Subject: [PATCH 5/6] update NEWS file --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 1a379bf..ecd3563 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # pipr (development version) +* [Hot fix](https://github.com/worldbank/pipr/pull/40) + # pipr 0.0.3 * [Add new ppp_version and release_version parameters](https://github.com/worldbank/pipr/pull/38) From f5ba5061f928a5323b405484188a74e1e26b4826 Mon Sep 17 00:00:00 2001 From: Tony Fujs Date: Mon, 26 Sep 2022 11:53:46 +0200 Subject: [PATCH 6/6] Increment version number to 0.0.4 --- DESCRIPTION | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2e07226..7fac78e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: pipr Title: Client for the PIP API -Version: 0.0.3.9000 +Version: 0.0.4 Authors@R: c(person(given = "Tony", family = "Fujs", diff --git a/NEWS.md b/NEWS.md index ecd3563..c9ef73f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# pipr (development version) +# pipr 0.0.4 * [Hot fix](https://github.com/worldbank/pipr/pull/40)