From f95d550327ba5239d11527e27b9450d0d2af54df Mon Sep 17 00:00:00 2001 From: Maximilian Muecke Date: Sun, 10 Dec 2023 19:41:56 +0100 Subject: [PATCH] docs: basic examples --- R/wb.R | 32 ++++++++++++++++++++++++++++++++ man/wb_country.Rd | 5 +++++ man/wb_country_indicator.Rd | 5 +++++ man/wb_income_lvl.Rd | 5 +++++ man/wb_indicator.Rd | 5 +++++ man/wb_lending_type.Rd | 5 +++++ man/wb_region.Rd | 5 +++++ man/wb_source.Rd | 5 +++++ man/wb_topic.Rd | 5 +++++ 9 files changed, 72 insertions(+) diff --git a/R/wb.R b/R/wb.R index c8d0877..eb12a37 100644 --- a/R/wb.R +++ b/R/wb.R @@ -2,6 +2,10 @@ #' #' @param type character(1) lending type to query. Default is "all". #' @export +#' @examples +#' \dontrun{ +#' wb_lending_type() +#' } wb_lending_type <- function(type = "all") { stopifnot(is.character(type) && length(type) == 1) @@ -21,6 +25,10 @@ wb_lending_type <- function(type = "all") { #' #' @param income character(1) income level to query. Default is "all". #' @export +#' @examples +#' \dontrun{ +#' wb_income_lvl() +#' } wb_income_lvl <- function(income = "all") { stopifnot(is.character(income) && length(income) == 1) @@ -41,6 +49,10 @@ wb_income_lvl <- function(income = "all") { #' @param source character(1) source to query. Default is "all". #' @param page integer(1) page number to query. Default is NULL. #' @export +#' @examples +#' \dontrun{ +#' wb_source() +#' } wb_source <- function(source = "all", page = NULL) { stopifnot(is.character(source) && length(source) == 1) stopifnot(is_page(page)) @@ -68,6 +80,10 @@ wb_source <- function(source = "all", page = NULL) { #' @param topic character(1) topic to query. Default is "all". #' @param page integer(1) page number to query. Default is NULL. #' @export +#' @examples +#' \dontrun{ +#' wb_topic() +#' } wb_topic <- function(topic = "all", page = NULL) { stopifnot(is.character(topic) && length(topic) == 1) stopifnot(is_page(page)) @@ -89,6 +105,10 @@ wb_topic <- function(topic = "all", page = NULL) { #' @param region character(1) region to query. Default is "all". #' @param page integer(1) page number to query. Default is NULL. #' @export +#' @examples +#' \dontrun{ +#' wb_region() +#' } wb_region <- function(region = "all", page = NULL) { stopifnot(is.character(region) && length(region) == 1) stopifnot(is_page(page)) @@ -111,6 +131,10 @@ wb_region <- function(region = "all", page = NULL) { #' @param country character(1) country to query. #' @param page integer(1) page number to query. Default is NULL. #' @export +#' @examples +#' \dontrun{ +#' wb_country() +#' } wb_country <- function(country = "all", page = NULL) { stopifnot(is.character(country) && length(country) == 1) stopifnot(is_page(page)) @@ -147,6 +171,10 @@ wb_country <- function(country = "all", page = NULL) { #' @param indicator character(1) indicator to query. Default is "all". #' @param page integer(1) page number to query. Default is NULL. #' @export +#' @examples +#' \dontrun{ +#' wb_indicator() +#' } wb_indicator <- function(indicator = "all", page = NULL) { stopifnot(is.character(indicator) && length(indicator) == 1) stopifnot(is_page(page)) @@ -185,6 +213,10 @@ wb_indicator <- function(indicator = "all", page = NULL) { #' @param country character(1) country to query. #' @param page integer(1) page number to query. Default is NULL. #' @export +#' @examples +#' \dontrun{ +#' wb_country_indicator() +#' } wb_country_indicator <- function(indicator = "NY.GDP.MKTP.CD", country = "US", page = NULL) { diff --git a/man/wb_country.Rd b/man/wb_country.Rd index 69ee6d6..dc8846c 100644 --- a/man/wb_country.Rd +++ b/man/wb_country.Rd @@ -14,3 +14,8 @@ wb_country(country = "all", page = NULL) \description{ World Bank country data } +\examples{ +\dontrun{ +wb_country() +} +} diff --git a/man/wb_country_indicator.Rd b/man/wb_country_indicator.Rd index 7bd2f7e..93fbff7 100644 --- a/man/wb_country_indicator.Rd +++ b/man/wb_country_indicator.Rd @@ -16,3 +16,8 @@ wb_country_indicator(indicator = "NY.GDP.MKTP.CD", country = "US", page = NULL) \description{ World Bank country indicator data } +\examples{ +\dontrun{ +wb_country_indicator() +} +} diff --git a/man/wb_income_lvl.Rd b/man/wb_income_lvl.Rd index e02e123..8582646 100644 --- a/man/wb_income_lvl.Rd +++ b/man/wb_income_lvl.Rd @@ -12,3 +12,8 @@ wb_income_lvl(income = "all") \description{ World Bank income level data } +\examples{ +\dontrun{ +wb_income_lvl() +} +} diff --git a/man/wb_indicator.Rd b/man/wb_indicator.Rd index 181123b..139f7cc 100644 --- a/man/wb_indicator.Rd +++ b/man/wb_indicator.Rd @@ -14,3 +14,8 @@ wb_indicator(indicator = "all", page = NULL) \description{ World Bank indicator data } +\examples{ +\dontrun{ +wb_indicator() +} +} diff --git a/man/wb_lending_type.Rd b/man/wb_lending_type.Rd index 5f4049f..af4b016 100644 --- a/man/wb_lending_type.Rd +++ b/man/wb_lending_type.Rd @@ -12,3 +12,8 @@ wb_lending_type(type = "all") \description{ World Bank lending type data } +\examples{ +\dontrun{ +wb_lending_type() +} +} diff --git a/man/wb_region.Rd b/man/wb_region.Rd index ee23ef2..9af014b 100644 --- a/man/wb_region.Rd +++ b/man/wb_region.Rd @@ -14,3 +14,8 @@ wb_region(region = "all", page = NULL) \description{ World Bank region data } +\examples{ +\dontrun{ +wb_region() +} +} diff --git a/man/wb_source.Rd b/man/wb_source.Rd index 2ab883b..a5e40a0 100644 --- a/man/wb_source.Rd +++ b/man/wb_source.Rd @@ -14,3 +14,8 @@ wb_source(source = "all", page = NULL) \description{ World Bank source data } +\examples{ +\dontrun{ +wb_source() +} +} diff --git a/man/wb_topic.Rd b/man/wb_topic.Rd index 521dc2f..5bfee4f 100644 --- a/man/wb_topic.Rd +++ b/man/wb_topic.Rd @@ -14,3 +14,8 @@ wb_topic(topic = "all", page = NULL) \description{ World Bank topic data } +\examples{ +\dontrun{ +wb_topic() +} +}