emojifont
is an implementation of using emoji font in both base and
'ggplot2' graphics. emojifont
is released on
CRAN and the source
code is hosted on GitHub.
Guangchuang Yu, School of Public Health, The University of Hong Kong.
To install emojifont
, start R and enter:
install.packages("emojifont")
require(remoji)
set.seed(123)
x <- rnorm(10)
set.seed(321)
y <- rnorm(10)
plot(x, y, cex=0)
text(x, y, labels=emoji('cow'), cex=1.5, col='steelblue', family='OpenSansEmoji')
dd=data.frame(x=emoji(c("satisfied", "disapointed")), y=c(50, 10))
emoji_text=element_text(family="OpenSansEmoji", size=20)
ggplot(dd, aes(x, y)) + geom_bar(stat='identity', aes(fill=x)) +
ggtitle(paste(emoji(c("+1", "-1")), collapse=" "))+
theme(axis.text.x = emoji_text, legend.text=emoji_text, title=emoji_text) +
xlab(NULL)+ylab(NULL)
Please refer to https://yulab-smu.github.io/treedata-book/chapter8.html#phylomoji.
Found out more on https://cran.r-project.org/web/packages/emojifont/vignettes/emojifont.html.
(function() { // Don't ever inject Disqus on localhost--it creates unwanted // discussions from 'localhost:1313' on your Disqus account... // if (window.location.hostname == "localhost") // return; var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; var disqus_shortname = 'gcyu'; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); Please enable JavaScript to view the comments powered by Disqus.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.