Title: | Create Meme |
---|---|
Description: | The word 'Meme' was originated from the book, 'The Selfish Gene', authored by Richard Dawkins (1976). It is a unit of culture that is passed from one generation to another and correlates to the gene, the unit of physical heredity. The internet memes are captioned photos that are intended to be funny, ridiculous. Memes behave like infectious viruses and travel from person to person quickly through social media. The 'meme' package allows users to make custom memes. |
Authors: | Guangchuang Yu [aut, cre] |
Maintainer: | Guangchuang Yu <[email protected]> |
License: | Artistic-2.0 |
Version: | 0.2.3 |
Built: | 2024-10-26 03:10:13 UTC |
Source: | https://github.com/guangchuangyu/meme |
aspect ratio of meme
asp(x)
asp(x)
x |
meme object |
asp ratio
guangchuang yu
## Not run: f <- system.file("icon.png", package="meme") x <- meme(f, "meme", "produced by meme package") asp(x) ## End(Not run)
## Not run: f <- system.file("icon.png", package="meme") x <- meme(f, "meme", "produced by meme package") asp(x) ## End(Not run)
load fonts
font_pokemon() font_import(path = ".")
font_pokemon() font_import(path = ".")
path |
folder of fonts |
Guangchuang Yu
grid.echo method for meme object
## S3 method for class 'meme' grid.echo(x = NULL, newpage = TRUE, prefix = NULL)
## S3 method for class 'meme' grid.echo(x = NULL, newpage = TRUE, prefix = NULL)
x |
meme object |
newpage |
not use in this method |
prefix |
not use in this method |
using the solution <https://stackoverflow.com/a/18551959/3844636> to not importing grid.echo generics from gridGraphics for easy installation, since gridGraphics has system requirement of ImageMagick <https://github.com/cran/gridGraphics/blob/master/DESCRIPTION#L14>.
this method is just a hack for making cowplot to support meme object, and not used elsewhere.
meme object
guangchuang yu
create meme
meme( img, upper = "", lower = "", size = "auto", color = "white", font = "Impact", vjust = 0.05, bgcolor = "black", r = 0.2, density = NULL )
meme( img, upper = "", lower = "", size = "auto", color = "white", font = "Impact", vjust = 0.05, bgcolor = "black", r = 0.2, density = NULL )
img |
path or url |
upper |
upper text |
lower |
lower text |
size |
size of text |
color |
color of text |
font |
font family of text |
vjust |
vertical adjustment of captions |
bgcolor |
background color of shadow text |
r |
ratio of shadow text |
density |
resolution to render pdf or svg |
grob object
guangchuang yu
f <- system.file("angry8.jpg", package="meme") meme(f, "code", "all the things!", font = "Helvetica")
f <- system.file("angry8.jpg", package="meme") meme(f, "code", "all the things!", font = "Helvetica")
save meme plot
meme_save(x, file, width = NULL, height = NULL, ...)
meme_save(x, file, width = NULL, height = NULL, ...)
x |
meme output |
file |
output file |
width |
width of graph |
height |
height of graph |
... |
additional arguments for ggsave |
guangchuang yu
f <- system.file("angry8.jpg", package="meme") x <- meme(f, "code", "all the things!") outfile <- tempfile(fileext = ".png") meme_save(x, outfile)
f <- system.file("angry8.jpg", package="meme") x <- meme(f, "code", "all the things!") outfile <- tempfile(fileext = ".png") meme_save(x, outfile)
convert meme to grob object
memeGrob(x)
memeGrob(x)
x |
meme object |
grob object
guangchuang yu
f <- system.file("angry8.jpg", package="meme") x <- meme(f, "code", "all the things!") memeGrob(x)
f <- system.file("angry8.jpg", package="meme") x <- meme(f, "code", "all the things!") memeGrob(x)
plot the image for meme (captions to be added)
mmplot(x)
mmplot(x)
x |
image file |
meme object
guangchuang yu
print method for meme object
## S3 method for class 'meme' print( x, size = NULL, color = NULL, font = NULL, upper = NULL, lower = NULL, vjust = NULL, bgcolor = NULL, r = NULL, newpage = is.null(vp), vp = NULL, newdev = FALSE, ... ) ## S3 method for class 'meme' plot( x, size = NULL, color = NULL, font = NULL, upper = NULL, lower = NULL, vjust = NULL, bgcolor = NULL, r = NULL, newpage = is.null(vp), vp = NULL, newdev = FALSE, ... )
## S3 method for class 'meme' print( x, size = NULL, color = NULL, font = NULL, upper = NULL, lower = NULL, vjust = NULL, bgcolor = NULL, r = NULL, newpage = is.null(vp), vp = NULL, newdev = FALSE, ... ) ## S3 method for class 'meme' plot( x, size = NULL, color = NULL, font = NULL, upper = NULL, lower = NULL, vjust = NULL, bgcolor = NULL, r = NULL, newpage = is.null(vp), vp = NULL, newdev = FALSE, ... )
x |
meme object |
size |
size of text |
color |
color of text |
font |
font family of text |
upper |
upper text |
lower |
lower text |
vjust |
vertical adjustment ratio |
bgcolor |
background color of shadow text |
r |
ratio for shadow text |
newpage |
draw new (empty) page first? |
vp |
viewport to draw plot in |
newdev |
open new graphic device? |
... |
other arguments not used by this method |
f <- system.file("angry8.jpg", package="meme") x <- meme(f, "code", "all the things!", font = "Helvetica") print(x)
f <- system.file("angry8.jpg", package="meme") x <- meme(f, "code", "all the things!", font = "Helvetica") print(x)