| Title: | Access Argentinian Data via APIs and Curated Datasets |
|---|---|
| Description: | Provides functions to access data from public RESTful APIs including the 'ArgentinaDatos API', 'REST Countries API', and 'World Bank API' related to Argentina's exchange rates, inflation, political figures, holidays, economic indicators, and general country-level statistics. Additionally, the package includes curated datasets related to Argentina, covering topics such as economic indicators, biodiversity, agriculture, human rights, genetic data, and consumer prices. The package supports research and analysis focused on Argentina by integrating open APIs with high-quality datasets from various domains. For more details on the APIs, see: 'ArgentinaDatos API' <https://argentinadatos.com/>, 'REST Countries API' <https://restcountries.com/>, and 'World Bank API' <https://datahelpdesk.worldbank.org/knowledgebase/articles/889392>. |
| Authors: | Renzo Caceres Rossi [aut, cre] (ORCID: <https://orcid.org/0009-0005-0744-854X>) |
| Maintainer: | Renzo Caceres Rossi <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.1 |
| Built: | 2026-05-14 07:18:50 UTC |
| Source: | https://github.com/lightbluetitan/argentinapi |
This dataset, 'Argentina_CPI_ts', is a quarterly time series of the Consumer Price Index (CPI) in Argentina from 1970 to 1990. The CPI reflects changes in the general price level of goods and services purchased by households over time.
data(Argentina_CPI_ts)data(Argentina_CPI_ts)
A quarterly time series ('ts') object from 1970 to 1990 with 80 observations:
1970 Q1 to 1990 Q4
Quarterly CPI values (numeric)
The dataset name has been kept as 'Argentina_CPI_ts' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the ArgentinAPI package and assists users in identifying its specific characteristics. The suffix 'ts' indicates that the dataset is a time series object of class 'ts'. The original content has not been modified in any way.
Data taken from the AER package version 1.2-14.
This dataset, Argentina_taxes_df, is a data frame containing monthly import tax revenue in Argentina for the period from January to October 1992.
data(Argentina_taxes_df)data(Argentina_taxes_df)
A data frame with 10 observations and 1 variable:
Numeric vector indicating monthly import tax revenue
The dataset name has been kept as 'Argentina_taxes_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the ArgentinAPI package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Data taken from the robustarima package version 0.2.7
This package provides functions to access data from public RESTful APIs including the 'ArgentinaDatos API', 'REST Countries API', and 'World Bank API' related to Argentina's exchange rates, inflation, political figures, holidays, economic indicators, and general country-level statistics. Additionally, the package includes curated datasets related to Argentina, covering topics such as economic indicators, biodiversity, agriculture, human rights, genetic data, and consumer prices.
ArgentinAPI: Access Argentinian Data via APIs and Curated Datasets
Access Argentinian Data via APIs and Curated Datasets.
Maintainer: Renzo Caceres Rossi [email protected]
Useful links:
This dataset, corn_nitrogen_df, is a data frame containing yield monitor data from a corn field in Argentina. It includes information on yield response to varying nitrogen application levels, along with spatial coordinates, topographic classification, and block structure for the experimental design.
data(corn_nitrogen_df)data(corn_nitrogen_df)
A data frame with 3443 observations and 9 variables:
Integer indicating the year of observation
Numeric vector of latitude coordinates
Numeric vector of longitude coordinates
Numeric vector representing corn yield
Numeric vector representing nitrogen application level
Factor with 4 levels indicating topographic classification
Numeric vector representing block variance
Factor with 3 levels indicating replication blocks
Factor with 6 levels indicating nitrogen field treatments
The dataset name has been kept as 'corn_nitrogen_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the ArgentinAPI package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.
Data taken from the agridat package version 1.24
This dataset, detention_centers_tbl_df, is a tibble containing detailed information about clandestine detention centers used during Argentina's last dictatorship. The dataset includes site identifiers, locations, designations, and coordinates.
data(detention_centers_tbl_df)data(detention_centers_tbl_df)
A tibble with 762 observations and 7 variables:
Numeric ID of the site
Description of the location and ownership
Designation or known name of the detention center
Logical indicator of whether the site is a memory space
Textual description of the site's geographic location
Longitude
Latitude
The dataset name has been kept as 'detention_centers_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the ArgentinAPI package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble. The original content has not been modified in any way.
Based on data from the presentes package (version 0.1.0). Available at: https://www.argentina.gob.ar/sites/default/files/6._anexo_v_listado_de_ccd-investigacion_ruvte-ilid.pdf
Retrieves Argentina's under-5 mortality rate, measured as the number of deaths
of children under five years of age per 1,000 live births, for the years 2010 to 2022
using the World Bank Open Data API. The indicator used is SH.DYN.MORT.
get_argentina_child_mortality()get_argentina_child_mortality()
This function sends a GET request to the World Bank API.
If the API request fails or returns an error status code,
the function returns NULL with an informative message.
A tibble with the following columns:
indicator: Indicator name (e.g., "Mortality rate, under-5 (per 1,000 live births)")
country: Country name ("Argentina")
year: Year of the data (integer)
value: Mortality rate (per 1,000 live births)
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SH.DYN.MORT
if (interactive()) { get_argentina_child_mortality() }if (interactive()) { get_argentina_child_mortality() }
Retrieves Argentina's energy use per capita, measured in kilograms of oil equivalent,
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is EG.USE.PCAP.KG.OE.
get_argentina_energy_use()get_argentina_energy_use()
This function sends a GET request to the World Bank API.
If the API request fails or returns an error status code,
the function returns NULL with an informative message.
A tibble with the following columns:
indicator: Indicator name (e.g., "Energy use (kg of oil equivalent per capita)")
country: Country name ("Argentina")
year: Year of the data (integer)
value: Energy use in kilograms of oil equivalent per capita
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/EG.USE.PCAP.KG.OE
if (interactive()) { get_argentina_energy_use() }if (interactive()) { get_argentina_energy_use() }
Retrieves Argentina's Gross Domestic Product (GDP) in current US dollars
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is NY.GDP.MKTP.CD.
get_argentina_gdp()get_argentina_gdp()
This function sends a GET request to the World Bank API.
If the API request fails or returns an error status code,
the function returns NULL with an informative message.
A tibble with the following columns:
indicator: Indicator name (e.g., "GDP (current US$)")
country: Country name ("Argentina")
year: Year of the data (integer)
value: GDP in current US dollars
value_label: Formatted GDP with commas (e.g., "1,800,000,000,000")
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/NY.GDP.MKTP.CD
GET, fromJSON, as_tibble, comma
if (interactive()) { get_argentina_gdp() }if (interactive()) { get_argentina_gdp() }
Retrieves Argentina's number of hospital beds per 1,000 people
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is SH.MED.BEDS.ZS.
get_argentina_hospital_beds()get_argentina_hospital_beds()
This function sends a GET request to the World Bank API.
If the API request fails or returns an error status code,
the function returns NULL with an informative message.
A tibble with the following columns:
indicator: Indicator name (e.g., "Hospital beds (per 1,000 people)")
country: Country name ("Argentina")
year: Year of the data (integer)
value: Number of hospital beds per 1,000 people
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SH.MED.BEDS.ZS
if (interactive()) { get_argentina_hospital_beds() }if (interactive()) { get_argentina_hospital_beds() }
Retrieves Argentina's life expectancy at birth (total, years)
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is SP.DYN.LE00.IN.
get_argentina_life_expectancy()get_argentina_life_expectancy()
This function sends a GET request to the World Bank API.
If the API request fails or returns an error status code,
the function returns NULL with an informative message.
A tibble with the following columns:
indicator: Indicator name (e.g., "Life expectancy at birth, total (years)")
country: Country name ("Argentina")
year: Year of the data (integer)
value: Life expectancy at birth in years
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SP.DYN.LE00.IN
if (interactive()) { get_argentina_life_expectancy() }if (interactive()) { get_argentina_life_expectancy() }
Retrieves Argentina's total population for the years 2010 to 2022
using the World Bank Open Data API. The indicator used is SP.POP.TOTL.
get_argentina_population()get_argentina_population()
The function sends a GET request to the World Bank API.
If the API request fails or returns an error status code, the function returns NULL with an informative message.
A tibble with the following columns:
indicator: Indicator name (e.g., "Population, total")
country: Country name ("Argentina")
year: Year of the data (integer)
value: Population as a numeric value
value_label: Formatted population with commas (e.g., "51,000,000")
Requires internet connection. The data is retrieved in real time from the World Bank API.
World Bank Open Data API: https://data.worldbank.org/indicator/SP.POP.TOTL
GET, fromJSON, as_tibble, comma
if (interactive()) { get_argentina_population() }if (interactive()) { get_argentina_population() }
Retrieves Argentina's total unemployment rate, measured as a percentage of the total labor force,
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is SL.UEM.TOTL.ZS.
get_argentina_unemployment()get_argentina_unemployment()
This function sends a GET request to the World Bank API.
If the API request fails or returns an error status code,
the function returns NULL with an informative message.
A tibble with the following columns:
indicator: Indicator name (e.g., "Unemployment, total (
country: Country name ("Argentina")
year: Year of the data (integer)
value: Unemployment rate as a numeric value (percentage)
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SL.UEM.TOTL.ZS
if (interactive()) { get_argentina_unemployment() }if (interactive()) { get_argentina_unemployment() }
This function retrieves a list of Argentine deputies from the public API endpoint 'https://api.argentinadatos.com/v1/diputados/diputados'. It includes basic information and the official mandate period of each deputy.
get_argentine_deputies()get_argentine_deputies()
The data is returned in descending order of the start date (inicio), showing the
most recent mandates first.
A tibble with the following columns:
id: Unique identifier for the deputy.
nombre: First name of the deputy.
apellido: Last name of the deputy.
genero: Gender of the deputy.
provincia: Province represented.
inicio: Start date of the mandate period (Date).
fin: End date of the mandate period (Date).
Requires internet connection. If 'inicio' or 'fin' dates are malformed, parsing may fail.
## Not run: deputies <- get_argentine_deputies() head(deputies) # Filter currently active deputies active <- dplyr::filter(deputies, Sys.Date() <= fin) ## End(Not run)## Not run: deputies <- get_argentine_deputies() head(deputies) # Filter currently active deputies active <- dplyr::filter(deputies, Sys.Date() <= fin) ## End(Not run)
This function retrieves a list of senators from the Argentine Senate API endpoint: 'https://api.argentinadatos.com/v1/senado/senadores'. The result includes name, province, party affiliation, and their legal term of office. The results are sorted by the start of their legal term in descending order (most recent first).
get_argentine_senators()get_argentine_senators()
The function parses the nested JSON structure returned by the API, extracts the period data, and ensures that 'inicio' and 'fin' are treated as proper 'Date' objects. The data is sorted by 'inicio' in descending order to prioritize currently active or recently active senators.
A data frame (tibble) with the following columns:
id: Unique identifier of the senator.
nombre: Full name of the senator.
provincia: Province represented.
partido: Political party.
inicio: Start date of the legal period (Date).
fin: End date of the legal period (Date).
Returns NULL if the API is unavailable or returns an error.
Requires internet access. Be cautious with malformed or missing date fields.
## Not run: senators <- get_argentine_senators() head(senators) # Filter only currently active senators active <- dplyr::filter(senators, Sys.Date() <= fin) ## End(Not run)## Not run: senators <- get_argentine_senators() head(senators) # Filter only currently active senators active <- dplyr::filter(senators, Sys.Date() <= fin) ## End(Not run)
This function retrieves the list of official holidays in Argentina for a specified year. The data is obtained from the public API at https://api.argentinadatos.com/v1/feriados/. You can append the desired year at the end of the URL. For example: https://api.argentinadatos.com/v1/feriados/2024/ If no year is provided, the function returns holidays for the current year.
get_argentinian_holidays(year = NULL)get_argentinian_holidays(year = NULL)
year |
An integer representing the year (between 2016 and current year). Defaults to the current year. |
The function sends a GET request to the ArgentinaDatos API and converts the JSON response into a structured
data frame. It validates the input year and falls back to the current year if none is specified.
If the API does not return a 200 status code or is unavailable, the function will return NULL and emit a message.
A data frame with the following columns:
fecha: Date of the holiday (character in YYYY-MM-DD format).
tipo: Type of holiday (e.g., "inamovible", "trasladable").
nombre: Name or reason of the holiday.
Returns NULL if the API is unavailable or returns an error.
Requires an active internet connection. If the API is unavailable or its structure changes, the function may need updates.
## Not run: # Get holidays for the year 2025 feriados_2025 <- get_argentinian_holidays(2025) print(feriados_2025) # Get holidays for the current year feriados_actual <- get_argentinian_holidays() View(feriados_actual) ## End(Not run)## Not run: # Get holidays for the year 2025 feriados_2025 <- get_argentinian_holidays(2025) print(feriados_2025) # Get holidays for the current year feriados_actual <- get_argentinian_holidays() View(feriados_actual) ## End(Not run)
Retrieves comprehensive country information for Argentina from the REST Countries API. This function fetches data including official and common names, geographical information, capital, area, population, and languages.
get_country_info_ar()get_country_info_ar()
This function makes a request to the REST Countries API v3.1 endpoint specifically for Argentina using full text search. It handles API errors gracefully and returns NULL if the request fails or no data is found.
A tibble with one row containing Argentina's country information:
Common name of the country
Official name of the country
Geographic region
Geographic subregion
Capital city(ies)
Total area in square kilometers
Total population
Languages spoken (comma-separated)
# Get Argentina information ar_info <- get_country_info_ar() print(ar_info)# Get Argentina information ar_info <- get_country_info_ar() print(ar_info)
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()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.
## 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)## 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)
This function retrieves the latest exchange rates of the US dollar (USD) from multiple currency exchange houses in Argentina, using the public API 'https://api.argentinadatos.com/v1/cotizaciones/dolares'. The results are sorted in descending order by date (most recent first).
get_usd_exchange_rates()get_usd_exchange_rates()
The function connects to the ArgentinaDatos API to obtain current USD exchange rates. It arranges the results in descending order by date, making recent data easier to access.
A data frame (tibble) with the following columns:
casa: Name of the exchange house (e.g., Blue, Oficial, Mayorista).
compra: Buying rate (numeric).
venta: Selling rate (numeric).
fecha: Date of the rate (Date format).
Requires an internet connection. Results may vary depending on API availability.
## Not run: # Get latest USD exchange rates rates <- get_usd_exchange_rates() head(rates) # Shows the most recent ones first # Filter for the year 2025 rates_2025 <- dplyr::filter(rates, lubridate::year(fecha) == 2025) ## End(Not run)## Not run: # Get latest USD exchange rates rates <- get_usd_exchange_rates() head(rates) # Shows the most recent ones first # Filter for the year 2025 rates_2025 <- dplyr::filter(rates, lubridate::year(fecha) == 2025) ## End(Not run)
This dataset, pollination_matrix, is a matrix representing a pollination web collected in Argentina. It was originally published by Vázquez and Simberloff (2003) and includes 9 plant species (rows) and 27 pollinator species (columns), with integer values indicating the number of observed interactions between each pair.
data(pollination_matrix)data(pollination_matrix)
A matrix with 9 rows and 27 columns:
Plant species (9 total)
Pollinator species (27 total)
Integer counts of interactions between plant and pollinator species
The dataset name has been kept as 'pollination_matrix' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the ArgentinAPI package and assists users in identifying its specific characteristics. The suffix 'matrix' indicates that the dataset is a matrix object. The original content has not been modified in any way.
Data taken from the bipartite package version 2.20
This dataset, repression_victims_tbl_df, is a tibble listing individuals who were victims of illegal state repression during Argentina’s last dictatorship. It includes information such as names, birthplaces, nationality, dates and locations of detention or disappearance, and whether the individual was pregnant at the time.
data(repression_victims_tbl_df)data(repression_victims_tbl_df)
A tibble with 8,753 observations and 20 variables:
Unique RUVTE identifier
Year of report
Legal classification
Surname(s) and given name(s)
Maternal surname
Married surname
Age at time of the event
Document numbers
Year of birth
Province of birth
Country of birth
Nationality
Pregnancy status
Date of arrest or abduction
Place of arrest or abduction
Date of murder or discovery of remains
Place of murder or discovery of remains
Availability of photograph
INDEC code for province of birth
INDEC code for country of birth
The dataset name has been kept as 'repression_victims_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the ArgentinAPI package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble. The original content has not been modified in any way.
Based on data from the presentes package (version 0.1.0). Available at: https://datos.jus.gob.ar/dataset/registro-unificado-de-victimas-del-terrorismo-de-estado-ruvte
This dataset, STRs_argentina_list, is a list containing allelic frequencies for 24 Short Tandem Repeat (STR) genetic markers from populations in Argentina. Each list element corresponds to an STR marker, and contains named numeric vectors with allele frequencies. The dataset provides valuable reference data for forensic and population genetics studies.
data(STRs_argentina_list)data(STRs_argentina_list)
A list with 24 elements, each corresponding to a genetic STR marker:
Each element is a named numeric vector of allele frequencies for the respective STR marker.
The dataset name has been kept as 'STRs_argentina_list' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the ArgentinAPI package and assists users in identifying its specific characteristics. The suffix 'list' indicates that the dataset is a list object. The original content has not been modified in any way.
Data taken from the fbnet package version 1.0.3
This function lists all datasets available in the 'ArgentinAPI' package. If the 'ArgentinAPI' package is not loaded, it stops and shows an error message. If no datasets are available, it returns a message and an empty vector.
view_datasets_ArgentinAPI()view_datasets_ArgentinAPI()
A character vector with the names of the available datasets. If no datasets are found, it returns an empty character vector.
if (requireNamespace("ArgentinAPI", quietly = TRUE)) { library(ArgentinAPI) view_datasets_ArgentinAPI() }if (requireNamespace("ArgentinAPI", quietly = TRUE)) { library(ArgentinAPI) view_datasets_ArgentinAPI() }