[R] Function that is giving me a headache- any help appreciated (automatic read )
Hadley Wickham
hadley at rice.edu
Wed May 19 01:29:00 CEST 2010
> precip.1 <- subset(DF, precipitation!="NA")
> b <- ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum)
> DF.precip <- precip.1
> DF.precip$precipitation <- b$.data
I suspect what you want here is
ddply(precip.1, "gauge_name", transform, precipitation = cumsum(precipitation))
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
More information about the R-help
mailing list