Description Usage Arguments Details Value
www.scb.se database stores time data in a few different formats, many of which has no standard conversion to numeric or time objects. This function uses the known formats to convert time data to a numeric year, to enable easy comparisons. Months and quarters are ignored, as they are not present in all tables.
1 | convert_time_to_year(time_value)
|
time_value |
The time value returned from API query |
The formats currently supported are listed below:
"2018" for year 2018
"2018M01" for year 2018, January
"2018m01" for year 2018, January
"2018K1" for year 2018, first quarter
"2018k1" for year 2018, first quarter
"2018-2020" for years 2018, 2019, and 2020
"2018/2019" for years 2018 and 2019
"2018H1" for year 2018, first half
"2018h1" for year 2018, first half
"2018/19" for years 2018 and 2019
Integer value of year, or NA if unable to convert
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.