ChinAPIs
Access Chinese Data via Public APIs and Curated Datasets
Description
Provides functions to access data from public RESTful APIs including 'Nager.Date', 'World Bank API', and 'REST Countries API', retrieving real-time or historical data related to China, such as holidays, economic indicators, and international demographic and geopolitical indicators. Additionally, the package includes one of the largest curated collections of open datasets focused on China and Hong Kong, covering topics such as air quality, demographics, input-output tables, epidemiology, political structure, names, and social indicators. The package supports reproducible research and teaching by integrating reliable international APIs and structured datasets from public, academic, and government sources. For more information on the APIs, see: 'Nager.Date' <https://date.nager.at/Api>, 'World Bank API' <https://datahelpdesk.worldbank.org/knowledgebase/articles/889392>, and 'REST Countries API' <https://restcountries.com/>.
Downloads
270
Last 30 days
15234th
721
Last 90 days
2.2K
Last year
Trend: +41.4% (30d vs prior 30d)
8
Last 30 days
25
Last 90 days
103
Last year
Trend: -42.9% (30d vs prior 30d)
CRAN Check Status
Show all 13 flavors
| Flavor | Status |
|---|---|
| r-devel-linux-x86_64-debian-clang | ERROR |
| r-devel-linux-x86_64-debian-gcc | ERROR |
| r-devel-linux-x86_64-fedora-clang | ERROR |
| r-devel-linux-x86_64-fedora-gcc | ERROR |
| r-devel-windows-x86_64 | ERROR |
| r-oldrel-macos-arm64 | OK |
| r-oldrel-macos-x86_64 | OK |
| r-oldrel-windows-x86_64 | ERROR |
| r-patched-linux-x86_64 | ERROR |
| r-release-linux-x86_64 | ERROR |
| r-release-macos-arm64 | OK |
| r-release-macos-x86_64 | OK |
| r-release-windows-x86_64 | ERROR |
Check details (18 non-OK)
examples
Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ### API
> ### Aliases: get_country_info_cn
>
> ### ** Examples
>
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
tests
Running ‘testthat.R’ [25s/38s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
examples
Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ### API
> ### Aliases: get_country_info_cn
>
> ### ** Examples
>
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
tests
Running ‘testthat.R’ [15s/19s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
examples
Running examples in ‘ChinAPIs-Ex.R’ failed The error most likely occurred in: > ### Name: get_country_info_cn > ### Title: Get Key Country Information About China from the REST Countries > ### API > ### Aliases: get_country_info_cn > > ### ** Examples > > get_country_info_cn() Error in data_list[1, ] : incorrect number of dimensions Calls: get_country_info_cn Execution halted
tests
Running ‘testthat.R’ [40s/97s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
examples
Running examples in ‘ChinAPIs-Ex.R’ failed The error most likely occurred in: > ### Name: get_country_info_cn > ### Title: Get Key Country Information About China from the REST Countries > ### API > ### Aliases: get_country_info_cn > > ### ** Examples > > get_country_info_cn() Error in data_list[1, ] : incorrect number of dimensions Calls: get_country_info_cn Execution halted
tests
Running ‘testthat.R’ [37s/48s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
examples
Running examples in 'ChinAPIs-Ex.R' failed The error most likely occurred in: > ### Name: get_country_info_cn > ### Title: Get Key Country Information About China from the REST Countries > ### API > ### Aliases: get_country_info_cn > > ### ** Examples > > get_country_info_cn() Error in data_list[1, ] : incorrect number of dimensions Calls: get_country_info_cn Execution halted
tests
Running 'testthat.R' [35s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
examples
Running examples in 'ChinAPIs-Ex.R' failed The error most likely occurred in: > ### Name: get_country_info_cn > ### Title: Get Key Country Information About China from the REST Countries > ### API > ### Aliases: get_country_info_cn > > ### ** Examples > > get_country_info_cn() Error in data_list[1, ] : incorrect number of dimensions Calls: get_country_info_cn Execution halted
tests
Running 'testthat.R' [39s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
examples
Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ### API
> ### Aliases: get_country_info_cn
>
> ### ** Examples
>
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
tests
Running ‘testthat.R’ [23s/38s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
examples
Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ### API
> ### Aliases: get_country_info_cn
>
> ### ** Examples
>
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
tests
Running ‘testthat.R’ [24s/40s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
examples
Running examples in 'ChinAPIs-Ex.R' failed The error most likely occurred in: > ### Name: get_country_info_cn > ### Title: Get Key Country Information About China from the REST Countries > ### API > ### Aliases: get_country_info_cn > > ### ** Examples > > get_country_info_cn() Error in data_list[1, ] : incorrect number of dimensions Calls: get_country_info_cn Execution halted
tests
Running 'testthat.R' [29s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(ChinAPIs)
>
> test_check("ChinAPIs")
`year` must be a single numeric value.
`year` must be a single numeric value.
`year` must be a single numeric value.
Nager.Date API returned status: 400
Nager.Date API returned status: 400
Saving _problems/test-get_country_info_cn-12.R
Datasets available in the 'ChinAPIs' package:
Datasets available in the 'ChinAPIs' package:
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• On CRAN (5): 'test-get_china_child_mortality.R:12:3',
'test-get_china_child_mortality.R:30:3',
'test-get_china_child_mortality.R:40:3',
'test-get_china_child_mortality.R:50:3',
'test-get_china_child_mortality.R:58:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
Error in `data_list[1, ]`: incorrect number of dimensions
Backtrace:
▆
1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
[ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
Error:
! Test failures.
Execution halted
Check History
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 12, 2026
examples
Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ### API
> ### Aliases: get_country_info_cn
>
> ### ** Examples
>
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted