[R] Function that is giving me a headache- any help appreciated (automatic read )

2010-05-18 Thread stephen sefick
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 -

Re: [R] Function that is giving me a headache- any help appreciated (automatic read )

2010-05-18 Thread John Kane
I don't think you can do this precipitation!=NA) have a look at ?is.na --- On Tue, 5/18/10, stephen sefick ssef...@gmail.com wrote: From: stephen sefick ssef...@gmail.com Subject: [R] Function that is giving me a headache- any help appreciated (automatic read ) To: r-help@r-project.org

Re: [R] Function that is giving me a headache- any help appreciated (automatic read )

2010-05-18 Thread Peter Ehlers
: From: stephen sefickssef...@gmail.com 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

Re: [R] Function that is giving me a headache- any help appreciated (automatic read )

2010-05-18 Thread Hadley Wickham
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 --