Description Usage Arguments Details Value Note Author(s) References See Also Examples

Written in C++, this function tends to run faster than `which.max`

for large numeric vectors.

1 | ```
which_max_nv(x)
``` |

`x` |
Numeric vector. |

NA

Integer value.

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

:

`which_max_nv`

for numeric vector.

`which_max_iv`

for integer vector.

`which_max_nm`

for numeric matrix.

`which_max_im`

for integer matrix.

Dane R. Van Domelen

Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.

NA

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# For long vectors, which_max_nv is faster than which.max
x <- rnorm(100000)
which.max(x) == which_max_nv(x)
microbenchmark(which.max(x),
which_max_nv(x),
times = 100)
# For shorter vectors, which_max_nv is slower than which.max
x <- rnorm(100)
which.max(x) == which_max_nv(x)
microbenchmark(which.max(x),
which_max_nv(x),
times = 100)
``` |

dvmisc documentation built on Dec. 29, 2017, 3:01 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.