Description Usage Arguments Value See Also Examples
Analogous function for top_n
and top_frac
in dplyr, but with a different API.
1 2 3 |
data |
data.frame |
n |
If |
wt |
(Optional). The variable to use for ordering. If not specified, defaults to the last variable in the data.frame. |
data.table
1 2 3 4 | iris %>% top_n_dt(10,Sepal.Length)
iris %>% top_n_dt(-10,Sepal.Length)
iris %>% top_frac_dt(.1,Sepal.Length)
iris %>% top_frac_dt(-.1,Sepal.Length)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.