diff --git a/R/data_download.R b/R/data_download.R index 20cc482..394f502 100644 --- a/R/data_download.R +++ b/R/data_download.R @@ -98,7 +98,8 @@ #' @param additional_queries Any other additional queries to pass to the API. #' See \url{https://www.nomisweb.co.uk/api/v01/help} for instructions on #' query structure. Defaults to \code{NULL}. Deprecated in package -#' versions greater than 0.2.0 and will eventually be removed. +#' versions greater than 0.2.0 and will eventually be removed in a +#' future version. #' #' @param exclude_missing If \code{TRUE}, excludes all missing values. #' Defaults to \code{FALSE}. diff --git a/R/metadata.R b/R/metadata.R index 6e3b334..08242d1 100644 --- a/R/metadata.R +++ b/R/metadata.R @@ -35,7 +35,8 @@ #' @seealso \code{\link{nomis_get_data}} #' @seealso \code{\link{nomis_overview}} #' -#' @return A tibble with options. +#' @return A tibble with metadata options for queries using +#' \code{\link{nomis_get_data}}. #' @export #' #' @examples \donttest{ @@ -57,10 +58,9 @@ #' #' tibble::glimpse(d) #' -#' e <- nomis_get_metadata('NM_1_1', 'item', -#' additional_queries = "?geography=1879048226&sex=5") +#' e <- nomis_get_metadata('NM_1_1', 'item', geography = 1879048226, sex = 5) #' -#' tibble::glimpse(e) +#' print(e) #' #' f <- nomis_get_metadata('NM_1_1', 'item', search = "*married*") #' diff --git a/man/nomis_get_data.Rd b/man/nomis_get_data.Rd index a507900..b81c92c 100644 --- a/man/nomis_get_data.Rd +++ b/man/nomis_get_data.Rd @@ -76,7 +76,8 @@ to other parameters. Defaults to \code{NULL}.} \item{additional_queries}{Any other additional queries to pass to the API. See \url{https://www.nomisweb.co.uk/api/v01/help} for instructions on query structure. Defaults to \code{NULL}. Deprecated in package -versions greater than 0.2.0 and will eventually be removed.} +versions greater than 0.2.0 and will eventually be removed in a +future version.} \item{exclude_missing}{If \code{TRUE}, excludes all missing values. Defaults to \code{FALSE}.} diff --git a/man/nomis_get_metadata.Rd b/man/nomis_get_metadata.Rd index da42d32..ec86a16 100644 --- a/man/nomis_get_metadata.Rd +++ b/man/nomis_get_metadata.Rd @@ -31,7 +31,8 @@ versions greater than 0.2.0 and will eventually be removed.} \item{...}{Use to pass any other parameters to the API.} } \value{ -A tibble with options. +A tibble with metadata options for queries using +\code{\link{nomis_get_data}}. } \description{ Retrieve all concept code options of all Nomis datasets, @@ -62,10 +63,9 @@ d <- nomis_get_metadata('NM_1_1', 'geography', '1879048226') tibble::glimpse(d) -e <- nomis_get_metadata('NM_1_1', 'item', - additional_queries = "?geography=1879048226&sex=5") +e <- nomis_get_metadata('NM_1_1', 'item', geography = 1879048226, sex = 5) -tibble::glimpse(e) +print(e) f <- nomis_get_metadata('NM_1_1', 'item', search = "*married*") diff --git a/tests/testthat/test_get_data.R b/tests/testthat/test_get_data.R index 5958974..2099f01 100644 --- a/tests/testthat/test_get_data.R +++ b/tests/testthat/test_get_data.R @@ -7,8 +7,7 @@ test_that("nomis_get_data return expected format", { z <- nomis_get_data( id = "NM_1_1", time = "latest", measures = c(20100, 20201), sex = 5, - additional_queries = "&geography=TYPE499", - exclude_missing = TRUE + exclude_missing = TRUE, geography = "TYPE499" ) expect_length(z, 34) expect_type(z, "list") @@ -44,7 +43,7 @@ test_that("nomis_get_data return expected format", { c <- nomis_get_data( id = "NM_127_1", sex = "6", - additional_queries = "&time=latest" + time = "latest" ) expect_length(c, 28) expect_type(c, "list") @@ -54,8 +53,7 @@ test_that("nomis_get_data return expected format", { expect_error(nomis_get_data( id = "NM_1_1", time = "latest", measures = c(20100, 20201), sex = 0, - additional_queries = "&geography=TYPE499", - exclude_missing = FALSE + exclude_missing = FALSE, geography = "TYPE499" )) x_select <- nomis_get_data(