Hello Jim,

Many thanks for the feedback

> Using "month" first advances the month without changing the day: if
> this results in an invalid day of the month, it is counted forward
> into the next month: see the examples.
Indeed I missed the documentation of seq.Date that refers to
seq.POSIXt. Many thanks for pointing this out.

Still I would be tempted to count back the day into the same month
instead of counting forward. But this behavior seems intentional and
documented so no need to question it. 

> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
The problem I'm trying to solve is this.

for a date d and an integer m
add.month(d,m)

would

Using "month" first advance the month without changing the day: if
this results in an invalid day of the month, it is counted backward
into the same month.

so nearly the same behavior as seq.Date except
add.month("2020-08-31",1) ==> 2020-09-30
add.month("2020-08-01",1) ==> 2020-09-01


Best regards,
Jeremie

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to