I'm using the 'tm' R package to perform analysis on a small dataset of tweets. The data is in a csv file, containing some metadata and the tweet itself, like so:
2461,1425999216,RT @victoriavaneyk: Bitcoin is being used by African migrant workers to send money home #Bitcoin http://t.co/z0Lkm2ncUw,2.9690174302789387
I read the file into a data frame and attempt to build a corpus from it:
data <- read.csv(file, header=TRUE)
corpus <- Corpus(DataframeSource(data))
The dataframe appears to contain exactly what I would expect, including the text of the tweet. But when I inspect the corpus, it appears that all of the text has been replaced by some integer value. Where is this integer coming from? Why is the text of the tweet missing?
> inspect(corpus[1])
<<VCorpus (documents: 1, metadata (corpus/indexed): 0/0)>>
[[1]]
<<PlainTextDocument (metadata: 7)>>
2461
1425999216
2940
2.96901743027894
data <- read.csv(file, header=TRUE, stringsAsFactors=FALSE)- MrFlick