> 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
sefick wrote:
From: stephen sefick
Subject: [R] Function that is giving me a headache- any help appreciated
(automatic read )
To: r-help@r-project.org
Received: Tuesday, May 18, 2010, 12:38 PM
note: whole function is below- I am
sure I am doing something silly.
when I use it like USGS(input=&q
I don't think you can do this
precipitation!="NA")
have a look at ?is.na
--- On Tue, 5/18/10, stephen sefick wrote:
> From: stephen sefick
> Subject: [R] Function that is giving me a headache- any help appreciated
> (automatic read )
> To: r-help@r-project.org
note: whole function is below- I am sure I am doing something silly.
when I use it like USGS(input="precipitation") it is choking on the
precip.1 <- subset(DF, precipitation!="NA")
b <- ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum)
DF.precip <- precip.1
DF.precip$precipitation <-
4 matches
Mail list logo