Skip to content
Prev 132464 / 398506 Next

plot cummulative sum from calendar time

Here is an example of plotting the number of observations per month.
You can change this to any period you want.

# create some test data
x.d <- as.Date("2000-1-1") + runif(1000, 1, 500)
# create buckets of one month (or whatever period you want)
x.cut <- cut(x.d, breaks=seq(as.Date('2000-1-1'), max(x.d)+7, by="1 month"))
# plot the data
barplot(table(x.cut), main="Observations Per Month")
On Dec 19, 2007 1:59 AM, gallon li <gallon.li at gmail.com> wrote: