Description Usage Arguments Details Value Examples

Written in C++, this function tends to run much faster than the equivalent
(if minimum is unique) base R solution
`which(x == min(x), arr.ind = TRUE)`

.

1 | ```
which_min_nm(x)
``` |

`x` |
Numeric matrix. |

For optimal speed, choose the version of this function that matches the
class of your `x`

:

`which_min_nv`

for numeric vector.

`which_min_iv`

for integer vector.

`which_min_nm`

for numeric matrix.

`which_min_im`

for integer matrix.

Integer vector.

1 2 3 4 5 6 | ```
# which_min_nm is typically much faster than
# which(x == min(x), arr.ind = TRUE)
x <- matrix(rnorm(100), ncol = 10)
all(which(x == min(x), arr.ind = TRUE) == which_min_nm(x))
benchmark(which(x == min(x), arr.ind = TRUE), which_min_nm(x),
replications = 5000)
``` |

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.