Retrieve data from Eurostat API in JSON format.
get_eurostat_json( id, filters = NULL, type = c("code", "label", "both"), lang = c("en", "fr", "de"), stringsAsFactors = FALSE, ... )
id | A code name for the dataset of interested. See the table of contents of eurostat datasets for more details. |
---|---|
filters | A named list of filters. Names of list objects are Eurostat
variable codes and values are vectors of observation codes. If |
type | A type of variables, "code" (default), "label" or "both". The "both" will return a data_frame with named vectors, labels as values and codes as names. |
lang | A language used for metadata (en/fr/de). |
stringsAsFactors | if |
... | Other arguments passed on to |
A dataset as a data_frame.
Data to retrieve from
The
Eurostat Web Services can be specified with filters. Normally, it is
better to use JSON query through get_eurostat
, than to use
get_eurostat_json
directly.
Queries are limited to 50 sub-indicators at a time. A time can be
filtered with fixed "time" filter or with "sinceTimePeriod" and
"lastTimePeriod" filters. A sinceTimePeriod = 2000
returns
observations from 2000 to a last available. A lastTimePeriod = 10
returns a 10 last observations.
To use a proxy to connect, a use_proxy
can be
passed to GET
. For example
get_eurostat_json(id, filters,
config = httr::use_proxy(url, port, username, password))
.
See citation("eurostat").
Przemyslaw Biecek, Leo Lahti, Janne Huovari and Markus Kainu