ggwordcloud (version 0.5.0)

ggwordcloud2: wordcloud2 approximate replacement

Description

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.

Usage

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, ...)

Value

a ggplot

Arguments

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

Examples

Run this code
set.seed(42)
data("love_words_small")

ggwordcloud2(love_words_small[,c("word", "speakers")])

Run the code above in your browser using DataLab