Site icon R-bloggers

Font Awesome supported in emojifont

[This article was first published on R on Guangchuang Yu, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

emoji is available in CRAN, you can use the following command to install it.

install.packages("emoji")

An example of using emoji in R plot is showed below:

More example can be found in the post and online vignette.

I found FontAwesome is quite interesting especially in technical world. In emoji (version >= 0.3), I have packed the Font Awesome. So that we can use this fancy in both base and ggplot2 graphics.

load.awesome()

set.seed(2016-03-09)
fa <- awesome(c('fa-github', 'fa-weibo', 'fa-twitter', 'fa-android', 'fa-coffee'))
d <- data.frame(x=rnorm(20), 
                y=rnorm(20), 
                label=sample(fa, 20, replace=T))

ggplot(d, aes(x, y, color=label)) + 
    geom_text(aes(label=label), family='awesome-web')+
    xlab(NULL)+ylab(NULL)

Have fun with emoji.

@drob and @guangchuangyu, this is data surfing (air quality data from Lima, Peru) / fun with your cool pkgs. Thx! pic.twitter.com/ikinjxDDZL

— Maëlle Salmon (@ma_salmon) March 6, 2016

To leave a comment for the author, please follow the link and comment on their blog: R on Guangchuang Yu.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.