get_eurostat_raw: Get Eurostat data as it is

Description Usage Arguments Details Value See Also Examples

View source: R/get_eurostat_raw.R

Description

Download data sets from Eurostat database .

Usage

1
2
3
4
get_eurostat_raw(id, mode = "txt", cache = TRUE,
  update_cache = FALSE, cache_dir = NULL, compress_file = TRUE,
  stringsAsFactors = default.stringsAsFactors(), keep_flags = FALSE,
  verbose = FALSE, ...)

Arguments

id

A code name for the dataset of interest. See search_eurostat_toc for details how to get an id.

mode

defines the format of the downloaded dataset. It can be txt (the default value) for TSV (Tab Separated Values), or xml for the SDMX version.

cache

a logical whether to do caching. Default is TRUE.

update_cache

a logical with a default value FALSE, whether to update cache. Can be set also with options(restatapi_update=TRUE)

cache_dir

a path to a cache directory. The NULL (default) uses the memory as cache. If the folder if the cache_dir directory does not exist it saves in the 'restatapi' directory under the temporary directory from tempdir(). Directory can also be set with option(restatapi_cache_dir=...).

compress_file

a logical whether to compress the RDS-file in caching. Default is TRUE.

stringsAsFactors

if TRUE (the default) variables are not numeric then they are converted to factors. If the value FALSE they are returned as a characters.

keep_flags

a logical whether the observation status (flags) - e.g. "confidential", "provisional", etc. - should be kept in a separate column or if they can be removed. Default is FALSE. For flag values see: http://ec.europa.eu/eurostat/data/database/information.

verbose

A boolean with default FALSE, so detailed messages (for debugging) will not printed. Can be set also with options(restatapi_verbose=TRUE)

...

further argument for the load_cfg function

Details

Data sets are downloaded from the Eurostat bulk download facility in SDMX format.

By default all datasets cached as they are often rather large. The datasets cached in memory (default) or can be stored in a temporary directory if cache_dir or option(restatpi_cache_dir) is defined. The cache can be emptied with clean_restatapi_cache.

The id, is a value from the code column of the table of contents (get_eurostat_toc), and can be searched for with the search_eurostat_toc function. The id value can be retrieved from the Eurostat database as well. The Eurostat database gives codes in the Data Navigation Tree after every dataset in parenthesis.

Value

a data.table. One column for each dimension in the data, the time column for a time dimension, the values column for numerical values and the flags column if the keep_flags=TRUE. Eurostat data does not include all missing values. The missing values are dropped if all dimensions are missing on particular time.

See Also

get_eurostat_data, get_eurostat_bulk

Examples

1
2
3
4
dt<-get_eurostat_raw("agr_r_milkpr",keep_flags=TRUE)
dt<-get_eurostat_raw("avia_par_ee",update_cache=TRUE)
options(restatapi_update=FALSE)
dt<-get_eurostat_raw("avia_par_me",cache_dir=tempdir(),compress_file=FALSE,verbose=TRUE)

restatapi documentation built on July 24, 2019, 1:05 a.m.