special note for windows users
For windows users, you need to register your font before using it in R graphics (see discussion here).
if (.Platform$OS.type == "windows") {
windowsFonts(
Impact = windowsFont("Impact"),
Courier = windowsFont("Courier")
) }
meme
Call meme
to add meme captions:
library(meme)
<- system.file("angry8.jpg", package="meme")
u meme(u, "code", "all the things!")
The grammar of meme
Not that useful, just to mimic ggplot2
:
mmplot(u) + mm_caption("calm down", "and RTFM",
color="purple")
meme_save
: a meme version of ggsave
The meme
output can be saved as an object, and can be exported to file using meme_save
. meme_save
helps user setting up the output figure aspect ratio and calls ggsave
to export the figure:
<- system.file("success.jpg", package="meme")
u2 <- meme(u2, "please", "tell me more") x
<- tempfile(fileext=".png")
outfile meme_save(x, file=outfile)
plot
method
Users can plot
the meme
output and change the caption or other parameters in real time.
plot(x, size = 2, "happy friday!", "wait, sorry, it's monday", color = "firebrick", font = "Courier")