Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leeper/meme
Meme Generation in R
https://github.com/leeper/meme
Last synced: 17 days ago
JSON representation
Meme Generation in R
- Host: GitHub
- URL: https://github.com/leeper/meme
- Owner: leeper
- Created: 2014-06-15T14:04:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-25T20:34:57.000Z (over 9 years ago)
- Last Synced: 2024-10-13T19:09:26.605Z (about 1 month ago)
- Language: R
- Size: 529 KB
- Stars: 122
- Watchers: 7
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
# Meme Generation in R
[![Build Status](https://travis-ci.org/leeper/meme.png?branch=master)](https://travis-ci.org/leeper/meme)
According to [Wikipedia](http://en.wikipedia.org/wiki/Internet_meme):
>An Internet meme (/'mi?m/ meem) is an activity, concept, catchphrase or piece of media which spreads, often as mimicry, from person to person via the Internet.
**meme** is an R package that connects with several online image generators to create internet memes, which can then be loaded into R, plotted, and saved locally.
## Installation ##
At some point **meme** will be [available on CRAN](http://cran.r-project.org/web/packages/meme/index.html) and installed from within R from your favorite CRAN mirror:
```
install.packages("meme")
```The latest development version, available here, can be installed directly using Hadley Wickham's [devtools](http://cran.r-project.org/web/packages/devtools/index.html) package:
```
if(!require("devtools")) install.packages("devtools")
library("devtools")
install_github("leeper/meme")
```## Examples ##
Here are some simple examples using the package and the default [memecaptain](http://memecaptain.com/) generator. To get started, you can grab some image templates from one of the meme generator sites. We'll use memecaptain because it doesn't require a username and password.
```{r templates}
library("meme")
templates <- get_templates("memecaptain")
```You can use the `plot.meme_template` method to plot all templates from a given site to help you figure out which one you want to use. Here's some code to do it:
```
par( mfrow = n2mfrow(length(templates)), mar=rep(0,4), mgp=rep(0,3))
invisible(lapply(templates, plot))
```Here are some example memes. These could probably be better, so pull requests are welcome!
```{r allthethings, fig.width=5, fig.height=5, fig.path='inst/figures/'}
plot(allthethings <- create_meme(templates[[2]], "Code", "all the things!"))
``````{r simply, fig.width=6, fig.height=5, fig.path='inst/figures/'}
plot(simply <- create_meme(templates[[10]], "One does not simply", "reshape data from wide to long"))
``````{r yuno, fig.width=5, fig.height=5, fig.path='inst/figures/'}
plot(yuno <- create_meme(templates[[55]], "R CMD check", "y u no work?"))
``````{r grumpy, fig.width=5, fig.height=7, fig.path='inst/figures/'}
u <- "http://img4.wikia.nocookie.net/__cb20131009153844/villains/images/f/f6/Grumpy_Cat.jpg"
plot(grumpy <- create_meme(u, "", "R-help"))
```