wordcloud: Make a word cloud.

Description Usage Arguments Examples

View source: R/wordcloud.R

Description

Make a word cloud.

Usage

1
2
3
4
wordcloud(model_object = NULL, words = NULL, freq = NULL,
  coefficients = NULL, colors = "black", scale = c(4, 0.5),
  min_freq = 3, max_words = Inf, random_order = FALSE,
  random_color = FALSE, rot_per = 0, bg_color = "#FFFFFF")

Arguments

model_object

lm. A linear model object. If this is passed, words, freq, and coefficients can be derived and do not need to be passed.

words

character. A vector of words to plot.

freq

numeric. The frequency of those words.

coefficients

numeric. If provided, colors will be assigned according to coefficients.

colors

character. The colors to use for plotting.

scale

numeric. The range of sizes.

min_freq

numeric. Words with less frequency than this will not be plotted.

max_words

numeric. Don't plot more words than this amount.

random_order

logical. Should words be plotted in a random_order or by frequency (default FALSE)?

random_color

logical. Allocate words a color by random? (default FALSE).

rot_per

numeric. Amount of rotation to apply to each word, between 0 and 1. Defaults to 0 (no rotation).

bg_color

character. The color of the background.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  data(iris)
  model <- lm(Petal.Width ~ Species, iris)
  library(modelwordcloud)
  colors <- c("red", "orange", "blue")
  wordcloud(model, colors = colors)
  words_and_freqs <- rle(as.character(iris$Species))
  freqs <- words_and_freqs$lengths
  words <- words_and_freqs$values
  coefficients <- model$coefficients
  wordcloud(words = words, freq = freqs, coefficients = coefficients, colors = colors)

Example output



modelwordcloud documentation built on May 1, 2019, 9:09 p.m.