ed_nbs: get economic data from NBS

Description Usage Arguments Source Examples

View source: R/ed_nbs.R

Description

ed_nbs provides an interface to query economic data from National Bureau of Statistics of China (NBS).

Usage

1
2
3
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

symbol of indicators in NBS, which is available via ed_nbs_symbol. Default is NULL.

freq

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

geo_type

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

subregion

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

date_range
from

the start date. Default is '2010-01-01'.

to

the end date. Default is current system date.

na_rm

logical. If it is TRUE, the missing values will be removed. Default is FALSE.

eng

logical. If it is FALSE, the query results are in Chinese, otherwise in English. Default is FALSE.

Source

http://data.stats.gov.cn/index.htm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# interactively setting paratmeters
## Not run: 
dt = ed_nbs()

# specify paratmeters
dt1 = ed_nbs(geo_type='national', freq='quarterly', 
  symbol='A010101')

# or using 'n'/'q' represents 'national'/'quarterly'
dt2 = ed_nbs(geo_type='n', freq='q', symbol='A010101')


# query data of one subregion
dt3 = ed_nbs(geo_type='province', freq='quarterly', 
  symbol='A010101', subregion='110000', from='2010-03-01', to='2010-03-01')
  
# query data of all province
dt4 = ed_nbs(geo_type='province', freq='quarterly', 
  symbol='A010101', subregion='all', from='2010-03-01', to='2010-03-01')

## End(Not run)

ShichenXie/getpedr documentation built on Feb. 16, 2019, 5:47 a.m.