Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/r-utility-argminmax.R
This function applies a numeric-valued function to a vector or list of arguments and returns a specified number of arguments that yield the greatest function values. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.
1 |
args |
a vector or list of function arguments |
fun |
a function that can be called with one argument and returns a numeric value |
k |
an integer specifying the number of arguments corresponding to the greatest function values to return |
The fun
function is applied to each argument in args
and
then the k
arguments that produced the greatest function values
are returned. Ties are broken according to the original ordering of
arguments (using stable sorting to determine the least k
values).
If args
is a list, its sublist of length k
containing the
k
arguments that yield the greatest fun
values. If
args
is a vector, its subvector of length k
containing the
k
arguments that yield the greatest fun
values.
Pawel Cichosz <p.cichosz@elka.pw.edu.pl>
1 2 3 4 5 6 | |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.