Description Usage Arguments Examples
This function returns the top n values of a data.frame or data.table based on user provided function and column
1 |
df |
A data.table or data.frame |
col |
A character string of the column used to pick top values |
n |
The number of top values to keep, nrow(df) < n then nrow(df) is used |
fun |
The ordering function to apply to col. Default is function(x)-x which keeps largest. |
keep_ordering |
Logical, if TRUE then maintain original ordering, if FALSE order based on fun |
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.