Learn R Programming

statsDK (version 0.1.1)

fix_time: Fixes the time column of a data set

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

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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab