I have a data frame as following:
text class.negative class.positive class.trust
<fctr> <dbl> <dbl> <dbl>
firmly believe... 11 24 3
when i thought... 3 3 4
fans of david... 11 24 12
just watched... 3 5 9
i was so looking... 16 9 10
Here's the code I used for data manipulation
clean.reviews = data.frame(text = reviews,class = get_nrc_sentiment(reviews), stringsAsFactors = T)
head(clean.reviews)
clean.reviews1 = as.data.frame(clean.reviews)
head(clean.reviews1)
I'm very new to data manipulation, and a little desperate with transforming data into the following:
class (class.positive-class.negative) text
13 firmly believe...
0 when I thought...
13 fans of david...
2 just watched...
-7 i was so looking...
I realize that I might be insufficient in fully describing the situation, so I've uploaded the .csv file to dropbox.
The
dplyr
package will probably be the easiest way for this.If you want to get rid of exisiting columns, replace
mutate
withtransmute
.