Applying the unnest_tokens function to tweets creates 1 column with each word in its own row. I have additional columns in the original data frame (day, hour, min) of each tweet. Is there a way to have each row of words also have three more column of the day, hour, and min for each corresponding word? I've tried the following:
tweet_words$text <- tweet_words %>%
select(text) %>%
unnest_tokens(word, text)
The original data frame has a text column "tweet_words$text" where every row is 1 tweet. I've tried re-writing the text column to be the column of single words, but get the following error because there's not the same number of rows for the day, hour, min columns. I get the following error.
Error in $<-.data.frame
(*tmp*
, text, value = list(word = c("same", :
replacement has 4571 rows, data has 300
Any ideas how to facilitate the desired outcome?