Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. library(tm)
  2. library(XML)
  3. crudeCorp<-VCorpus(VectorSource(readLines(file.choose())))
  4.  
  5. crudeCorp <- tm_map(crudeCorp, stripWhitespace)
  6.  
  7. library(SnowballC)
  8. crudeCorp <- tm_map(crudeCorp, stemDocument)
  9. crudeCorp <- tm_map(crudeCorp, stripWhitespace)
  10.  
  11. crudeCorp<-tm_map(crudeCorp, content_transformer(tolower))
  12.  
  13. crudeCorp<-tm_map(crudeCorp, removeWords, stopwords("english"))
  14.  
  15. myStopwords <- c(stopwords("english"), "can", "will","go","also","get","much","since","way","even","just")
  16. myStopwords <- setdiff(myStopwords, c("will","can"))
  17. crudeCorp <- tm_map(crudeCorp, removeWords, myStopwords)
  18.  
  19. crudeCorp<-tm_map(crudeCorp,removeNumbers)
  20.  
  21. crudeDtm <- TermDocumentMatrix(crudeCorp, control=list(removePunctuation=T))
  22.  
  23. 1. The masks are fake!! I even found a bug in one of them!!! I need refund!
  24. 2. so i thought nothing of it.
  25. 3. I tried a few days, only one out of five felt comfortable on my face.
  26. (skip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement