Grokbase Groups R r-help March 2002
FAQ
Dear Patrick,


What about:



x <- rnorm(100)
mx <- max(x)
exact.location <- which(x == mx)



Hopin' it helps,



Laurent




Laurent Gautier CBS, Building 208, DTU
PhD. Student D-2800 Lyngby,Denmark
tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent


On Tue, 5 Mar 2002, Patrick Buetzberger wrote:

Dear R-users,

I'm trying to extract the exact location of the maximum value in a
vector or a matrix, meaning I want not only the maximum itself but also
at which position (e.g row 6, column 12) it is located.
I appreciate any suggestions.
Thanks,

Patrick
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 4 | next ›
Discussion Overview
groupr-help @
categoriesr
postedMar 5, '02 at 2:49p
activeMar 5, '02 at 6:35p
posts4
users4
websiter-project.org
irc#r

People

Translate

site design / logo © 2017 Grokbase