r_date: Restore back to R Date

Description Usage Arguments Examples

View source: R/utils.R

Description

Calling R functions like ifelse() may accidentally convert a Date vector to a numeric vector, due to losing the class attributes. This helper function enables you to restore the numeric vector back to R Date.

Usage

1
r_date(x)

Arguments

x

the numeric values behind the Date value, which is the number of days since 1970-01-01, with negative values for earlier dates.

Examples

1
 r_date(18262)

shrektan/dtkit documentation built on Nov. 26, 2021, 10:50 p.m.