View source: R/asDatePOSIXct.R
asDatePOSIXct | R Documentation |
Conversion from POSIXct to Date
asDatePOSIXct(x, tz = "")
x |
A POSIXct vector |
tz |
An optional timezone string |
This function provides a direct conversion from POSIXct to Date. As of R-3.5.1, conversion from POSIXct to Date creates an intermediate POSIXlt object. This intermediate POSIXlt object uses a non-trivial amount of memory. The direct conversion is more memory efficient, and therefore approximately twice as fast as the current solution in base R.
A vector of Date
objects
Joshua Ulrich
p <- .POSIXct(1540181413, "America/Chicago") as.Date(p) # Using UTC timezone as.Date(p, "America/Chicago") # Using local timezone asDatePOSIXct(p) # Direct, using local timezone
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.