Description Usage Arguments Value Author(s) See Also Examples

Determines the locations, i.e., indices of the n largest or n smallest elements of a numeric vector.

1 | ```
which.maxn(x, n = 1)
``` |

`x` |
numeric vector |

`n` |
integer >= 1 |

A vector of length at most n with the indices of the n largest / smaller elements. NAs are discared and that can cause the vector to be smaller than n.

Søren Højsgaard, [email protected]

1 2 3 4 5 | ```
x <- c(1:4, 0:5, 11, NA, NA)
ii <- which.minn(x, 5)
x <- c(1, rep(NA,10), 2)
ii <- which.minn(x, 5)
``` |

doBy documentation built on Aug. 30, 2018, 9:03 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.