df = data.frame(record = c(20200525,20200608,20200608,20200615,20200615,20200622,20200622,20200701,20200701,20200706,20200706,20200713,20200713,20200727,20200727,20200803), team = c("A","A","B","B","C","C","D","D","E","E","F","F","G","G","H","H"))
Want to use df$record min as value of column S, max as value of column E in each team. and would be looking for an answer like this:
I tried using:
df %>% mutate(S = top_n(1, record) ,E = top_n(-1, record))
and it gave me Error... Thanks for any help.
