View source: R/MakeWordCloud.R
MakeWordCloud | R Documentation |
Create a word cloud from a frequency table of words, and save to a PNG file. Visualizations are created using the ‘wordcloud2.js’ JavaScript library.
MakeWordCloud( x, max_words = 200L, size = 1, shape = "circle", ellipticity = 0.65, ..., width = 910L, output = NULL, display = FALSE )
x |
'data.frame'.
A frequency table of words that includes |
max_words |
'integer' number. Maximum number of words to include in the word cloud. |
size |
'numeric' number. Font size, where the larger size indicates a bigger word. |
shape |
'character' string.
Shape of the “cloud” to draw.
Possible shapes include a |
ellipticity |
'numeric' number. Degree of “flatness” of the shape to draw, a value between 0 and 1. |
... |
Additional arguments to be passed to the
|
width |
'integer' number. Desired image width in pixels. |
output |
'character' string. Path to the output file, by default the word cloud is copied to a temporary file. |
display |
'logical' flag. Whether to display the saved PNG file in a graphics window. Requires access to the png package. |
The webshot package requires the external program PhantomJS,
which may be installed using the webshot::install_phantomjs()
command.
To recompress the PNG file to a smaller size requires that the external program
OptiPNG is accessible through a command window.
The word cloud plots in PNG format, and the path of the output file is returned.
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
## Not run: MakeWordCloud(wordcloud2::demoFreq, size = 1.5, display = TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.