That actually won't work. max(y) will give a value, not a coordinate, so x[max(y)] is definitely not what you want. -- View this message in context: http://r.789695.n4.nabble.com/Finding-coordinates-for-maximum-of-a-function-tp3355369p3356483.html Sent from the R help mailing list archive at Nabble.com.