Skip to content

Commit

Permalink
tweak some tests, added a bit to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
evanodell committed Jun 14, 2018
1 parent 2f225e5 commit 85e1e3a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion R/data_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down
8 changes: 4 additions & 4 deletions R/metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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*")
#'
Expand Down
3 changes: 2 additions & 1 deletion man/nomis_get_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/nomis_get_metadata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions tests/testthat/test_get_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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(
Expand Down

0 comments on commit 85e1e3a

Please sign in to comment.