View source: R/get_chile_utm.R
get_chile_utm | R Documentation |
This function retrieves the historical values of the Unidad Tributaria Mensual (UTM) in Chilean Pesos from the API endpoint: https://findic.cl/api/utm. The data is provided by the Chilean website findic.cl.
get_chile_utm()
The values returned by the API include metadata and a time series of monthly values.
The names of the variables and the values are in Spanish, exactly as provided by the API.
For example, the result includes columns named fecha
(date) and valor
(value).
The function sends a GET request to the /api/utm
endpoint. If the request is successful (HTTP 200),
it parses the JSON response and extracts the time series data under the key serie
.
All names and values are kept in Spanish as provided by the API and no translation or modification is applied.
A tibble (data frame) with the following columns:
fecha
: Fecha de referencia del valor mensual (in format "YYYY-MM-DD").
valor
: Valor mensual de la Unidad Tributaria Mensual (UTM) en pesos chilenos (numeric).
Requires internet connection. The function returns the values exactly as provided in Spanish.
GET
, fromJSON
, as_tibble
## Not run:
utm_data <- get_chile_utm()
head(utm_data)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.