Type: Package
Title: Access Argentine Economic, Social, and Geopolitical Data via RESTful APIs and Curated Datasets
Version: 0.1.0
Maintainer: Renzo Caceres Rossi <arenzocaceresrossi@gmail.com>
Description: Provides functions to access data from the 'ArgentinaDatos API' and the 'REST Countries API' related to Argentina's exchange rates, inflation, political figures, holidays, and general country-level indicators. 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 'ArgentinaDatos API', see https://argentinadatos.com/ and for 'REST Countries', see https://restcountries.com/.
License: GPL-3
URL: https://github.com/lightbluetitan/argentinapi, https://lightbluetitan.github.io/argentinapi/
BugReports: https://github.com/lightbluetitan/argentinapi/issues
Encoding: UTF-8
LazyData: true
Depends: R (≥ 4.1.0)
Imports: utils, httr, jsonlite, dplyr, lubridate
Suggests: ggplot2, testthat (≥ 3.0.0), knitr, rmarkdown
RoxygenNote: 7.3.2
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-07-04 07:13:55 UTC; renzorossiv
Author: Renzo Caceres Rossi ORCID iD [aut, cre]
Repository: CRAN
Date/Publication: 2025-07-08 09:30:01 UTC

ArgentinAPI: Access Argentine Economic, Social, and Geopolitical Data via RESTful APIs and Curated Datasets

Description

This package provides functions to access data from the 'ArgentinaDatos API' and the 'REST Countries API' related to Argentina's exchange rates, inflation, political figures, holidays, and general country-level indicators, additionally, the package includes curated datasets related to Argentina, covering topics such as economic indicators, biodiversity, agriculture, human rights, genetic data, and consumer prices.

Details

ArgentinAPI: Access Argentine Economic, Social, and Geopolitical Data via RESTful APIs and Curated Datasets

logo

Access Argentine Economic, Social, and Geopolitical Data via RESTful APIs and Curated Datasets.

Author(s)

Maintainer: Renzo Caceres Rossi arenzocaceresrossi@gmail.com

See Also

Useful links:


Consumer Price Index in Argentina (1970–1990)

Description

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.

Usage

data(Argentina_CPI_ts)

Format

A quarterly time series ('ts') object from 1970 to 1990 with 80 observations:

Time span

1970 Q1 to 1990 Q4

Values

Quarterly CPI values (numeric)

Details

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.

Source

Data taken from the AER package version 1.2-14.


Monthly Import Taxes of Argentina

Description

This dataset, Argentina_taxes_df, is a data frame containing monthly import tax revenue in Argentina for the period from January to October 1992.

Usage

data(Argentina_taxes_df)

Format

A data frame with 10 observations and 1 variable:

taxes

Numeric vector indicating monthly import tax revenue

Details

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.

Source

Data taken from the robustarima package version 0.2.7


STRs Allelic Frequencies from Argentina

Description

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.

Usage

data(STRs_argentina_list)

Format

A list with 24 elements, each corresponding to a genetic STR marker:

D8S1179, D21S11, D7S820, ... SE33

Each element is a named numeric vector of allele frequencies for the respective STR marker.

Details

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.

Source

Data taken from the fbnet package version 1.0.3


Argentina Corn Yield & Nitrogen Data

Description

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.

Usage

data(corn_nitrogen_df)

Format

A data frame with 3443 observations and 9 variables:

year

Integer indicating the year of observation

lat

Numeric vector of latitude coordinates

long

Numeric vector of longitude coordinates

yield

Numeric vector representing corn yield

nitro

Numeric vector representing nitrogen application level

topo

Factor with 4 levels indicating topographic classification

bv

Numeric vector representing block variance

rep

Factor with 3 levels indicating replication blocks

nf

Factor with 6 levels indicating nitrogen field treatments

Details

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.

Source

Data taken from the agridat package version 1.24


Argentina Detention Centers

Description

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.

Usage

data(detention_centers_tbl_df)

Format

A tibble with 762 observations and 7 variables:

ID

Numeric ID of the site

lugar_emplazamiento_propiedad

Description of the location and ownership

denominacion

Designation or known name of the detention center

espacio_de_memoria

Logical indicator of whether the site is a memory space

ubicacion

Textual description of the site's geographic location

lon

Longitude

lat

Latitude

Details

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.

Source

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


Get Argentine Deputies (Diputados)

Description

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.

Usage

get_argentine_deputies()

Details

The data is returned in descending order of the start date (inicio), showing the most recent mandates first.

Value

A tibble with the following columns:

Note

