Learn R Programming

⚠️There's a newer version (0.6.2) of this package.Take me there.

ggwordcloud

ggwordcloud provides a wordcloud text geom for ggplot2. The placement algorithm implemented in C++ is close to the one used in wordcloud2.js and thus aims to be a replacement of wordcloud2 that produces ggplot2 type plot instead of an html widget. Note that the current version does not provide the shape and mask possibility of wordcloud2. The algorithm of wordcloud is similar but ggwordcloud allows arbitrary rotations of the words.

Installation

You can install the released version of ggwordcloud from CRAN with:

install.packages("ggwordcloud")

or the development version from the github repository

devtools::install_github("lepennec/ggwordcloud")

A simple wordcloud example

As an example, we will use the mtcars dataset

library(ggwordcloud)
#> Loading required package: ggplot2
dat <- mtcars
dat$name <- row.names(mtcars)
dat$size <- dat$mpg
dat$size[c(1,4)] <- dat$size[c(1,4)] + 100
set.seed(42)
ggplot(data = dat, aes(label = name, size = size)) + geom_text_wordcloud() +
  theme_minimal()

More examples are available in the vignette.

Copy Link

Version

Install

install.packages('ggwordcloud')

Monthly Downloads

5,880

Version

0.2.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Erwan Le Pennec

Last Published

October 7th, 2018

Functions in ggwordcloud (0.2.0)

ggwordcloud-package

ggwordcloud
geom_text_wordcloud

wordcloud text geom
ggwordcloud

wordcloud approximate replacement
ggwordcloud2

wordcloud2 approximate replacement