Title: | Create Meme |
Version: | 0.2.3 |
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. |
Depends: | R (≥ 3.4.0) |
Imports: | ggplot2, graphics, grDevices, grid, gridGraphics, magick, methods, showtext, sysfonts, utils |
Suggests: | cowplot, ggimage, knitr, rmarkdown, prettydoc, shadowtext |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
ByteCompile: | true |
License: | Artistic-2.0 |
URL: | https://github.com/GuangchuangYu/meme/ |
BugReports: | https://github.com/GuangchuangYu/meme/issues |
RoxygenNote: | 7.1.1 |
NeedsCompilation: | no |
Packaged: | 2021-04-23 09:12:49 UTC; ygc |
Author: | Guangchuang Yu |
Maintainer: | Guangchuang Yu <guangchuangyu@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2021-04-23 10:00:02 UTC |
asp
Description
aspect ratio of meme
Usage
asp(x)
Arguments
x |
meme object |
Value
asp ratio
Author(s)
guangchuang yu
Examples
## Not run:
f <- system.file("icon.png", package="meme")
x <- meme(f, "meme", "produced by meme package")
asp(x)
## End(Not run)
font_pokemon
Description
load fonts
Usage
font_pokemon()
font_import(path = ".")
Arguments
path |
folder of fonts |
Author(s)
Guangchuang Yu
grid.echo.meme
Description
grid.echo method for meme object
Usage
## S3 method for class 'meme'
grid.echo(x = NULL, newpage = TRUE, prefix = NULL)
Arguments
x |
meme object |
newpage |
not use in this method |
prefix |
not use in this method |
Details
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.
Value
meme object
Author(s)
guangchuang yu
meme
Description
create meme
Usage
meme(
img,
upper = "",
lower = "",
size = "auto",
color = "white",
font = "Impact",
vjust = 0.05,
bgcolor = "black",
r = 0.2,
density = NULL
)
Arguments
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 |
Value
grob object
Author(s)
guangchuang yu
Examples
f <- system.file("angry8.jpg", package="meme")
meme(f, "code", "all the things!", font = "Helvetica")
memeGrob
Description
convert meme to grob object
Usage
memeGrob(x)
Arguments
x |
meme object |
Value
grob object
Author(s)
guangchuang yu
Examples
f <- system.file("angry8.jpg", package="meme")
x <- meme(f, "code", "all the things!")
memeGrob(x)
meme_save
Description
save meme plot
Usage
meme_save(x, file, width = NULL, height = NULL, ...)
Arguments
x |
meme output |
file |
output file |
width |
width of graph |
height |
height of graph |
... |
additional arguments for ggsave |
Author(s)
guangchuang yu
Examples
f <- system.file("angry8.jpg", package="meme")
x <- meme(f, "code", "all the things!")
outfile <- tempfile(fileext = ".png")
meme_save(x, outfile)
mm_caption
Description
add caption layer for meme
Usage
mm_caption(upper = NULL, lower = NULL, ...)
Arguments
upper |
upper caption |
lower |
lower caption |
... |
additional parameters to set caption |
Value
meme object
Author(s)
guangchuang yu
mmplot
Description
plot the image for meme (captions to be added)
Usage
mmplot(x)
Arguments
x |
image file |
Value
meme object
Author(s)
guangchuang yu
print method for meme object
Description
print method for meme object
Usage
## 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,
...
)
Arguments
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 |
Examples
f <- system.file("angry8.jpg", package="meme")
x <- meme(f, "code", "all the things!", font = "Helvetica")
print(x)
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.