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

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Feb 19 13:30:00 CET 2007


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

do.call("pmax", c(dataframe[,intensityindeces], list(na.rm=TRUE)))

See ?do.call

> would give me
>
> Error in if (quote) { : argument is not interpretable as logical
> In addition: Warning message:
> the condition has length > 1 and only the first element will be used in: if
> (quote) {
>
> ?
>
> Thanks, Joh
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list