3
I’m using the following program:
library("wordcloud")
library("tm")
library("RColorBrewer")
dados=read.csv("C:/teste/dados.csv", sep=";", dec=",",header=TRUE)
capa=dados$mensagem
corpus <- VCorpus(VectorSource(capa))
corpus1 <- tm_map(corpus, stripWhitespace)
corpus2 <- tm_map(corpus1, tolower)
corpus2 <- tm_map(corpus2, removePunctuation)
wordcloud(corpus2, random.order = F, colors = brewer.pal(5, "Dark2"))
And you’re making the following mistake:
Error: Inherits(doc, "Textdocument") is not TRUE
Thanks. I did a transformation and it worked. Use the following command: corpus_clean <- tm_map(corpus, content_transformer(tolower))
– user20273
@user20273, answer your own question ! so it is recorded your problem, I was going to answer, I was just preparing the xD R environment
– Isvaldo Fernandes