clean_times2: Convert Statfin time variable to Date.

clean_times2R Documentation

Convert Statfin time variable to Date.

Description

Convert Statfin time variable to Date.

Usage

clean_times2(x, time_col = NULL)

Arguments

x

A data.frame

time_col

column in x containing the time variable

Value

A data.frame

Examples


data_m <- data.frame(values = rnorm(24),
                     Kuukausi = as.vector(sapply(as.character(2016:2017),
                                                 paste0,
                                                 paste0("M", c(paste0("0", 1:9), as.character(10:12))))))
clean_times2(data_m)

data_q <- data.frame(values = rnorm(12),
                     Vuosineljannes = as.vector(sapply(as.character(2016:2018),
                                                       paste0,
                                                       paste0("Q", as.character(1:4)))))
clean_times2(data_q)

data_y <- data.frame(values = rnorm(10),
                     Vuosi = as.character(2010:2019))
clean_times2(data_y)


pttry/statfitools documentation built on Feb. 2, 2025, 1:50 a.m.