Description Usage Arguments Details Value Author(s) References See Also Examples
Create a meme from a template image
1 2 3 |
template |
Either an object of class “meme_template” (returned by |
upper |
The text to display at the top of the meme image. |
lower |
The text to display at the bottom of the meme image. |
username |
A username for the relevant meme site. Note: For memegenerator, username and password are passed as plain text, so use at your own risk. |
password |
A password for the relevant meme site. Note: For memegenerator, username and password are passed as plain text, so use at your own risk. |
site |
The site used to generate the meme. This is set by default if |
font |
If |
language |
If |
... |
Additional arguments to |
This function creates a meme image from a template image and specified text. If template
is an object of class “meme_template”, create_meme
automatically determines the site to use for generating the meme. If template
is simply an arbitrary image URL (specified as a character string), the meme image is generated using memecaptain. The resulting list of objects are of class “meme”, which has an associated S3 print
method that will display the template image as a margin-free JPEG plot in the current graphics device.
To create images with either imgflip or memegenerator, a username and password must be supplied. Important note: For memegenerator, username and password are passed as plain text, so use at your own risk.
An object of class “meme”, which includes a binary representation of the resulting meme image.
Thomas J. Leeper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
# use imgflip
t1 <- get_templates("imgflip")
m1 <- create_meme(t1[[1]], "Upper text", "Lower text", "username", "password")
plot(m1)
# use memegenerator
t2 <- get_templates("memegenerator")
m2 <- create_meme(t2[[1]], "Upper text", "Lower text", "username", "password")
plot(m2)
# use memecaptain
t3 <- get_templates("memecaptain")
m3 <- create_meme(t3[[1]], "Upper text", "Lower text")
plot(m3)
# use memecaptain with arbitrary image URL
u <- ""
m4 <- create_meme(u, "Upper text", "Lower text")
plot(m4)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.