top_n_groups: Select rows in the top n groups according to some...

Description Usage Arguments Value

View source: R/data_frames.R

Description

Select rows in the top n groups according to some summarization operation

Usage

1
top_n_groups(df, group_var, val_var, val_fun = sum)

Arguments

df

data frame

group_var

grouping variable

val_var

value assessment variable to be summarized by group

val_fun

value assessment function to apply to val_var by group

Value

data frame only with observations from top groups


alexpghayes/hayeslib documentation built on May 5, 2019, 4:47 p.m.