Displaying 2 results from an estimated 2 matches for "mystopword".
Did you mean:
mystopwords
2011 Oct 04
1
Reading stopwords from a csv file
I am using the tm package to do text miniing:
I have a huge list of stopwords (2000+) that are in a csv file. I read it as
follows:
stopwordlist <- read.csv("stopwords to be Removed 10042011.csv")
myStopwords <- as.character(stopwordlist$stopwords)
When try removing the stopwords using
tr1=tm_map(tr1,removeWords,myStopwords)
I am getting the following error:
Error in gsub(sprintf("\\b(%s)\\b", paste(words, collapse = "|")), "", :
internal error in compiling reg...
2012 Feb 26
2
tm_map help
...ly(tweets, as.data.frame))
myCorpus <- Corpus(VectorSource(df$text))
myCorpus <- tm_map(myCorpus, function(x) iconv(enc2utf8(x), sub = "byte"))
myCorpus <- tm_map(myCorpus, tolower)
myCorpus <- tm_map(myCorpus, removePunctuation)
myCorpus <- tm_map(myCorpus, removeNumbers)
myStopwords <- c(stopwords('english'), "available", "via")
myCorpus <- tm_map(myCorpus, removeWords, myStopwords)
dictCorpus <- myCorpus
myCorpus <- tm_map(myCorpus, stemDocument)
################ERROR HAPPENS ON NEXT LINE##################################
myCorpus &l...