Displaying 5 results from an estimated 5 matches for "content_transformer".
2014 Nov 22
2
Problemas con tm
Estimados compañeros tengo un problema con la librería tm o con windows
8.1 o con algo que no controlo.
Hace tiempo con windows 7 y una versión anterior de R ejecutaba este código:
library(tm)
data("crude")
crude <- tm_map(crude, tolower)
tdm<-TermDocumentMatrix(crude)
y sin problemas me creaba tdm. Ahora si lo ejecuto me da el siguiente error:
Error: inherits(doc,
2014 Jul 22
2
Ayuda Error in `colnames<-`(`*tmp*`, value = c(
...readLines(txt1, encoding="UTF-8")
> d1<-iconv(enc2utf8(d1), sub = "byte")
> d2<-readLines(txt2, encoding="UTF-8")
> d2<-iconv(enc2utf8(d2), sub = "byte")
> df<-c(d1,d2)
> corpus<-Corpus(VectorSource(df))
> d<-tm_map(corpus, content_transformer(tolower))
> d<-tm_map(d, stripWhitespace)
> d<-tm_map(d, removePunctuation)
> sw<-readLines("./StopWords.txt", encoding="UTF-8")
> sw<-iconv(enc2utf8(sw), sub="byte")
> d<-tm_map(d, removeWords, sw)
> d<-tm_map(d, removeWords, stopwo...
2014 Jul 29
2
wordcloud y tabla de palabras [Avanzando]
...Rcpp)
tmpinformes<-data.frame(c("todo el informe 2005", "todo el informe
2013"), row.names=c("2005", "2013"))
ds<- DataframeSource(tmpText)
ds<- DataframeSource(tmpinformes)
corp = Corpus(ds)
corp = tm_map(corp,removePunctuation)
corp = tm_map(corp,content_transformer(tolower))
corp = tm_map(corp,removeNumbers)
corp = tm_map(corp, stripWhitespace)
corp = tm_map(corp, removeWords, sw)
corp = tm_map(corp, removeWords, stopwords("spanish"))
term.matrix<- TermDocumentMatrix(corp)
term.matrix<- as.matrix(term.matrix)
colnames(term.matrix) <- c(&quo...
2014 Jul 28
2
wordcloud y tabla de palabras
...gt; INSPECCIONES/Informes/"
> >
> >>TDM<-function(informes, pathname) {
> > info.dir<-sprintf("%s/%s", pathname, informes)
> > info.cor<-Corpus(DirSource(directory=info.dir, encoding="UTF-8"))
> > info.cor.cl<-tm_map(info.cor, content_transformer(tolower))
> > info.cor.cl<-tm_map(info.cor.cl, stripWhitespace)
> > info.cor.cl<-tm_map(info.cor.cl,removePunctuation)
> > sw<-readLines("C:/Users/d_2/Documents/StopWords.txt", encoding="UTF-8")
> > sw<-iconv(enc2utf8(sw), sub = "byte...
2014 Jul 25
3
wordcloud y tabla de palabras
...e<-"C:/Users/d_2/Documents/Comision/PLAN de INSPECCIONES/Informes/"
>TDM<-function(informes, pathname) {
info.dir<-sprintf("%s/%s", pathname, informes)
info.cor<-Corpus(DirSource(directory=info.dir, encoding="UTF-8"))
info.cor.cl<-tm_map(info.cor, content_transformer(tolower))
info.cor.cl<-tm_map(info.cor.cl, stripWhitespace)
info.cor.cl<-tm_map(info.cor.cl,removePunctuation)
sw<-readLines("C:/Users/d_2/Documents/StopWords.txt", encoding="UTF-8")
sw<-iconv(enc2utf8(sw), sub = "byte")
info.cor.cl<-tm_map(info.cor...