You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'll look at some books by [Jane Austen](https://en.wikipedia.org/wiki/Jane_Austen), an 18th century novelist. Austen explored women and marriage within the British upper class. The novelist has a unique and well earned following within literature. Her works is consistently discussed and honored. To this day, Austen's novels are the source of many adaptations, written and on-screen. Through the `janeaustenr` package we can access and mine the text of six Austen novels. We can call the collection of novels a corpra. An individual novel is a corpus.
@@ -116,7 +132,7 @@ bind_rows(get_stopwords(), stopwords_custom) # The default is "snowball"
116
132
117
133
### Calculate word frequency
118
134
119
-
How many Austen countable words are there if we remove _snowball_ stop-words? There are `r library(magrittr); matchwords_books %>% distinct(word) %>% nrow()` countable words.
135
+
How many Austen countable words are there if we remove _snowball_ stop-words? There are `r nrow(dplyr::distinct(matchwords_books, word))` countable words.
120
136
121
137
```{r}
122
138
matchwords_books %>%
@@ -289,7 +305,7 @@ head(get_sentiments("nrc"))
289
305
head(get_sentiments("afinn"))
290
306
291
307
get_sentiments("nrc") %>%
292
-
count(sentiment, sort = TRUE)
308
+
count(sentiment, sort = TRUE)
293
309
294
310
```
295
311
@@ -374,8 +390,25 @@ emma_afinn %>%
374
390
- Data Visualization with ggplot2: ([video](https://warpwire.duke.edu/w/80YEAA/) | [workshop](https://rfun.library.duke.edu/portfolio/ggplot_workshop/))
0 commit comments