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/dtext documentation built on Dec. 23, 2021, 1:27 a.m.