library(gutenbergr)
library(tidytext)
library(tm)
## Loading required package: NLP
library(twitteR)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:twitteR':
##
## id, location
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(wordcloud)
## Loading required package: RColorBrewer
gutenberg_works(author == "Plato")
## # A tibble: 27 x 8
## gutenberg_id title author gutenbe~ langu~ gutenb~ rights has_~
## <int> <chr> <chr> <int> <chr> <chr> <chr> <lgl>
## 1 150 The Republic Plato 93 en <NA> Public ~ T
## 2 1571 Critias Plato 93 en <NA> Public ~ T
## 3 1572 Timaeus Plato 93 en <NA> Public ~ T
## 4 1579 Lysis Plato 93 en <NA> Public ~ T
## 5 1580 Charmides Plato 93 en <NA> Public ~ T
## 6 1584 Laches Plato 93 en <NA> Public ~ T
## 7 1591 Protagoras Plato 93 en <NA> Public ~ T
## 8 1598 Euthydemus Plato 93 en <NA> Public ~ T
## 9 1600 Symposium Plato 93 en <NA> Public ~ T
## 10 1616 Cratylus Plato 93 en <NA> Public ~ T
## # ... with 17 more rows
## Determining mirror for Project Gutenberg from http://www.gutenberg.org/robot/harvest
## Using mirror http://aleph.gutenberg.org
words <- plato %>% unnest_tokens(word,text)
plato_corpus <- Corpus(VectorSource(words3))
dial_corpus <- Corpus(VectorSource(dial_words3))
dial_clean <- tm_map(dial_corpus, removeWords, c("socrates", "meno", "euthyphro", "crito", "phaedo"))
## [1] "Using direct authentication"