Judging from the documentation, I feel like I should be able to use round and trunc for "Date" objects. However, it seems to be working only when I first convert it to "POSIXct".
> d <- as.Date('2019-10-21')
> trunc(d,'months')
[1] "2019-10-21"
> trunc(as.POSIXct(d),'months')
[1] "2019-10-01 CEST"
> round(as.POSIXct(d),'months')
[1] "2019-11-01 CET"
> round(d,'months')
Error in round.default(18190, "months") :
non-numeric argument to mathematical function
I expected the same output for both the date and posix classes. Am I misunderstanding something here?