slice_max

Keep rows with the largest values

Returns the rows with the highest values in an ordering column.

Parameters

Returns

A DataFrame with the top n rows by the ordering column.

Examples

slice_max(df, $score)
slice_max(df, $score, n = 5)