Let's say I have a data frame consisting of sentence IDs and terms like so:
data.frame(sid = c(1, 1, 2, 2), text = c("hello", "world", "whats", "up"))
How could I aggregate it to get a data frame like so:
data.frame(sid = c(1, 2), text = c("hello world", "whats up"))
Or better yet, as a list with corresponding indices like so:
list("hello world", "whats up")