[R] High frequency time-series

Heywood, Giles Giles.Heywood at CommerzbankIB.com
Wed Oct 22 16:53:06 CEST 2003


You may find the irregular time-series (its) package on CRAN 
helpful.  

If your raw data were in a csv file thus:

				x
april 26 2002 15:00:00	1.1
april 26 2002 15:15:00	1.2
april 26 2002 15:30:00	1.3
april 26 2002 15:45:00	1.4

Then you could read it in thus:

require("its")
its.format("%B %d %Y %H:%M:%S")
x <- its(readcsvIts("c:/temp/mydata.csv"))

If on the other hand you already have the times in POSIX
form, it is slightly simpler e.g.
 
x <- its(xmat,POSIXdate)

 Giles

> -----Original Message-----
> From: v.demart at libero.it [mailto:v.demart at libero.it]
> Sent: 22 October 2003 14:10
> To: r-help r-help
> Subject: [R] High frequency time-series
> 
> 
> Having to collect hourly electricity loads and 
> quarter-of-an-hour electricity production data for some years 
> I think that the tidiest way of doing it is to resort to ts 
> but I don't know how to define such a frequency starting from 
> a set date.
> 
> Leafing through r-help mail archives I've found this *ALMOST* 
> satisfactory message:
> ==========================================================
> .........
>  > I have a series of hourly rainfall and quarterly flow 
> > measurements (i.e. 4 times an hour) of a catchment
> ........
> > Maybe time series are easier, but in 
> > 
> > ts(data = NA, start = X,... 
> > 
> > X should be a number or a vector. how does this coresponds to a 
> > data and hour (e.g. april 26,2002, 15:00:00)? 
> 
> 
> If your observations are equidistant, e.g. you've got 24 hourly 
> measurements per day, you could do something like this for the above 
> example: 
> 
> 
> R> rain <- ts(rain, start = c(26, 15), freq = 24) 
> R> flow <- ts(flow, start = c(26, 15), freq = 96) 
> ...........
> ============================================================
> 
> But how does R know that we are speaking of a timeseries 
> starting from April 26, 2002 and not, say, Feb 26, 2000?
> There's some piece of info missing in the answer.
> 
> Am I correct?
> Please help.
> 
> Ciao from Rome
> 
> Vittorio
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 


********************************************************************** 
This is a commercial communication from Commerzbank AG.\ \ T...{{dropped}}




More information about the R-help mailing list