Skip to content

Instantly share code, notes, and snippets.

@cvitolo
Created October 4, 2019 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cvitolo/0d2a29fc77df8fcdfa68cd7e024f399a to your computer and use it in GitHub Desktop.
Save cvitolo/0d2a29fc77df8fcdfa68cd7e024f399a to your computer and use it in GitHub Desktop.
Thank you wordcloud
# devtools::install_github("lepennec/ggwordcloud")
library(ggwordcloud)
library(dplyr)
library(colorspace)
data("thankyou_words")
thankyou_words <- thankyou_words %>%
mutate(angle = 45 * sample(-2:2, n(), replace = TRUE,
prob = c(1, 1, 4, 1, 1)))
set.seed(0)
ggplot(
thankyou_words,
aes(
label = word, size = speakers,
color = factor(sample.int(10, nrow(thankyou_words), replace = TRUE)),
angle = angle
)
) +
geom_text_wordcloud_area() +
scale_size_area(max_size = 50) +
theme_minimal() +
scale_color_discrete_diverging(l2 = 50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment