Re: [R] getting column's main

2010-04-19 Thread Jannis
Try col=max.col(data) This should give you the index of the column with the max value. To get to the final result, combine this with names(dataframe)[col] to get the name of the column with the maximum value. HTH Jannis AuriDUL schrieb: Hello. I have data of potatoes production in EU

Re: [R] getting column's main

2010-04-18 Thread jim holtman
Please do provide data when submitting a question so we don't have to try to recreate it from a brief description. > pot <- data.frame(count=LETTERS[1:10], '1998'=runif(10), '1999'=runif(10), + '2000'=runif(10), '2001'=runif(10), check.names=FALSE, stringsAsFactors=FALSE) > pot count