The only sources supported by commonality.cloud
(just like wordclouds) are the sources of the Hershey family, which has the main advantage that each character is described as a set of points (are the vector sources), and rendering this character means joining these points with a line. With this, we avoid the size problem (as it is vector there is no pixelization effect) and when plotting a rotated character the appearance is better.
The following typefaces and fontindex are supported:
typeface: 'Serif' | fontindex: {'Plain', 'Italic', 'Bold', 'Bold Italic', 'cyrillic', 'oblique cyrillic', 'EUC'}
typeface: 'sans Serif' | fontindex: {'Plain', 'Italic', 'Bold', 'Bold Italic'}
typeface: 'script' | fontindex: {'Plain', 'Italic', 'Bold'}
typeface: 'Gothic English' | fontindex: {'Plain'}
typeface: 'Gothic German' | fontindex: {'Plain'}
typeface: 'Gothic Italian' | fontindex: {'Plain'}
typeface: 'Serif Symbol' | fontindex: {'Plain', 'Italic', 'Bold'}
typeface: 'sans Serif Symbol' | fontindex: {'Plain', 'Italic'}
Example:
library(tm)
library(wordcloud)
data(SOTU)
corp <- SOTU
term.matrix <- TermDocumentMatrix(corp)
term.matrix <- as.matrix(term.matrix)
commonality.cloud(term.matrix,
colors = "black",
scale= c(32,4) ,
random.order=FALSE,
vfont=c("sans serif","plain"))
For more information, ?Hershey
Amazing reply. Thank you very much!
– João Dias