试图对推特数据进行一些分析。下载了推文并使用以下内容从推文的文本中创建了一个语料库
# Creating a Corpus
wim_corpus = Corpus(VectorSource(wimbledon_text))
在尝试如下创建 TermDocumentMatrix 时,我收到错误和警告。
tdm = TermDocumentMatrix(wim_corpus,
control = list(removePunctuation = TRUE,
stopwords = TRUE,
removeNumbers = TRUE, tolower = TRUE))
Error in simple_triplet_matrix(i = i, j = j, v = as.numeric(v), nrow = length(allTerms), : 'i, j, v' different lengths
In addition: Warning messages:
1: In parallel::mclapply(x, termFreq, control) :
all scheduled cores encountered errors in user code
2: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
3: In TermDocumentMatrix.VCorpus(corpus) : invalid document identifiers
4: In simple_triplet_matrix(i = i, j = j, v = as.numeric(v), nrow = length(allTerms), :
NAs introduced by coercion
谁能指出这个错误表示什么?这可能与 tm 包有关吗?
tm 库已导入。我正在使用 R 版本:R 3.0.1 和 RStudio:0.97