Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dill/emoGG

:chart_with_upwards_trend::heart_eyes_cat: Emoji in ggplot2 :heart_eyes_cat::chart_with_upwards_trend:
https://github.com/dill/emoGG

Last synced: 20 days ago
JSON representation

:chart_with_upwards_trend::heart_eyes_cat: Emoji in ggplot2 :heart_eyes_cat::chart_with_upwards_trend:

Awesome Lists containing this project

README

        

---
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "figure/",
fig.height = 1
)
```

# emoGG(plot)

Use emoji in your `ggplot2` plots.

This is silly.

## Installation

```r
devtools::install_github("dill/emoGG")
```

## Usage

```{r, load-package}
library(ggplot2)
library(emoGG)
```

First need to find an emoji, using the `emoji_search` function. First look for a tulip:

```{r find-tulip}
emoji_search("tulip")
```

The `iris` example with **real** irises (well, tulips...)

```{r iris_ex, fig.height=4, fig.width=4}
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_emoji(emoji="1f337")
```

What about plotting `mtcars` with **real** cars?

```{r mtcars, fig.height=4, fig.width=4}
ggplot(mtcars, aes(wt, mpg))+ geom_emoji(emoji="1f697")
```

Want to map `emoji` as an aesethetic? [Check out this gist](https://gist.github.com/dill/28bb04fc35b51326f01b23d078f5021e)!

Some random cats?

```{r, catplotlib, fig.height=4, fig.width=4}
posx <- runif(50, 0, 10)
posy <- runif(50, 0, 10)
ggplot(data.frame(x = posx, y = posy), aes(x, y)) + geom_emoji(emoji="1f63b")
```

We can also just put a big emoji in the background:

```{r big-emoji, fig.height=4, fig.width=4}
qplot(x=Sepal.Length, y=Sepal.Width, data=iris, geom="point") + add_emoji(emoji="1f337")
```

## Acknowledgements

Emoji lookup is from @muan's [`emojilib`](https://github.com/muan/emojilib).

Emoji are loaded from a CDN using Twitter's [`twemoji`](https://github.com/twitter/twemoji), which is [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) licensed. You can get attribution details [on the project page](https://github.com/twitter/twemoji#attribution-requirements).

With apologies, DLM.