On Wed, 12 Oct 2005, Jim Porzak wrote:

>  OTOH,
>
>  > seq(as.Date("2004-01-31"), by = "month", length = 14)
>   [1] "2004-01-31" "2004-03-02" "2004-03-31" "2004-05-01" "2004-05-31"
>   [6] "2004-07-01" "2004-07-31" "2004-08-31" "2004-10-01" "2004-10-31"
>  [11] "2004-12-01" "2004-12-31" "2005-01-31" "2005-03-03"
>
>  I would prefer to see dates forced to be within each month, not
>  "leaking" into next month.
>
>  IOW:
>   [1] "2004-01-31" "2004-02-29" "2004-03-31" "2004-04-30" "2004-05-31", etc

It depends how you intend "1 month after 2004-01-31".  Is the the same
number of days before the beginning of the next month or after the end of
the stated month?

   seq(as.Date("2004-02-01"), by = "month", length = 14)-1

   [1] "2004-01-31" "2004-02-29" "2004-03-31" "2004-04-30" "2004-05-31"

Dave
-- 
 Dr. David Forrest
 [EMAIL PROTECTED]                                    (804)684-7900w
 [EMAIL PROTECTED]                             (804)642-0662h
                                   http://maplepark.com/~drf5n/

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to