For version 2.3-30 of chron which just appeared on CRAN this can
be simplified to:
library(chron)
tt <- times(0:47/48)
tt
chron("1/1/09", tt) # no rep needed
On Mon, Feb 16, 2009 at 6:04 AM, Gabor Grothendieck
wrote:
> Try this (and see R News 4/1 for more).
>
>> library(chron)
>> tt <- times(0:
ahh, didn't see Gabor's solution, that works much better :-)
On 16 Feb, 10:00, Suresh_FSFM wrote:
> Dear R-Experts,
>
> seek your help.
>
> There are two parts I want to deal with.
> 1)
> I want to create a time interval of say, 30 minutes starting from "00:00:00"
> hrs
> Thus at the end, I want
Something like the following might give a few ideas:
> start.date <- '2009-01-01'
> start.time <- '00:00:00'
> interval <- 30
>
> increment.mins <- interval * 60
> x <- paste(start.date, start.time)
>
> for(i in 1:20) {
+ print(strptime(x, "%Y-%m-%d %H:%M:%S") + i*increment.mins)
+ }
[1] "2009-
Thank you very much for the precise response.
Regards,
Suresh
Suresh_FSFM wrote:
>
> Dear R-Experts,
>
> seek your help.
>
> There are two parts I want to deal with.
> 1)
> I want to create a time interval of say, 30 minutes starting from
> "00:00:00" hrs
> Thus at the end, I want to crea
Try this (and see R News 4/1 for more).
> library(chron)
> tt <- times(0:47/48)
> tt
[1] 00:00:00 00:30:00 01:00:00 01:30:00 02:00:00 02:30:00 03:00:00
03:30:00 04:00:00 04:30:00 05:00:00 05:30:00 06:00:00 06:30:00
07:00:00 07:30:00
[17] 08:00:00 08:30:00 09:00:00 09:30:00 10:00:00 10:30:00 11:00
Dear R-Experts,
seek your help.
There are two parts I want to deal with.
1)
I want to create a time interval of say, 30 minutes starting from "00:00:00"
hrs
Thus at the end, I want to create sequence:
00:00:00
00:30:00
01:00:00
01:30:00
..
..
How to do so ?
Later, I want to change the time-in
6 matches
Mail list logo