If I have a dataframe like this
structure(list(id = c(1, 1, 1, 2, 2, 2, 3, 3), text = c("Google",
"Google", "Amazon", "Amazon", "Google", "Yahoo", "Yahoo", "Google"
)), .Names = c("id", "text"), row.names = c(NA, -8L), class = "data.frame")
How can I produce a new dataframe which contains the count of every string:
Desired output
id Google Yahoo Amazon
1 1 2 0 1
2 2 1 1 1
3 3 1 1 0