Fetch data from a RIO table with date filtering
rio_get_data.RdThis function retrieves data from a RIO table, optionally filtering by a reference date to get only records valid at that date.
Usage
rio_get_data(
table_id = NULL,
table_name = NULL,
reference_date = NULL,
limit = NULL,
query = NULL,
all_records = TRUE,
batch_size = 1000,
quiet = FALSE,
...
)Arguments
- table_id
The ID of the table resource to retrieve. Default is NULL.
- table_name
The name of the table resource to retrieve. Default is NULL. Either table_id or table_name must be provided.
- reference_date
Optional date to filter valid records. If provided, only records valid on this date will be returned. Default is NULL (no date filtering).
- limit
Maximum number of records to return. Default is NULL (all records).
- query
A search query string for full-text search. Default is NULL.
- all_records
Logical indicating whether to fetch all records. Default is TRUE.
- batch_size
Number of records to retrieve per API call. Default is 1000.
- quiet
Logical indicating whether to suppress progress messages. Default is FALSE.
- ...
Additional named parameters used as filters.
Examples
if (FALSE) { # \dontrun{
# Get data from a table by name
locaties <- rio_get_data(table_name = "onderwijslocaties")
# Get data from a table by ID with a reference date
vestigingen <- rio_get_data(table_id = "vestigingserkenningen-id",
reference_date = as.Date("2023-01-01"))
# Get data with a filter
rotterdam <- rio_get_data(table_name = "onderwijslocaties",
PLAATSNAAM = "Rotterdam")
} # }