Skip to content
Prev 171571 / 398503 Next

bigest part of vector

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: