Library "tm" Error Corpus.Default()

Hi guys,

Please, Im trying to build a corpus and a wordcloud. My data comes from a csv with 36000 answers (qualitative). Could you please help me to understand the following error:

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
Installing package into �C:/Users/felipe.vaz/Documents/R/win-library/3.6�
(as �lib� is unspecified)
tentando a URL ''
Content type 'application/zip' length 1370539 bytes (1.3 MB)
downloaded 1.3 MB

package ‘tm’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in

Carregando pacotes exigidos: NLP

Attaching package: �tm�

The following objects are masked from �package:quanteda�:

as.DocumentTermMatrix, stopwords

Data <- read.csv2("Dados_2.csv", stringsAsFactors = FALSE)
Data_bag <- paste(Data$Resposta.Quali, collapse = " ")
Data_source <- VectorSource(Data_bag)
Corpus <- corpus(Data_source)
Error in corpus.default(Data_source) :
corpus() only works on character, corpus, Corpus, data.frame, kwic objects.


mycorpus <- VCorpus(x = VectorSource( Data_bag) ),
                     readerControl = list(reader=readPlain,

Thank you, does not work...

"Error: ',' unexpected in "mycorpus <- VCorpus (x = VectorSource (Data_bag)),""

Ok. I had a typo, as I'm on mobile the 2nd bracket close after databag should be delete. Because the brackets need to pair up, right?
Sorry about the confusion.

WOW, works niceeeee dudeee....thx

but, to understand, could you please tell me what it does?

Turned your vector of character/text into a Volatile Corpus.
It's a bit dry but the documentation is here: › tm
Introduction to the tm Package Text Mining in R - CRAN - R Project

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.