Hello ..

A really simple question for you. for some reason I am not getting it
right..

How do I add time (in specified units) to a column of observed date/time
(say a date-time in ISO 8601 format). For example,
"2007-12-05T09:45:00" + 3 days
"2007-13-05T09:45:00" + 3 hours


Thanks so much!

Santosh

On Tue, Apr 24, 2012 at 9:15 AM, René Mayer <mayer@psychologie.tu-dresden.de
> wrote:

> Thanks Michael,
> cumsum - yes of course!
> Regards,
> René
>
>
> Zitat von "R. Michael Weylandt" <michael.weylandt@gmail.com>:
>
>
>  ? cumsum
>>
>> something like
>>
>> library(chron) # Reporting packages you use is always considerate
>> mt <- times(c('00:05:00', '00:15:00', '00:30:00')) # Spaces are legible!
>>
>> times("09:30:00") + cumsum(mt)
>>
>> Michael
>>
>> On Tue, Apr 24, 2012 at 11:35 AM, René Mayer
>> <mayer@psychologie.tu-dresden.**de <mayer@psychologie.tu-dresden.de>>
>> wrote:
>>
>>> Dear List,
>>> given a vecor of times in 5,15 and 30 minutes and a start point
>>> in time, lets say 09:30:00, how do I add up those times
>>> to the start time getting a cumulative time sequence?
>>>
>>> mt<-times(c('00:05:00', '00:15:00', '00:30:00'))
>>> mt       wanted
>>> 00:05:00 09:35:00
>>> 00:15:00 09:50:00
>>> 00:30:00 10:20:00
>>>
>>> Regards,
>>> René
>>>
>>> ______________________________**________________
>>> R-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>>> PLEASE do read the posting guide http://www.R-project.org/**
>>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>>
> ______________________________**________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
> PLEASE do read the posting guide http://www.R-project.org/**
> posting-guide.html <http://www.R-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

