[R] Help

arun smartpink111 at yahoo.com
Mon Feb 10 02:20:03 CET 2014

Based on the data.

vec1 <- c(56,98,15)
vec2 <- sort(vec1,decreasing=TRUE)
#[1] 42


I need some help in a simple thing.... 

If I have 3 classes like    56     98    15, I need do max1-max2
 where the max 1 is the maximun (98) and the max2 is the second maximun 

How can I do this in R? To obtain the max I used  apply(data, 1, max), but...and the other? 


More information about the R-help mailing list