oecd: Download OECD data

Description Usage Arguments Value Examples

Description

Downloads requested data from the OECD's API, parses the download, and returns the data in country-time format

Usage

1
2
3
oecd(country = "all", table = "QASA_TABLE7PSD",
  indicator = "SAFGD.S1311C.CAR.NSA", start = "2000-Q1", end = "2011-Q4",
  extra = FALSE, return_url = FALSE)

Arguments

country

character vector of country names in ISO 3 country code format. The default ('all') downloads data for all available countries.

table

character string identifying the table. Note only one table can be queried at a time.

indicator

character vector of indicator codes for variables in table.

start

first year or quarter to download data for.

end

final year or quarter to download data for.

extra

logical. If TRUE then all information from the download is returned.

return_url

logical. Whether or not to return the URL constructed for the query. Can be useful for debugging your query.

Value

a data frame with (if extra = TRUE) country ISO 3 Letter codes, the time variable and the requested indicators.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# Download: Central Governement Currency and Deposits (% GDP) and
#           Total Gross Central Government Debt in current prices
qrt_public_debt <- oecd(indicator = c('SAF2LXT.S1311C.PCTGDPA.NSA',
                     'SAFGD.S1311C.CAR.NSA'))

# Gross domestic product (expenditure approach current prices, millions)
gdp <- oecd(table = 'SNA_TABLE1', indicator = 'B1_GE.CPC',
            start = 2000, end = 2012)

## End(Not run)

christophergandrud/oecdr documentation built on May 13, 2019, 7:03 p.m.