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

From: Dylan Beaudette <>
Date: Sat, 15 Dec 2007 14:02:02 -0800

On Saturday 15 December 2007 07:13:34 am 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


there are several approaches to this, but in general thinking about your data in terms of 'grouping' factors can be helpful


# 1 year's worth of dates:
d <- strptime(1:365, format="%j")

# some simulated data
x <- rlnorm(365)

# combine them into a DF
dx <- data.frame(date=d, value=x)

# plot the data, note that x-axis is in dates: plot(dx)

# now generate a grouping factor. how about months: dx$month <- format(dx$date, format="%B")

# box and whisker plot for data *grouped* by month boxplot(value ~ month, data=dx, las=3)


Dylan mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sat 15 Dec 2007 - 22:07:43 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 Sun 16 Dec 2007 - 00:30:19 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.