Emojis in ggplot graphics
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
R user David Lawrence Miller has created an extension for R's ggplot2 package that allows you to use emojis as plotting symbols. The emoGG package (currently only available on github) adds the geom_emoji geom to ggplot2, which uses an emoji code to identify the plotting symbol. For example:
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_emoji(emoji=”1f337″)
(You can look up emoji symbol codes using the emoji_search function.) The package is still in its early days and has some rough edges: legends aren't yet supported, and as you can see in the chart above varying emoji color by a data variable doesn't work. You can, however, create charts including multiple emojis, as in this chart of the mtcars dataset using different symbols for manual and automatic transmission cars:
You can find more information about the emoGG package, including details on how to install it, at its github repository linked below.
github (dill): emoGG
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.