I would expect floor_date(...,"0.1 seconds") to either floor my date to the nearest tenth of a second, or throw an error. It does neither:
> t=Sys.time()
> x=as.numeric(t); x-floor(x)
[1] 0.8007953
> x=as.numeric(floor_date(t,"0.1 seconds")); x-floor(x)
[1] 0
The problem seems to be in parse_period_unit:
> lubridate:::parse_period_unit("5 seconds")
$n
[1] 5
$unit
[1] "second"
> lubridate:::parse_period_unit("0.1 seconds")
$n
[1] 1
$unit
[1] "second"
I would expect
floor_date(...,"0.1 seconds")to either floor my date to the nearest tenth of a second, or throw an error. It does neither:The problem seems to be in
parse_period_unit: