powered by
Fetch one row from each grouped by group
get_row_group_by(dt, group_by_cols, fetch_row)
grouped by data table
input data table
group by columns
first means to fetch first row and last means to fetch last row
data("dt_groups") dataMojo::get_row_group_by(dt_groups, group_by_cols = c("group1", "group2"), fetch_row = "first")
Run the code above in your browser using DataLab