I hope this is not to basic a question, I have a dataframe of tweets (in R). My aim is to calculate the sentiment by date.
I would be so grateful if anyone would advise me,
how to concatenate tweets tweet$text
by date, where
each observation becomes a string of merged tweets/text
For example, if I had:
Created_Date Tweet
2014-01-04 "the iphone is magnificent"
2014-01-04 "the iphone's screen is poor"
2014-01-04 "I will always use Apple products"
2014-01-03 "iphone is overpriced, but I love it"
2014-01-03 "Siri is very sluggish"
2014-01-03 "iphone's maps app is poor compared to Android"
I would like a loop/function to merge the tweets by Created_Date resulting in something like this
Created_Date Tweet
2014-01-04 "the iphone is magnificent", "the iphone's screen is poor", "I will always use Apple products"
2014-01-03 "iphone is overpriced, but I love it", "Siri is very sluggish", "iphone's maps app is poor compared to Android"
Here are my data
dat <- structure(list(Created_Date = structure(c(1388793600, 1388793600,
1388793600, 1388707200, 1388707200, 1388707200), class = c("POSIXct",
"POSIXt"), tzone = "UTC"), Tweet = c("the iphone is magnificent",
"the iphone's screen is poor", "I will always use Apple products",
"iphone is overpriced, but I love it", "Siri is very sluggish",
"iphone's maps app is poor compared to Android")), .Names = c("Created_Date",
"Tweet"), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-6L))