I have a dataframe in R that has repeated entries in column a
:
a <- c("cat", "dog", "cat", "dog")
b <- c("siamese", "chow", "burmese", "husky")
dataframe <- data.frame(a,b)
a b
1 cat siamese
2 dog chow
3 cat burmese
4 dog husky
How do I collapse entries where a is repeated multiple times? For example, to end up with a dataframe like this:
a b
1 cat siamese; burmese
2 dog chow; husky