How to add emoji in ggplot2 title?

You need to use the Unicode codepoint for the emoji you want - for example, a smiley face is Unicode 1F600. So you can put a smiley face in a plot like so:

library(ggplot2)
library(magrittr)

mtcars %>% 
    ggplot(aes(x = disp, y = cyl)) + 
    geom_jitter() + 
    labs(
        title = '\U1F600' # Smiley face is Unicode U+1F600
    )

2 Likes