# NOT RUN {
# By ids
# Fetch one series from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
df1 <- rdb(ids='AMECO/ZUTN/EA19.1.0.0.0.ZUTN')
# Fetch two series from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
df2 <- rdb(ids=c('AMECO/ZUTN/EA19.1.0.0.0.ZUTN','AMECO/ZUTN/DNK.1.0.0.0.ZUTN'))
# Fetch two series from different datasets of different providers:
df3 <- rdb(ids=c('AMECO/ZUTN/EA19.1.0.0.0.ZUTN','IMF/CPI/A.AT.PCPIT_IX'))
# By dimensions
# Fetch one value of one dimension from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
df1 <- rdb('AMECO','ZUTN',dimensions='{"geo": ["ea12"]}')
# Fetch two values of one dimension from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
df2 <- rdb('AMECO','ZUTN',dimensions='{"geo": ["ea12", "dnk"]}')
# Fetch several values of several dimensions from dataset 'Doing business' (DB) of World Bank:
dim <- '{"country": ["DZ", "PE"],"indicator": ["ENF.CONT.COEN.COST.ZS","IC.REG.COST.PC.FE.ZS"]}'
df3 <- rdb('WB', 'DB', dimensions = dim)
# By mask (only for some providers, check the list here :
# https://git.nomics.world/dbnomics/dbnomics-api/blob/master/dbnomics_api/application.cfg.)
# Fetch one series from dataset 'Consumer Price Index' (CPI) of IMF:
df1 <- rdb('IMF','CPI',mask='M.DE.PCPIEC_WT')
# Fetch two series from dataset 'Consumer Price Index' (CPI) of IMF:
df2 <- rdb('IMF','CPI',mask='M.DE+FR.PCPIEC_WT')
# Fetch all series along one dimension from dataset 'Consumer Price Index' (CPI) of IMF:
df3 <- rdb('IMF','CPI',mask='M..PCPIEC_WT')
# Fetch series along multiple dimensions from dataset 'Consumer Price Index' (CPI) of IMF:
df4 <- rdb('IMF','CPI',mask='M..PCPIEC_IX+PCPIA_IX')
# Use readLines before fromJSON to avoid a proxy failure
# Fetch one series from dataset 'Unemployment rate' (ZUTN) of AMECO provider:
options(rdbnomics.use_readLines = TRUE)
df1 <- rdb(ids='AMECO/ZUTN/EA19.1.0.0.0.ZUTN')
# or
df1 <- rdb(ids='AMECO/ZUTN/EA19.1.0.0.0.ZUTN', use_readLines = TRUE)
# }
Run the code above in your browser using DataLab