Is it possible to highlight single words within a word cloud using 'wordcloud' or 'wordcloud2'? Does one have to add another column to the data frame as ordering factor?
I couldn't find any simple solution.
Here's what I've done:
wordcloud(text_process$words[1:n.words],
text_process$frequency[1:n.words],
scale = c(18, 0.5),
colors = c("#666666", "#3E6AA0") [factor(text_process$matches[1:n.words])],
use.r.layout = FALSE,
rot.per = 0.2,
random.order = FALSE, ordered.colors=TRUE)
I had to introduce a criterion (called 'matches') in the data frame 'text_process' that indicates the color. I was wondering whether there's a simpler way of highlighting specific words...