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-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peterko Sent: Tuesday, February 24, 2009 11:55 AM To: r-help@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@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. ______________________________________________ R-help@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.