Skip to content

Instantly share code, notes, and snippets.

@sAbakumoff
Created September 12, 2016 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sAbakumoff/3372f54deb6313b831faccc41786c655 to your computer and use it in GitHub Desktop.
Save sAbakumoff/3372f54deb6313b831faccc41786c655 to your computer and use it in GitHub Desktop.
bing <- sentiments %>%
filter(lexicon == "bing") %>%
select(-score)
angular_word_counts<-tidy_commits %>%
filter(name=="angular.js") %>%
inner_join(bing) %>%
count(word, sentiment, sort = TRUE) %>%
ungroup()
angular_word_counts %>% filter(n > 50) %>%
mutate(n = ifelse(sentiment == "negative", -n, n)) %>%
mutate(word = reorder(word, n)) %>%
ggplot(aes(word, n, fill = sentiment)) +
geom_bar(stat = "identity") +
labs(x="word", y="Contribution to sentiment") +
coord_flip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment