Skip to content
Back to formatted view

Raw Message

Message-ID: <006a01c996ba$b3be81e0$3a0b2c0a@gne.windows.gene.com>
Date: 2009-02-24T20:01:37Z
From: Bert Gunter
Subject: bigest part of vector
In-Reply-To: <22189283.post@talk.nabble.com>

Nothing wrong with prior suggestions, but strictly speaking, (fully) sorting
the vector is unnecessary.

y[y > quantile(y, 1- p/length(y))]

will do it without the (complete) sort. (But sorting is so efficient anyway,
I don't think you could notice any difference).

-- Bert Gunter
Genentech 

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Peterko
Sent: Tuesday, February 24, 2009 11:55 AM
To: r-help at r-project.org
Subject: Re: [R] bigest part of vector


Thanks for all

Peterko 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
> 

-- 
View this message in context:
http://www.nabble.com/bigest-part-of-vector-tp22188901p22189283.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.