Re: [R] help incorporating data subset lengths in function with ddply

2014-04-17 Thread Steve E.
Jeff - Thanks so very much for the solution and tips, all very much appreciated! Regards, Stevan -- View this message in context: http://r.789695.n4.nabble.com/help-incorporating-data-subset-lengths-in-function-with-ddply-tp4688926p4688999.html Sent from the R help mailing list archive at

[R] help incorporating data subset lengths in function with ddply

2014-04-16 Thread Steve E.
Dear R Community, I am having some trouble with a task that I hope you might be able to help with. I have a dataset that includes the time and corresponding stream discharge from numerous storms (example of structure with simplified data below). I would like to produce a field that details the

Re: [R] help incorporating data subset lengths in function with ddply

2014-04-16 Thread Frede Aakmann Tøgersen
incorporating data subset lengths in function with ddply Dear R Community, I am having some trouble with a task that I hope you might be able to help with. I have a dataset that includes the time and corresponding stream discharge from numerous storms (example of structure with simplified data

Re: [R] help incorporating data subset lengths in function with ddply

2014-04-16 Thread Steve E.
Hi Frede - Thank you for responding. Not quite what I am after. Notice that I included two data sets in my post, the first is the raw data whereas the second (the desired df) is similar but has a column of sequential numbers in another column at the end - that column of sequential numbers for each

Re: [R] help incorporating data subset lengths in function with ddply

2014-04-16 Thread Jeff Newmiller
Note that ddply is a heavyweight solution, and as your data gets larger you may find that using it for little things like this hits performance. Also, df is a base function that you might actually want to use someday, and you also introduce confusion in the mind of someone reading your code if

Re: [R] help incorporating data subset lengths in function with ddply

2014-04-16 Thread Jeff Newmiller
Note that the solution you asked for is not robust in the presence of missing data, though Frede's suggestion or something like it would be. --- Jeff NewmillerThe . . Go Live...