[R] bigest part of vector

seelenhirt at gmx.net seelenhirt at gmx.net
Tue Feb 24 20:48:40 CET 2009


On Tue, 24 Feb 2009 11:36:06 -0800 (PST) (SO, 55 Chs 3175 YOLD)
Peterko <lanikpeter at gmail.com> wrote:

> 
> Hi, may be simle question, but a do not find it anywhere.
> Is there same function like max()  ,but giving more results.
> max() give 1number-maximum
> I need funcion what give p bigest number.
> many thanks

How about sorting first?

sort(vector,decreasing=TRUE)[1:p]

-- 
Marius Glauser

Life, loathe it or ignore it, you can't like it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090224/55c33bce/attachment-0002.bin>


More information about the R-help mailing list