ed_nbs: query NBS economic data

ed_nbsR Documentation

query NBS economic data

Description

ed_nbs provides an interface to query economic data from National Bureau of Statistics of China (NBS, http://www.stats.gov.cn/).

Usage

ed_nbs(symbol = NULL, freq = NULL, geo_type = NULL, subregion = NULL,
  date_range = "10y", from = NULL, to = Sys.Date(), na_rm = FALSE,
  eng = FALSE)

Arguments

symbol

symbols of NBS indicators. It is available via ed_nbs_symbol. Default is NULL.

freq

the frequency of NBS indicators, including 'monthly', 'quarterly', 'yearly'. Default is NULL.

geo_type

geography type in NBS, including 'nation', 'province', 'city'. Default is NULL.

subregion

codes of province or city, which is available via ed_nbs_subregion. Default is NULL.

date_range

date range. Available value includes '1m'-'11m', 'ytd', 'max' and '1y'-'ny'. Default is '10y'.

from

the start date. Default is NULL. If it is NULL, then calculate using date_range and end date.

to

the end date. Default is the current date.

na_rm

logical. Whether to remove missing values from datasets. Default is FALSE.

eng

logical. The language of the query results is in English or in Chinese Default is FALSE.

Examples

## Not run: 
# query NBS data without setting any parameters
dt = ed_nbs()

# specify paratmeters
dt1 = ed_nbs(geo_type='nation', freq='quarterly', symbol='A010101')
# or using 'n'/'q' represents 'nation'/'quarterly'
dt2 = ed_nbs(geo_type='n', freq='q', symbol='A010101')


# query data in one province
dt3 = ed_nbs(geo_type='province', freq='quarterly', 
  symbol='A010101', subregion='110000')
  
# query data in all province
dt4 = ed_nbs(geo_type='province', freq='quarterly', 
  symbol='A010101', subregion='all')

## End(Not run)


pedquant documentation built on Sept. 22, 2023, 5:13 p.m.