Skip to contents

This function retrieves educational locations from the RIO API. It's a convenient wrapper around rio_get_data for the "Onderwijslocaties" dataset. By default, it returns a simple tibble, but it can also convert the data to an sf object for spatial analysis and mapping.

Usage

rio_get_locations(
  city = NULL,
  limit = NULL,
  as_sf = FALSE,
  remove_invalid = FALSE,
  quiet = FALSE,
  ...
)

Arguments

city

Optional city name(s) to filter locations. Default is NULL.

limit

Maximum number of records to return. Default is NULL.

as_sf

Logical indicating whether to return the result as an sf object. Default is FALSE.

remove_invalid

Logical indicating whether to remove rows with invalid or missing coordinates. Default is FALSE

quiet

Logical indicating whether to suppress progress messages. Default is FALSE.

...

Additional filter parameters to pass to rio_get_data.

Value

A tibble containing educational location data, or an sf object if as_sf = TRUE.

Examples

if (FALSE) { # \dontrun{
# Get educational locations in Rotterdam as a tibble
locations <- rio_get_locations(city = "Rotterdam")

# Get educational locations in Rotterdam as an sf object
locations_sf <- rio_get_locations(city = "Rotterdam", as_sf = TRUE)

# Plot locations on a map
if (requireNamespace("leaflet", quietly = TRUE)) {
  leaflet::leaflet(locations_sf) |>
    leaflet::addTiles() |>
    leaflet::addCircleMarkers()
}
} # }