tidy_eurostat2: Transform Data from the New Dissemination API into...

View source: R/tidy_eurostat2.R

tidy_eurostat2R Documentation

Transform Data from the New Dissemination API into Row-Column-Value Format

Description

Transform raw Eurostat data table downloaded from the new dissemination API into the row-column-value format (RCV).

Usage

tidy_eurostat2(
  dat,
  time_format = "date",
  select_time = NULL,
  stringsAsFactors = FALSE,
  keepFlags = FALSE
)

Arguments

dat

a data_frame from get_eurostat_raw().

time_format

a string giving a type of the conversion of the time column from the eurostat format. A "date" (default) converts to a Date() with a first date of the period. A "date_last" converts to a Date() with a last date of the period. A "num" converts to a numeric and "raw" does not do conversion. See eurotime2date() and eurotime2num().

select_time

a single character symbol for a time frequency, a vector containing multiple time frequencies, or NULL (default). Available options are "A" (annual), "Q" (quarterly), "S" (semester, 1st or 2nd half of the year), "M" (monthly) and "D" (daily). When downloading data from the New Dissemination API, it is now possible to select multiple time frequencies and return them in the same data.frame object.

stringsAsFactors

if TRUE (the default) variables are converted to factors in original Eurostat order. If FALSE they are returned as strings.

keepFlags

a logical whether the flags (e.g. "confidential", "provisional") should be kept in a separate column or if they can be removed. Default is FALSE

Value

tibble in the molten format with the last column 'values'.

Author(s)

Przemyslaw Biecek, Leo Lahti, Janne Huovari and Pyry Kantanen

References

See citation("eurostat").

See Also

get_eurostat(), convert_time_col2(), eurotime2date2()

Examples

## Not run: 
# Example of a dataset with multiple time series
get_eurostat("AVIA_GOR_ME", time_format = "date_last", cache = F, bulk_new_style = TRUE)

## End(Not run)


eurostat documentation built on March 7, 2023, 5:39 p.m.