List DDB institutions
Usage
ddb_institutions(
params = list(),
safe = TRUE,
refresh = FALSE,
flatten = FALSE,
flatten_mode = "json"
)Arguments
- params
Named list of institution query parameters:
- hasItems
Only institutions with items (
TRUE/FALSE).- sector
Sector filter (character).
- offset
Start index for pagination (integer).
- length
Maximum number of returned items (integer).
- zoomlevel
Optional map zoom level parameter (character).
- safe
Logical; if
TRUE(default), apply rate-limiting and cache GET responses totools::R_user_dir("bunddev", "cache").- refresh
Logical; if
TRUE, ignore cached responses and re-fetch from the API (defaultFALSE).- flatten
Logical; if
TRUE, simplify nested list columns according toflatten_mode. DefaultFALSEkeeps list columns as-is.- flatten_mode
How to handle list columns when
flatten = TRUE:"drop"Remove list columns entirely. Use when nested data is not needed.
"json"Convert each list element to a JSON string. Preserves all data in a text-queryable format. This is the default.
"unnest"Expand list columns into multiple rows via
tidyr::unnest_longer(). Warning: this can significantly increase the number of rows.
Value
A tibble with one row per institution and columns:
- id
Character. Institution identifier.
- label
Character. Display name.
- latitude
Numeric. Geographic latitude.
- longitude
Numeric. Geographic longitude.
- sector
Character. Cultural sector code.
- children
List. Nested child institutions.
Falls back to a one-row tibble with list-column response when the
API returns a non-homogeneous payload.
See also
bunddev_parameters() to inspect available query parameters.
Other DDB:
ddb_institution_sectors(),
ddb_search()
Examples
if (FALSE) { # \dontrun{
ddb_institutions(params = list(hasItems = TRUE))
} # }