Skip to content
Prev 333615 / 398506 Next

create a new dataframe with intervals and computing a weighted average for each of its rows

Well, in his defense, he did provide quite a bit of R code, and did use a data.frame function to build a sample input data frame, so there was some effort made to communicate.

Unfortunately, after inserting newlines in the code that were demolished by the HTML, the code still does not run because it references a VALUE vector that is missing. By the name this seems like it might be important, but you don't reference it later so it is hard to guess what he wants to do.

Luis:
Your code is quite complicated after that, but I think you are doing way too much work on dividing up your data into groups since the ave function, aggregate function or the plyr library can simplify this very much. Since I don't see what you want to DO with each group, it is hard to show you a simpler way to do it. Perhaps you should just work through the examples for some of those functions.

Note that the only reliable way to give us sample data is using the dput function (or the data.frame function). Formatted tables pasted from spreadsheets just don't get through the email list clearly. Nor do most attachments.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
Bert Gunter <gunter.berton at gene.com> wrote: