I'm having trouble to convert this:
Name(id) Food
John Apple
John Beans
Anna Apple
Anna Banana
To this:
Name(id) Food
John c(Apple,Beans)
Anna c(Apple,Banana)
I've found a solution to a similar problem with Python: Combine rows by id but couldn't do something similar on R.