fix_time: Fixes the time column of a data set

Description Usage Arguments Value Examples

Description

Statistics Denmark data often come with times/dates that are formatted to fit months or quarters. This function converts them in to proper date strings in the format YYYY-MM-DD.

Usage

1
fix_time(date_string, as_char = FALSE)

Arguments

date_string

a string of dates formatted as months or quarters.

as_char

whether to return the dates as data objects or character strings.

Value

a data frame

Examples

1
2
3
4
5
6
df <- statsDK::retrieve_data("FOLK1A", TID = "*", ALDER = "IALT",
                             CIVILSTAND = "TOT", lang = "da")
dplyr::glimpse(df)

df$TID <- statsDK::fix_time(df$TID)
dplyr::glimpse(df)

statsDK documentation built on May 2, 2019, 4:19 a.m.