[R] Time Interval calculation using R
xieyihui at gmail.com
Sun Oct 5 08:51:06 CEST 2008
You seem to have omitted a left quotation mark in (2): %H:%M:%S".
Yihui Xie <xieyihui at gmail.com>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China
On Sun, Oct 5, 2008 at 1:25 PM, Gouri Shankar Mishra
<gouri.mishra at gmail.com> wrote:
> I have two columns of data with time in form of HH:MM:SS - representing
> start time and end time of an activity. I am trying to calculate the time
> difference (duration of the activity).
> (1) I first tried
>> difftime(btime, etime, units = "mins")
> This however gave me the error - Error in
> as.POSIXlt.character(as.character(x)) : character string is not in a
> standard unambiguous format
> (2) The above error message indicated some problem in format. So I tried
>> etime1=as.date(etime, %H:%M:%S")
> This gave me the Error: unexpected SPECIAL in "etime1=as.date(etime, %H:%"
> I also tried
> But this gave a similar error - unexpected SPECIAL in "etime1=format(etime,
> Any suggestions?
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> 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