[R] Data frame: how to create list of row max?

2007-02-19 Thread Johannes Graumann
Dear all, Can anyone please shed some light onto how to do this? This will give me all intensity columsn in my data frame: intensityindeces - grep(^Intensity,names(dataframe),value=TRUE) This will give me the maximum intensity for the first row: intensityone - max(dataframe[1,intensityindeces])

Re: [R] Data frame: how to create list of row max?

2007-02-19 Thread Chuck Cleland
Johannes Graumann wrote: Dear all, Can anyone please shed some light onto how to do this? This will give me all intensity columsn in my data frame: intensityindeces - grep(^Intensity,names(dataframe),value=TRUE) This will give me the maximum intensity for the first row: intensityone -

Re: [R] Data frame: how to create list of row max?

2007-02-19 Thread Prof Brian Ripley
do.call(pmax, dataframe[,intensityindeces]) if I understand you aright. On Mon, 19 Feb 2007, Johannes Graumann wrote: Dear all, Can anyone please shed some light onto how to do this? This will give me all intensity columsn in my data frame: intensityindeces -

Re: [R] Data frame: how to create list of row max?

2007-02-19 Thread Johannes Graumann
On Monday 19 February 2007 11:53, Prof Brian Ripley wrote: do.call(pmax, dataframe[,intensityindeces]) Thank you very much for your help! Any idea why do.call(pmax,list(na.rm=TRUE),dataframe[,intensityindeces]) would give me Error in if (quote) { : argument is not interpretable as logical In

Re: [R] Data frame: how to create list of row max?

2007-02-19 Thread Prof Brian Ripley
On Mon, 19 Feb 2007, Johannes Graumann wrote: On Monday 19 February 2007 11:53, Prof Brian Ripley wrote: do.call(pmax, dataframe[,intensityindeces]) Thank you very much for your help! Any idea why do.call(pmax,list(na.rm=TRUE),dataframe[,intensityindeces]) You want something like

Re: [R] Data frame: how to create list of row max?

2007-02-19 Thread David Barron
Try do.call(pmax,c(dataframe[,intensityindices],na.rm=TRUE)) This is like the second example in the help page for do.call On 19/02/07, Johannes Graumann [EMAIL PROTECTED] wrote: On Monday 19 February 2007 11:53, Prof Brian Ripley wrote: do.call(pmax, dataframe[,intensityindeces]) Thank you

Re: [R] Data frame: how to create list of row max?

2007-02-19 Thread Johannes Graumann
Thanks to you and Brian Ripley. Quite confusing all this ... Thanks again. Joh On Monday 19 February 2007 13:42, David Barron wrote: Try do.call(pmax,c(dataframe[,intensityindices],na.rm=TRUE)) This is like the second example in the help page for do.call On 19/02/07, Johannes Graumann