TheArgentinAPI package provides a comprehensive andunified interface to access open data aboutArgentinafrom multiple public RESTful APIs, includingArgentinaDatosAPI,REST Countries API, andWorldBank API. Through these sources, users can easily retrieveinformation on exchange rates, inflation, political figures, nationalholidays, economic indicators, and general country-level statistics.
In addition to API-access functions, the package includes acollection of curated datasets covering diverse domains such as economicindicators, biodiversity, agriculture, human rights, genetic data, andconsumer prices.
You can install theArgentinAPI package from CRAN withthe following R function:
install.packages("ArgentinAPI")After installation, load the package and start exploring and usingits functions and datasets.
library(ArgentinAPI)Below is a list of the main functions included in theArgentinAPI package:
get_argentina_holidays() – Retrieves public holidaysin Argentina for a specific year using the ArgentinaDatos API.
get_argentine_senators() - Returns the current listof Argentine senators from the ArgentinaDatos API.
get_argentine_deputies() – Returns the current listof Argentine deputies from the ArgentinaDatos API.
get_country_info_ar() – Retrieves generalcountry-level information about Argentina from the REST CountriesAPI
get_dollar_exchange_rates() – Retrieves the mostrecent exchange rates for different dollar markets (official, blue, MEP,CCL) from the ArgentinaDatos API.
get_presidential_events() – Retrieves a list ofofficial presidential events from the ArgentinaDatos API.
get_argentina_child_mortality(): Get Argentina’sUnder-5 Mortality Rate data from the World Bank.
get_argentina_energy_use(): Get Argentina’s EnergyUse (kg of oil equivalent per capita) data from the World Bank.
get_argentina_gdp(): Get Argentina’s GDP (currentUS$) data from the World Bank.
get_argentina_hospital_beds(): Get Argentina’sHospital Beds (per 1,000 people) data from the World Bank.
get_argentina_life_expectancy(): Get Argentina’sLife Expectancy at Birth data from the World Bank.
get_argentina_population(): Get Argentina’s TotalPopulation data from the World Bank.
get_argentina_unemployment(): Get Argentina’s TotalUnemployment Rate data from the World Bank.
view_datasets_ArgentinAPI() – Lists all curateddatasets included in theArgentinAPI package across variousthematic areas such as economy, biodiversity, genetics, agriculture, andmore.
The naming convention helps you easily understand the structure ofeach dataset:
_df: A standard data frame.
_tbl_df: A tibble (modern data frame).
_ts: A time series object.
_matrix: A matrix structure.
_list: A list object.
corn_nitrogen_df: Argentina Corn Yield &Nitrogen Data A data frame with yield monitor data from a corn field inArgentina, including variables such as nitrogen application, yield,topography, and block replicates.
STRs_argentina_list: STRs Allelic Frequencies fromArgentina A list of allelic frequencies for 24 Short Tandem Repeat (STR)genetic markers collected from different populations acrossArgentina.
# Load the packagelibrary(ArgentinAPI)# Selected, essential information about Argentinaget_country_info_ar()# List of presidential events in Argentinaget_presidential_events()# Load a datasetdata("corn_nitrogen_df")# Shows six rows of the datasethead(corn_nitrogen_df)# Display the structure of the datasetstr(corn_nitrogen_df)# Shows the whole datasetView(corn_nitrogen_df)