虽然尚且学艺不精,步步缓行,但此心恒在。借他人技艺,表我心意。

require(emojifont)
require(ggplot2)
require(magick)
require(purrr)

x <- search_emoji("heart")

plot_heart=function(x) {
 p = ggplot() + geom_emoji(x, color = "red") +theme_bw()
 o = paste0(x, ".png")
 ggsave(o, p, width=5, height=5)
 o
 }

x %>% map(plot_heart) %>% 
map(image_read) %>% 
image_join() %>% 
image_animate(fps=1) %>% 
image_write("heart.gif")

521,周丹

感谢Y叔及推文