eurotime2date: Date Conversion from New Eurostat Time Format

View source: R/eurotime2date.R

eurotime2dateR Documentation

Date Conversion from New Eurostat Time Format

Description

Date conversion from Eurostat time format. A function to convert Eurostat time values to objects of class base::Date() representing calendar dates.

Usage

eurotime2date(x, last = FALSE)

Arguments

x

a charter string with time information in Eurostat time format.

last

a logical. If FALSE (default) the date is the first date of the period (month, quarter or year). If TRUE the date is the last date of the period.

Details

Available patterns are YYYY (year), YYYY-SN (semester), YYYY-QN (quarter), YYYY-MM (month), YYYY-WNN (week) and YYYY-MM-DD (day).

Value

an object of class base::Date().

Author(s)

Janne Huovari janne.huovari@ptt.fi

References

See citation("eurostat"):

# Kindly cite this package by citing the following R Journal article:
# 
#   Lahti L., Huovari J., Kainu M., and Biecek P. (2017). Retrieval and
#   analysis of Eurostat open data with the eurostat package. The R
#   Journal 9(1), pp. 385-392. doi: 10.32614/RJ-2017-019
# 
# In addition, please provide a citation to the specific software version
# used:
# 
#   Lahti L, Huovari J, Kainu M, Biecek P, Hernangomez D, Antal D,
#   Kantanen P (2026). "eurostat: Tools for Eurostat Open Data."
#   doi:10.32614/CRAN.package.eurostat
#   <https://doi.org/10.32614/CRAN.package.eurostat>. R package version
#   4.1.1, <https://github.com/rOpenGov/eurostat>.
# 
# To see these entries in BibTeX format, use 'print(<citation>,
# bibtex=TRUE)', 'toBibtex(.)', or set
# 'options(citation.bibtex.max=999)'.

See Also

lubridate::ymd()

Other helpers: cut_to_classes(), dic_order(), eurotime2num(), harmonize_country_code(), label_eurostat()

Examples



na_q <- get_eurostat("namq_10_pc", time_format = "raw")
na_q$TIME_PERIOD <- eurotime2date(x = na_q$TIME_PERIOD)
unique(na_q$TIME_PERIOD)


## Not run: 
# Test for weekly data
get_eurostat(
  id = "lfsi_abs_w",
  select_time = c("W"),
  time_format = "date"
  )

## End(Not run)


eurostat documentation built on Sept. 24, 2026, 5:06 p.m.