I want to make a wordcloud separated by grouping of autor variable and I did it:
# Create a dataframe that save freq of each word
tw <- tw_token %>% count(autor, word, sort=TRUE)
# head of data
dput(head(tw))
structure(list(autor = c("Mayoredlee", "Mayoredlee", "Elonmusk",
"Mayoredlee", "Mayoredlee", "Elonmusk"), word = c("sf", "city",
"tesla", "residents", "housing", "model"), n = c(775L, 320L,
263L, 260L, 180L, 163L)), row.names = c(NA, 6L), class = "data.frame")
# Make wordcloud
wordcloud(words = tw$word, freq = tw$n, min.freq = 1,
max.words=200, random.order=FALSE, rot.per=0.45,
colors=brewer.pal(8, "Dark2"))