Description Usage Arguments Examples
This function selects the top or bottom rows defined by an value (n) from a data frame.
1 | top_n_terms(x, n, wt)
|
x |
A data frame |
n |
Number of rows to returns for 'top_n_terms()'. If 'n' is positive, selects the top rows. If negative, selects the bottom rows. |
wt |
(Optional) Variable used for ordering. If not specified, defaults to the last variable in the tbl. |
1 2 | df <- data.frame(x = c(7, 10, 20, 13, 5, 22))
df %>% top_n(3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.