Sentiment_by function

303 Views Asked by At

i am collecting the sentiment data of some twitter information. Moreover I have been using the function sentiment_by in order to group the information by a column.

sent<-sentiment_by(tidy_libros_stopwords$word, by=tidy_libros_stopwords$screen_name)

enter image description here The problem that now I need to group by two columns (screen_name and created_at) I have tried this but doesn't work

sent<-sentiment_by(tidy_libros_stopwords$word, by=tidy_libros_stopwords$screen_name,tidy_libros_stopwords$created_at)
1

There are 1 best solutions below

0
On

The by argument expects a list if more than one grouping variable is provided. Try this:

sent<-sentiment_by(tidy_libros_stopwords$word, by=list(tidy_libros_stopwords$screen_name,tidy_libros_stopwords$created_at))