Displaying 1 result from an estimated 1 matches for "4236038".
2013 Mar 26
2
Plot cumulative sums of rainfall per year
...ot each year of cumulative rainfall as a separate line in one graph preferably using ggplot with the x-axis showing the julian day 1 to 365 (366) and the y-axis showing the cumulative values.
I have the following code:
library(plyr)
library(ggplot2)
data<-read.csv("http://dl.dropbox.com/u/4236038/test_cumu.csv")
data$year <- as.numeric(format(as.Date(data$Date), format="%Y"))
ddply(data,.(year),transform,cumRain = cumsum(Rainfall))->cumu
ggplot(cumu, aes(Date,cumRain))+geom_point()
What it does it perfectly calculates the cumulative sum of the rainfall and resets the s...