sdk_fix_time: Fixes the time column of a data set

Description Usage Arguments Value Examples

View source: R/fixer_functions.R

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
sdk_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::sdk_retrieve_data("FOLK1A", TID = "*", ALDER = "IALT",
                             CIVILSTAND = "TOT", lang = "da")
dplyr::glimpse(df)

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

mikkelkrogsholm/statsDK documentation built on Oct. 17, 2019, 3:19 a.m.