The title is super self explanatory: I want to change the font (text type, bold) of the wordcloud package in R.
You can change the size from the Words tab and the font for individual words.
If you include par(mar = rep(0, 4)) as a separate line immediately after the call to png you'll remove the margins, and the wordcloud will use all the available space. With this, and possibly tweaking the res parameter as suggested in the previous answer, you should get what you wanted.
A wordcloud (or tag cloud) is a visual representation of text data. Tags are usually single words, and the importance of each tag is shown with font size or color. In R , two packages allow to create wordclouds: Wordcloud and Wordcloud2 . Wordcloud2.
Use the family
and font
arguments:
library(wordcloud)
set.seed(1)
par(mfrow = c(1,2))
wordcloud(c(letters, LETTERS, 0:9), seq(1, 1000, len = 62), family = "serif", font = 3)
wordcloud(c(letters, LETTERS, 0:9), seq(1, 1000, len = 62), family = "mono", font = 2)
See ?par
under font
and family
for details. The extrafont
package gives more options. You find many examples on SO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With