Learn R Programming

dataPreparation (version 0.4.3)

as.POSIXct_fast: Faster date transformation

Description

Based on the trick that often dates are repeated in a column, we make date transformation faster by computing date transformation only on uniques.

Usage

as.POSIXct_fast(x, ...)

Arguments

x

An object to be converted

...

other argument to pass to as.POSIXct

Value

as.POSIXct and as.POSIXlt return an object of the appropriate class. If tz was specified, as.POSIXlt will give an appropriate "tzone" attribute. Date-times known to be invalid will be returned as NA.

Details

The more

Examples

Run this code
# NOT RUN {
# Work the same as as.POSIXct
as.POSIXct_fast("2018-01-01", format="%Y-%m-%d")
# }

Run the code above in your browser using DataLab