Last active
August 23, 2017 15:56
-
-
Save cbonsig/d0b569bb5e510dcabe6ed02e924b1025 to your computer and use it in GitHub Desktop.
Revisions
-
cbonsig revised this gist
Aug 23, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -21,5 +21,6 @@ corp <- tm_map(corp, removeWords, c('the', 'this', 'and', 'page', color <- rev(brewer.pal(8,"RdYlBu")) wordcloud(corp, max.words = 250, random.order = FALSE, colors = color, family = "serif", font = 3, scale = c(3,0.75)) -
cbonsig created this gist
Aug 23, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ install.packages("tm") install.packages("SnowballC") install.packages("wordcloud") install.packages("readtext") library(tm) library(SnowballC) library(wordcloud) library(readtext) getwd() setwd('/Users/cbonsignore/Desktop/Karthik Documents') wordbase <- readtext("*.pdf") corp <- Corpus(VectorSource(wordbase)) corp <- tm_map(corp, removePunctuation) corp <- tm_map(corp, removeNumbers) corp <- tm_map(corp, removeWords, c('the', 'this', 'and', 'page', stopwords('english'))) color <- rev(brewer.pal(8,"RdYlBu")) wordcloud(corp, max.words = 250, random.order = FALSE, colors = color, family = "serif", font = 3, scale = c(3,0.75))