View source: R/get_presidential_events.R
get_presidential_events | R Documentation |
This function retrieves the list of presidential events in Argentina from the API 'https://api.argentinadatos.com/v1/eventos/presidenciales'. It returns a structured data frame with the event date, type, and description.
get_presidential_events()
This function sends a GET request to the ArgentinaDatos API and processes the JSON response into
a structured data frame. The events are not filtered by year and include all available historical data.
If the API does not return a 200 status code, a message is displayed and NULL
is returned.
A data frame (tibble) with the following columns:
fecha
: Date of the event (character, format YYYY-MM-DD).
tipo
: Type of event (e.g., speech, announcement).
evento
: Description or name of the event.
Requires internet connection. If the API becomes unavailable or changes, the function may need updates.
GET
, fromJSON
## Not run:
# Retrieve presidential events
events <- get_presidential_events()
print(events)
# View only events after 2020
events %>%
dplyr::filter(fecha >= "2020-01-01")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.