[R] ts & daily timeseries

Vittorio v.demartino2 at virgilio.it
Wed Jun 23 15:33:52 CEST 2004


On Tuesday 22 June 2004 17:41, Prof Brian Ripley wrote:
> data.frame(time=mytime, ts=myts)
>
> would appear to be what you are looking for.
>
> On Tue, 22 Jun 2004 v.demartino2 at virgilio.it wrote:
> > I have defined a daily timeseries for the 365 days of 2003 issuing:
> >
> > myts = ts(dati[,2:10],frequency=365,)
> >
> > > myts
> >
> > Time Series:
> > Start = c(1, 1)
> > End = c(1, 365)
> > Frequency = 365
> >
> > and
> >
> > mytime =  as.POSIXct(strptime(as.character(dati[,1]),format="%Y-%m-%d"))
> >
> > contains the dates from "2003-01-01" to "2003-12-31"
>
> Why not use the Date class?  However, if all you want is the character
> representation of the dates you appear to have those in dati[1].
>
> > How can I combine mytime and myts in order to list the timeseries
> > according to the more natural
> >
> > 2003-01-01    xxxxx  xxxxx   xxxxx ......
> > 2003-01-02    xxxxx  xxxxx   xxxxx ......
> > ...........
> > 2003-12-31    xxxxx  xxxxx   xxxxx ......
>
> What do you want the first column to be?  Character strings? Dates?  What
> do you want to do with this?

As a newbye becoming more and more confident with R, I'm having a go at neural 
networks by means of your nnet package trying to model daily electricity 
demand with respect to time, weather extreme temperatures,air humidity, sky 
coverage (don't know if is correct in English, I mean: a measurement of the 
intensity of daylight going to very cloudy to completely clear), and type of 
day (working days, Mon, Sat, Sun).

Therefore, among many other things, I need to:

1) Window different spells of the year to study them separatedly;
2) Print in a human readable way the list of data of the spell  under 
observation;
3) Plot the same spells as timeseries, that is with a time referenced x-axis.

That's all.

Thanks 

Vittorio




More information about the R-help mailing list