top_n_terms: Select top (or bottom) n rows

Description Usage Arguments Examples

View source: R/top_terms.R

Description

This function selects the top or bottom rows defined by an value (n) from a data frame.

Usage

1
top_n_terms(x, n, wt)

Arguments

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.

Examples

1
2
df <- data.frame(x = c(7, 10, 20, 13, 5, 22))
df %>% top_n(3)

Alanapengilley/TopicModelling documentation built on Dec. 17, 2021, 7:45 a.m.