Próba wykonania analizy danych Twittera. Pobrano tweety i stworzyła corpus z tekstu tweets przy użyciu poniżejAnaliza danych na Twitterze - błąd w macierzy dokumentów terminowych
# Creating a Corpus
wim_corpus = Corpus(VectorSource(wimbledon_text))
Próbując stworzyć TermDocumentMatrix jak poniżej, otrzymuję błąd i ostrzeżeń.
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
Czy ktoś może wskazać, co ten błąd wskazuje? Czy może to być związane z pakietem tm?
Biblioteka tm została zaimportowana. Używam wersji R: R 3.0.1 i RStudio: 0.97
Czy można odtworzyć ten błąd za pomocą małego pliku tekstowego (jakiś plik, który można udostępnić)? –