given the start, can you modify the code of the end_current to get instead the end_goal? basically other than the minimum I need all the unique values
start <- data.table(team=c('a', 'a', 'b', 'b', 'b', 'c', 'c'),
pts=c(5, 8, 5, 5, 5, 9, 10))
end_goal <- data.table(team=c('a','b','c'),
min_pts=c(5, 5, 9),
unique_pts=c("5-8","5","9-10"))
end_current <- start[, .(
min_pts = min(pts)
# unique_pts???
),
by = .(team)]