| get_data2 | R Documentation |
get_data2 retrieves data from the OpenParlData.ch REST API for a
given resource.
get_data2(table, max_rows, package_size = 1000, silent = FALSE, ...)
table |
name of the OpenParlData resource to download. For an overview of available
endpoints use |
max_rows |
maximum number of rows to return. If omitted, all available rows matching the query are downloaded. |
package_size |
number of rows to download per request (mapped to
the API parameter |
silent |
if |
... |
additional query parameters passed to the OpenParlData endpoint as URL query parameters. Common parameters include:
Resource-specific filters (e.g. |
A tibble containing up to max_rows records. Column composition
depends on the selected resource and query parameters.
## Not run:
# Retrieve first 10 persons
get_data2("persons", max_rows = 10)
# Retrieve a specific person by first and last name
get_data2(
"persons",
firstname = "Karin",
lastname = "Keller-Sutter"
)
# Partial search (default mode) in affairs
get_data2("affairs", max_rows = 10, search = "Budget", search_mode = "partial")
# Boolean search with grouping (note: '&' is an operator in boolean mode)
get_data2(
"affairs",
max_rows = 10,
search = "(Klima | Umwelt) & Schweiz",
search_mode = "boolean"
)
# Combine search with scope/language and sorting
get_data2(
"affairs",
max_rows = 10,
search = "Bundesrat Parlament",
search_mode = "natural",
search_language = "de",
sort_by = "-begin_date"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.