time_transfer {creditmodel}R Documentation

Time Format Transfering

Description

time_transfer is for transfering time variables to time format.

Usage

time_transfer(dat, date_cols = NULL, ex_cols = NULL, note = FALSE)

Arguments

dat

A data frame

date_cols

Names of time variable or regular expressions for finding time variables. Default is "DATE$|time$|date$|timestamp$|stamp$".

ex_cols

Names of excluded variables. Regular expressions can also be used to match variable names. Default is NULL.

note

Logical, outputs info. Default is TRUE.

Value

A data.frame with transfermed time variables.

Examples

#transfer a variable.
dat = time_transfer(dat = lendingclub,date_cols = "issue_d")
class(dat[,"issue_d"])
#transfer a group of variables with similar name.
#transfer all time variables.
dat = time_transfer(dat = lendingclub[1:3],date_cols = "_d$")
class(dat[,"issue_d"])

[Package creditmodel version 1.3.1 Index]