I am trying to display emojis as a facet wrap label. However, while the emoji is correctly saved in the dataset, ggplot incorrectly displays the emoji (see example picture below). I have seen emoji's displayed as axis labels however, facet wrap seems to not work.
This post has the same problem but the solution does not work: Unicode in ggplot facet_wrap (en_US.UTF-8 locale)
Here is the minimal reproducible code along with the output I get:
facets <- sprintf(c('✓', emoji("smile")))
set.seed(123)
my_df <- data.frame(x = runif(40), y = runif(40),
z = rep(facets, each=20),
stringsAsFactors = F)
ggplot(my_df, aes(x, y, color=z)) + geom_point() +
facet_wrap(~z) +
theme(legend.position = 'none')