[R] Help with adding minutes to time

2006-05-30 Thread Jean-Louis Abitbol
Dear R Helpers, I need to read time from a .csv file which is formated as chartime (09:12:00) below. I need to add one minute (cf chartime2). Then I need to output the value just as 09:13 without the seconds for writing a csv file and input in another program. I get it with the following

Re: [R] Help with adding minutes to time

2006-05-30 Thread Sebastian Luque
Jean-Louis Abitbol [EMAIL PROTECTED] wrote: Dear R Helpers, I need to read time from a .csv file which is formated as chartime (09:12:00) below. I need to add one minute (cf chartime2). Then I need to output the value just as 09:13 without the seconds for writing a csv file and input in

Re: [R] Help with adding minutes to time

2006-05-30 Thread Gabor Grothendieck
Try this: hhmm - function(x) sub(:..$, , format(times(x))) y - times(01:02:00, out.format = hhmm) + times(00:01:00) y # or format(y) [1] 01:03 or # hhmm is from above x - times(01:02:00) hhmm(x + times(00:01:00)) [1] 01:03 On 5/30/06, Jean-Louis Abitbol [EMAIL PROTECTED] wrote: Dear R