tidyverse / lubridate

Make working with dates in R just that little bit easier
https://lubridate.tidyverse.org
GNU General Public License v3.0
728 stars 207 forks source link

Unable to create named period vectors #1074

Closed d-morrison closed 1 year ago

d-morrison commented 1 year ago

I'm trying to create a vector of periods with names, but the result is a numeric vector of 0s:

library(lubridate)
#> 
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#> 
#>     date, intersect, setdiff, union
test = c(a = hours(1), b = hours(1) + minutes(30))
print(test)
#> a b 
#> 0 0
class(test)
#> [1] "numeric"

Created on 2022-10-11 with reprex v2.0.2

Possibly related to #1072 ?

vspinu commented 1 year ago

Thanks for reporting this. This bug was there since the very origins of lubridate c.XYZ methods.