Lchiffon / wordcloud2

R interface to wordcloud for data visualization.
397 stars 113 forks source link

Does it support cyrillics? #19

Closed Mohylaprepods closed 7 years ago

Mohylaprepods commented 7 years ago

I have texts in UTF-8, but it seems that your package doesn't "see" other characters than latin:

docs <- c("текст один", "текст два")
docs <- enc2utf8(docs)
corp <- VCorpus(VectorSource(docs))
tdm <- TermDocumentMatrix(corp)
m = as.matrix(tdm)
wordcloud2(data = m, gridSize=15, ellipticity=2)
Lchiffon commented 7 years ago

make a data.frame with first column as words and second column as frequence:

docs <- c("текст один", "текст два")
docs <- enc2utf8(docs)
corp <- VCorpus(VectorSource(docs))
tdm <- TermDocumentMatrix(corp)
m = as.matrix(tdm)
dat = data.frame(rownames(m), rowSums(m))
wordcloud2(data = dat, gridSize=15, ellipticity=2)
Mohylaprepods commented 7 years ago

Nice! Thank you!