bro_top_n: Filter top n rows by value

View source: R/helpers.R

bro_top_nR Documentation

Filter top n rows by value

Description

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.

Usage

bro_top_n(df, n, ...)

Arguments

df

data frame to filter

n

number of rows to return

...

names of columns to sort by


jbengler/bro documentation built on Aug. 1, 2023, 9:09 a.m.