search_themes {onemapsgapi} | R 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 = FALSE)
Arguments
token |
User's API token. This can be retrieved using |
... |
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 information should be queried, default = |
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
- EXPIRY_DATE
Expiry Date of the Theme
- PUBLISHED_DATE
Published Date of the Theme
- 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 throws an error with error message and status code.
Examples
# valid
## Not run: search_themes(token)
## Not run: search_themes(token, "hdb", "parks")
## Not run: search_themes(token, more_info = TRUE)
# error
## Not run: search_themes("my_invalid_token")