[R] How do you transform a dataframe to a corpus?

arun smartpink111 at yahoo.com
Fri Jan 10 17:32:13 CET 2014


HI,
I couldn't reproduce the error.

complaints <- data.frame(text=c("Do your homework", "Provide reproducible example","Read the R-help manual"))
library(tm)
myCorpus <- Corpus(VectorSource(as.character(complaints$text)))
myCorpus
#A corpus with 3 text documents
A.K.



On Friday, January 10, 2014 10:57 AM, ramoss <ramine.mossadegh at finra.org> wrote:
Hi;

I have a data frame complains w/ dimensions 1133529    1 ( 1.13m obs 1 col)&
I am trying to transform it into a corpus
using the following code: myCorpus <-Corpus(VectorSource(complaints$text))
Error in .Source(readPlain, encoding, length(x), FALSE, names(x), 0, TRUE, 
: 
  vectorized sources must have positive length
Does anybody understand the error message?


Thanks



--
View this message in context: http://r.789695.n4.nabble.com/How-do-you-transform-a-dataframe-to-a-corpus-tp4683396.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.





More information about the R-help mailing list