[R] Looking for a special date function in R

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jan 21 10:44:16 CET 2009


See ?julian

> julian(Sys.Date(), Sys.Date() - 10) # 10
[1] 10
attr(,"origin")
[1] "2009-01-11"

and R News 4/1.

On Wed, Jan 21, 2009 at 4:37 AM, Sergey Goriatchev <sergeyg at gmail.com> wrote:
> Hello, everyone
>
> I wonder if R has something similar to Excel function
> EDATE(start_date; months) which returns a serial number of the date
> that is the indicated number of months before of after the start date.
> Example (the second column EDATE(first_column; -6)):
> 01.01.1999      01.07.1998
> 02.02.1999      02.08.1998
> 06.03.1999      06.09.1998
>
> I am working with a zoo object where the row names are dates and for
> particular rows I need to find values that were recorded 6 months
> before (or return NA if the date is before the timeseries start).
>
> Maybe someone knows a passable R function for that kind of operation?
>
> Thanks in advance for help!
>
> Best,
> Sergey
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>




More information about the R-help mailing list