[R] Finding coordinates for maximum of a function

nblarson nblarson at gmail.com
Tue Mar 15 00:54:57 CET 2011


This is where which.max() comes in handy
n<-length(x)
x.c<-rep(0,n)
for(i in 1:n){
x.c[i]<-which.max[y1]
}

x.c is then a vector of x coordinates for the maximum for columns
y1,y2,...,yn

--
View this message in context: http://r.789695.n4.nabble.com/Finding-coordinates-for-maximum-of-a-function-tp3355369p3355395.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list