View source: R/ggwordcloud-wrapper.R
ggwordcloud2 | R Documentation |
ggwordcloud2
is meant as an approximate replacement for
wordcloud2
. It has almost the same syntax but fewer
options. In particular, there is no background image (so far...). As the
underlying algorithms are not strictly equal, the resulting wordcloud is only
similar to the ones one can obtain with wordcloud2
.
ggwordcloud2(
data,
size = 1,
color = "random-dark",
minRotation = -pi/4,
maxRotation = pi/4,
shuffle = TRUE,
rotateRatio = 0.4,
shape = "circle",
ellipticity = 0.65,
figPath = NA,
...
)
data |
a dataframe whose two first columns are the names and the freqs or a table |
size |
scaling factor. Default to 1 |
color |
color scheme either "random-dark", "random-light" or a list of color of the size of the dataframe. Default to "random-dark" |
minRotation |
the minimal rotation angle |
maxRotation |
the maximal rotation angle |
shuffle |
if TRUE, the words are shuffled at the beginning |
rotateRatio |
the proportion of rotated words |
shape |
control the shape of the cloud |
ellipticity |
control the eccentricity of the wordcloud |
figPath |
path to an image used a mask |
... |
the remaining parameters are passed to geom_text_wordcloud |
a ggplot
set.seed(42)
data("love_words_latin_small")
ggwordcloud2(love_words_latin_small[,c("word", "speakers")])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.