This function sorts a data frame by one or more columns and returns the top n rows.
In contrast to dplyr::top_n
, this function alows to sort by multiple columns and returns
exactly n rows even if ties are present in the columns used for sorting.
bro_top_n(df, n, ...)
df | data frame to filter |
---|---|
n | number of rows to return |
... | names of columns to sort by |