[R] date

Linlin Yan yanlinlin82 at gmail.com
Fri Sep 3 03:34:54 CEST 2010


try to use difftime() instead of as.difftime().

On Thu, Sep 2, 2010 at 10:32 PM, Dunia Scheid <dunia.scheid at gmail.com> wrote:
> Hello all,
>
> I've 2 strings that representing the start and end values of a date and
> time.
> For example,
> time1 <- c("21/04/2005","23/05/2005","11/04/2005")
> time2 <- c("15/07/2009", "03/06/2008", "15/10/2005")
> as.difftime(time1,time2)
> Time differences in secs
> [1] NA NA NA
> attr(,"tzone")
> [1] ""
>
> How can i calculate the difference  between this 2 string?
>
> Regards,
> Dunia
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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