-
-
Save jduckles/6907f92ad498d53084ceac3f7aa658d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidytext) | |
library(tidyverse) | |
# Sentiment | |
# Load corpus | |
survey <- read_csv("~/Downloads/Data_All_170707/CSV/SWC - Post-workshop Survey.csv") | |
words <- tibble(instructor=survey$`Do you have specific comments about the instructors or helpers?`) %>% | |
na.omit() %>% | |
unnest_tokens(word,instructor) %>% | |
anti_join(stop_words) | |
frequent_words <- words %>% | |
count(word, sort=TRUE) | |
nrc <- get_sentiments('nrc') | |
instructor_sentiment <- | |
frequent_words %>% | |
inner_join(nrc) %>% | |
count(sentiment,n, sort=TRUE) | |
ggplot(instructor_sentiment, aes(x=reorder(sentiment,-Freq) ,y=Freq)) + | |
geom_bar(stat="identity") + | |
labs(title="Sentiment analysis of 'Do you have specific comments about \n the instructors or helpers?'", x="Sentiment") + | |
theme(text = element_text(size=20), axis.text.x = element_text(angle=45, hjust=1)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment