I have large number of dates in this format:
dt = as.POSIXct("2004-04-02 12:45:00 UTC")
And I have to add/subtract numbers that may not always be whole numbers.I am using lubridate library.
Example:
dt - days(2)
[1] "2004-03-31 12:45:00 UTC"
But,
dt - days(1.5)
Error in validObject(.Object) :
invalid class “Period” object: periods must have integer values
Is there an alternative for this operation?