Skip to content

Commit

Permalink
docs: basic examples
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muecke committed Dec 10, 2023
1 parent 9137229 commit f95d550
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 0 deletions.
32 changes: 32 additions & 0 deletions R/wb.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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))
Expand Down Expand Up @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 5 additions & 0 deletions man/wb_country.Rd

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

5 changes: 5 additions & 0 deletions man/wb_country_indicator.Rd

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

5 changes: 5 additions & 0 deletions man/wb_income_lvl.Rd

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

5 changes: 5 additions & 0 deletions man/wb_indicator.Rd

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

5 changes: 5 additions & 0 deletions man/wb_lending_type.Rd

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

5 changes: 5 additions & 0 deletions man/wb_region.Rd

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

5 changes: 5 additions & 0 deletions man/wb_source.Rd

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

5 changes: 5 additions & 0 deletions man/wb_topic.Rd

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

0 comments on commit f95d550

Please sign in to comment.