[R] Finding max number in R

2014-03-27 Thread Prabhakar Ghorpade
Hello, If I have x-c(5,9,8,3,4,5,6,7,) and y -(a, b,c, d,e,f, g,h) and D - data.frame(x,y) I did this max(x) and My expectede anwer is b. How do I select element in y which correspond to maximum number in x? thanks. regards, Prabhakar [[alternative HTML version deleted]]

Re: [R] Finding max number in R

2014-03-27 Thread jim holtman
First, read the Introduction to R to understand what dataframes are and how to access data within them. Then correct you code so it does not have error: 'x' has a trailing comma and 'y' was not call the 'c' function. Once you have done that, you might get the following: x-c(5,9,8,3,4,5,6,7)