Requires internet connection. If 'inicio' or 'fin' dates are malformed, parsing may fail.

See Also

GET, fromJSON, arrange

Examples

## Not run: 
deputies <- get_argentine_deputies()
head(deputies)

# Filter currently active deputies
active <- dplyr::filter(deputies, Sys.Date() <= fin)

## End(Not run)


Get Current and Past Senators of Argentina

Description

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).

Usage

get_argentine_senators()

Details

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.

Value

A data frame (tibble) with the following columns:

Note

Requires internet access. Be cautious with malformed or missing date fields.

See Also

GET, fromJSON, arrange

Examples

## Not run: 
senators <- get_argentine_senators()
head(senators)

# Filter only currently active senators
active <- dplyr::filter(senators, Sys.Date() <= fin)

## End(Not run)


Get Official Holidays in Argentina for a Given Year

Description

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.

Usage

get_argentinian_holidays(year = NULL)

Arguments

year

An integer representing the year (between 2016 and 2025). Defaults to the current year.

Details

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, the function will return NULL and emit a message.

Value

A data frame with the following columns:

Note

Requires an active internet connection. If the API is unavailable or its structure changes, the function may need updates.

See Also

GET, fromJSON

Examples

## 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)


Get Key Country Information from the REST Countries API

Description

Retrieves selected, essential information about Argentina or any other country by its full name. The data is retrieved from the REST Countries API. See the API documentation at https://restcountries.com/. Example API usage: https://restcountries.com/v3.1/name/argentina?fullText=true.

Usage

get_country_info(name)

Arguments

name

Full country name (common or official). For example: "Argentina", "Peru", "France".

Details

This function returns readable details such as the country's common and official name, capital, region, subregion, population, area, and official languages.

The function sends a GET request to the REST Countries API. If the request is successful (HTTP 200), it parses the JSON and extracts the key fields. If the country is not found or there's an error, the function returns NULL with a user-friendly message.

Value

A data frame with 8 columns:

See Also

GET, fromJSON, tibble

Examples

## Not run: 
get_country_info("Argentina")
get_country_info("Japan")
get_country_info("France")

## End(Not run)


Get Presidential Events in Argentina

Description

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.

Usage

get_presidential_events()

Details

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.

Value

A data frame (tibble) with the following columns:

Note

Requires internet connection. If the API becomes unavailable or changes, the function may need updates.

See Also

GET, fromJSON

Examples

## 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)


Get USD Exchange Rates from Argentina's Currency Markets

Description

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).

Usage

get_usd_exchange_rates()

Details

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.

Value

A data frame (tibble) with the following columns:

Note

Requires an internet connection. Results may vary depending on API availability.

See Also

GET, fromJSON, arrange

Examples

## 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)


Pollination Web from Argentina

Description

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.

Usage

data(pollination_matrix)

Format

A matrix with 9 rows and 27 columns:

rows

Plant species (9 total)

columns

Pollinator species (27 total)

values

Integer counts of interactions between plant and pollinator species

Details

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.

Source

Data taken from the bipartite package version 2.20


Argentina Repression Victims

Description

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.

Usage

data(repression_victims_tbl_df)

Format

A tibble with 8,753 observations and 20 variables:

id_unico_ruvte

Unique RUVTE identifier

anio_denuncia

Year of report

tipificacion_ruvte

Legal classification

apellido_paterno_nombres

Surname(s) and given name(s)

apellido_materno

Maternal surname

apellido_casada

Married surname

edad_al_momento_del_hecho

Age at time of the event

documentos

Document numbers

anio_nacimiento

Year of birth

provincia_nacimiento

Province of birth

pais_nacimiento

Country of birth

nacionalidad

Nationality

embarazo

Pregnancy status

fecha_detencion_secuestro

Date of arrest or abduction

lugar_detencion_secuestro

Place of arrest or abduction

fecha_asesinato_o_hallazgo_de_restos

Date of murder or discovery of remains

lugar_asesinato_o_hallazgo_de_restos

Place of murder or discovery of remains

fotografia

Availability of photograph

provincia_nacimiento_indec_id

INDEC code for province of birth

pais_nacimiento_indec_id

INDEC code for country of birth

Details

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.

Source

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


View Available Datasets in ArgentinAPI

Description

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.

Usage

view_datasets_ArgentinAPI()

Value

A character vector with the names of the available datasets. If no datasets are found, it returns an empty character vector.

Examples

if (requireNamespace("ArgentinAPI", quietly = TRUE)) {
  library(ArgentinAPI)
  view_datasets_ArgentinAPI()
}