plot_wordcloud: plot_wordcloud

View source: R/plot_wordcloud.R

plot_wordcloudR Documentation

plot_wordcloud

Description

Make a custom wordcloud plot.

Usage

plot_wordcloud(
  x,
  output = "./wordcloud.png",
  scale = c(4, 0.5),
  width = 12,
  height = 7,
  units = "in",
  res = 150,
  fixed.asp = FALSE,
  removePunctuation = TRUE,
  removeNumbers = TRUE,
  stripWhitespace = TRUE,
  colors = brand_cols()
)

Arguments

x

Vector of sentences or words.

output

Output path.

scale

A vector of length 2 indicating the range of the size of the words.

res

The nominal resolution in ppi which will be recorded in the bitmap file, if a positive integer. Also used for units other than the default. If not specified, taken as 72 ppi to set the size of text and line widths.

fixed.asp

if TRUE, the aspect ratio is fixed. Variable aspect ratio only supported if rot.per==0

removePunctuation

Remove punctuation. Default: TRUE.

removeNumbers

Remove numbers. Default: TRUE.

stripWhitespace

Remove whitespace. Default: TRUE.

colors

Colors to use in wordcloud.

Examples

# Create a vector of month names
x <- c()
for (i in 1:12) {
 x <- append(x, rep(month.name[i], i * 2))
}
plot_wordcloud(x, "./wordcloud.png")

JouniVatanen/Jmisc documentation built on Feb. 3, 2023, 12:28 a.m.