Description Usage Arguments Examples
Make a word cloud.
1 2 3 4 |
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. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.