get_dataset: Download OECD data sets.

Description Usage Arguments Value Examples

View source: R/main.R

Description

Returns a data frame with the requested data, downloaded through the OECD's API.

Usage

1
2
3
4
5
6
7
8
get_dataset(
  dataset,
  filter = NULL,
  start_time = NULL,
  end_time = NULL,
  pre_formatted = FALSE,
  ...
)

Arguments

dataset

A string with the code for the desired data set

filter

A list of character vectors specifying filters to be applied to each dimension of the dataset (see examples below). If no filter is specified, the function downloads all dimensions unfiltered.

start_time

Starting time for data. If left blank, no time filter is applied (i.e. all observations since the earliest available observation are downloaded). If end_time is specified, a start_time must also be specified.

end_time

End time for data.

pre_formatted

boolean. Set to TRUE if filter to be applied is already formatted (e.g. if copied from the OECD's SDMX generator (see example below)).

...

Additional parameters passed to data.frame (e.g. stringsAsFactors = FALSE).

Value

A data frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Get entire dataset 
## Not run: df <- get_dataset("EPL_OV")
## Not run: head(df, 10)

# Apply filter on dimensions "country" and "series"
## Not run: df <- get_dataset("EPL_OV", 
                           filter = list(c("DEU", "FRA"), 
                           c("EPRC_V1", "EPRC_V2")), 
                           start_time = 2008, end_time = 2010)
## End(Not run)
## Not run: head(df, 10)

# Use pre-formatted filter copied from stats.oecd.org
## Not run: df <- get_dataset("PATS_REGION", 
               filter = "PCT_A.INVENTORS.BEL+BE10+BE21.TOTAL+BIOTECH+ICT",
               start_time = 2008, end_time = 2010, pre_formatted = TRUE)
## End(Not run)
## Not run: head(df, 10)

OECD documentation built on Dec. 11, 2021, 9:37 a.m.

Related to get_dataset in OECD...