search_themes: Search for Themes available on OneMap.Sg

View source: R/search_themes.R

search_themesR Documentation

Search for Themes available on OneMap.Sg

Description

This function is a wrapper for the Get All Themes Info API. It allows users to get a tibble of all available themes, and their details, in the OneMap.Sg API. It also provides an additional functionality where users can subset their results using search terms.

Usage

search_themes(token, ..., more_info = TRUE)

Arguments

token

User's API token. This can be retrieved using get_token

...

Optional Search terms to subset results; results with any of search terms will be returned. Search terms are not case-sensitive.

more_info

Whether more infomation should be queried, default = TRUE. If FALSE, output will contain Theme Name, Query Name and Icon information. If TRUE, output will additionally contain Category and Theme Owner information.

Value

If no error occurs, a tibble with the following variables:

THEMENAME

Name of the Theme

QUERYNAME

Query name of the Theme

ICON

Name of image file used as Icon in OneMap Web Map

CATEGORY

Returned only if more_info = TRUE. Topic that Theme relates to, e.g. Health, Sports, Environment, etc.

THEME_OWNER

Returned only if more_info = TRUE. Government Agency who Owns the Dataset

If an error occurs, the function returns NULL, along with a warning message.

Examples

# valid
## Not run: search_themes(token)
## Not run: search_themes(token, "hdb", "parks")
## Not run: search_themes(token, more_info = FALSE)

# error
## Not run: search_themes("my_invalid_token")

onemapsgapi documentation built on Nov. 29, 2022, 9:06 a.m.