I am trying to convert a dataframe with many IDs some of which are associated to multiple names to one where each ID occurs once and the names are all contained in the second column (see example below). I have been trying this for a while now but somehow can not figure out how to do it. Any advice?
df<-data.frame("ID"=c("a","a","b","b","c","d","d"),
"name"=c("John","Lisa", "Hank", "Peter", "Anne", "Lisa", "Mic")
#desired outcome:
df<-data.frame("ID"=c("a", "b", "c", "d"),
"names"=c("John;Lisa", "Hank;Peter", "Anne", "Lisa;Mic")