Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.0%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: lightbluetitan
  • License: other
  • Language: R
  • Default Branch: main
  • Size: 2.74 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 11 months ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

ChinAPIs

License: MIT

The ChinAPIs 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 China. It allows users to retrieve up-to-date information on topics such as economic indicators, population statistics, unemployment rates, holidays, and basic geopolitical details.

In addition to API-access functions, the package includes one of the largest curated collections of open datasets related to China and Hong Kong. These datasets cover areas such as air quality, demographic indicators, input-output economic tables, epidemiology, administrative divisions, name distributions, political structure, and various social indicators.

Installation

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

```R

install.packages("ChinAPIs")

```

Usage

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

```R

library(ChinAPIs)

```

ChinAPIs Functions

Below is a list of the main functions included in the package:

  • get_country_info_cn(): Get key geopolitical and administrative information about China from the REST Countries API.

  • get_china_gdp(): Get China’s Gross Domestic Product (current US$) from the World Bank

  • get_china_cpi(): Get China's Consumer Price Index from World Bank

  • get_china_population(): Get China’s total population from the World Bank

  • get_china_literacy_rate(): Get China's adult literacy rate (Age 15+) from the World Bank

  • get_china_life_expectancy(): Get life expectancy at birth for China from the World Bank

  • get_china_unemployment(): Get China's Unemployment Rate from World Bank

  • get_china_energy_use(): Get China's energy use per capita (kg of oil equivalent) from the World Bank

  • get_china_child_mortality(): Get under-5 mortality rate (per 1,000 live births) in China from the World Bank

  • get_china_hospital_beds(): Get hospital beds per 1,000 people in China from the World Bank

  • get_china_holidays(): Retrieve Chinese public holidays (including past and upcoming dates) from the Nager.Date API (e.g., getchinaholidays(2024), getchinaholidays(2025)).

  • view_datasets_ChinAPIs(): Lists all curated datasets included in the ChinAPIs package

Dataset Suffixes

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

  • _df: A standard data frame.

  • _tbl_df: A tibble data frame object.

  • _list: A list object.

  • _matrix: A matrix object.

Datasets Included in ChinAPIs

In addition to API access functions, ChinAPIs provides several preloaded datasets related to China’s air quality, demographics, input-output tables, epidemiology, political structure, names, and social indicators. Here are some featured examples:

  • bj_air_quality_tbl_df: Tibble of hourly air pollution and weather measurements from Dongsi, Beijing.

  • china_admin_divisions_df: Data frame containing the codes and names of China's administrative divisions.

  • shanghai_factories_df: Data frame containing data on per capita output of workers in 17 factories located in Shanghai.

Example Code:

```R

Load the package

library(ChinAPIs)

Retrieves essential information about China

getcountryinfo_cn()

Get China's Population (Total) from World Bank

getchinapopulation()

Load a dataset

data(chinacarstbl_df)

Shows six rows of the dataset

head(chinacarstbl_df)

Display the structure of the dataset

str(chinacarstbl_df)

Shows the whole dataset

View(chinacarstbl_df)

```

Owner

  • Name: Renzo Cáceres Rossi
  • Login: lightbluetitan
  • Kind: user
  • Location: Lima, Perú

Soy un fanatico del Lenguaje de programación R y RMarkdown

GitHub Events

Total
  • Push event: 3
  • Create event: 2
Last Year
  • Push event: 3
  • Create event: 2

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: ChinAPIs

Access Chinese Data via Public APIs and Curated Datasets

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 0 Last month
Rankings
Dependent packages count: 25.7%
Dependent repos count: 31.5%
Average: 47.5%
Downloads: 85.4%
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 4.1.0 depends
  • dplyr * imports
  • httr * imports
  • jsonlite * imports
  • scales * imports
  • tibble * imports
  • utils * imports
  • ggplot2 * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests