我正在寻找应用世界云功能,但根据另一列更改字体类型格式。
我的想法是,我希望根据“状态”列提供单词的字体类型(斜体,简单,粗体)
df=read.table(text="name freq year status
paris 5 2010 OK
nyc 25 2010 OK
tokyo 10 2011 NOT
rome 9 2011 NOT",
header=TRUE)
font_vector = c(1,3)
wordcloud(words = df$name, freq = df$freq, min.freq = 1,scale = c(5, 2), font = font_vector[factor(df$status)] ,
max.words=200, random.order=FALSE, rot.per=0.1,
ordered.colors=TRUE,
colors=brewer.pal(8, "Dark2")[factor(df$year)] )
问题在于,不是将两个城市(巴黎和纽约)用斜体和其他两个(东京和罗马)平原,一切都转移到斜体。任何人有任何想法?感谢