For example,a <- c(1,1,2,3,4,3,2)
, the second minimum value is 2, how can I find this second minimum value ?
Asked
Active
Viewed 4,446 times
0

Tao Hu
- 287
- 2
- 12
-
Just sort the unique values and take the second one. – Rich Scriven May 18 '17 at 02:55
-
http://stackoverflow.com/questions/2453326/fastest-way-to-find-second-third-highest-lowest-value-in-vector-or-column – Edgar Santos May 18 '17 at 02:55
-
You will need unique values for partial sorting to work here. – Rich Scriven May 18 '17 at 03:01
-
1`min( a[a!=min(a)] )` is work,thank you ! – Tao Hu May 18 '17 at 03:02