PeruAPIs

License: MIT

The PeruAPIs package provides a unified interface to access open data from the World Bank API, Nager.Date API, and the REST Countries API, with a focus on Peru. It allows users to retrieve up-to-date or historical information on topics such as economic indicators, demographics, national holidays, and key geopolitical details.

In addition to API-access functions, the package includes a curated collection of open datasets related to Peru. These datasets cover a wide range of topics including administrative divisions, electoral data, demographics, biodiversity and educational classifications.

Installation

You can install the PeruAPIs package from CRAN with the following R function:


install.packages("PeruAPIs")

Usage

After installation, load the package and start exploring and using its functions and datasets.


library(PeruAPIs)

Functions for PeruAPIs

Dataset Suffixes

Each dataset in PeruAPIs is labeled with a suffix to indicate its structure and type:

Datasets Included in PeruAPIs

In addition to API access functions, PeruAPIs provides a curated collection of open datasets focused on Peru.

Below are some featured examples:

Example Code:


# Load the package

library(PeruAPIs)

# Retrieves essential information about Peru

get_country_info_pe()

# Get Peru's Population (Total) from World Bank

get_peru_population()

# Load a dataset

data(birds_peru_tbl_df)

# Shows six rows of the dataset

head(birds_peru_tbl_df)

# Display the structure of the dataset

str(birds_peru_tbl_df)

# Shows the whole dataset

View(birds_peru_tbl_df)


# Display all the datasets within PeruAPIs package

view_datasets_PeruAPIs()

mirror server hosted at Truenetwork, Russian Federation.