Re: [R] Using boxplot in a daily time series

From: Domenico Vistocco <vistocco_at_unicas.it>
Date: Sat, 15 Dec 2007 22:56:04 +0100

 From your post it is not clear how the data are organized. Supposing they are in a data frame you could use the ~ sintax.

For example:
timeColumn=as.Date("01-01-1970") + 1:500 timeSeries=rnorm(500)
df=data.frame(time=timeColumn, index=timeSeries)
> > head(df)
> time index
> 1 1-01-20 -0.6382554
> 2 1-01-21 -2.0346649
> 3 1-01-22 -0.4900213
> 4 1-01-23 0.7311806
> 5 1-01-24 0.9386528
> 6 1-01-25 0.7868129

boxplot(index~months(time), data=df)

Perhaps you would order the 12 boxes according to the months: monthColumn=ordered(months(df$time), levels= c("January", "February", "March",

            "April", "May", "June", "July", "August", "September", "October", "November", "December"))
boxplot(df$index~monthColumn)

domenico

pedrosmarques_at_portugalmail.pt wrote:
> Hi all,
>
> I'm trying to plot my daily time series, with 3650 observations( 10 years), with boxplot but I want 12 boxes, one for each month, can anyone help me doing that.
>
> Best regards
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 15 Dec 2007 - 22:04:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 15 Dec 2007 - 22:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.