Created
November 14, 2017 08:58
-
-
Save iUmarov/56bae6d20d1a0a831d0b671b0422a4e2 to your computer and use it in GitHub Desktop.
Cartoon animation R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install.packages("animation") | |
# install.packages("jpeg") ## if necessary | |
library(animation) | |
library(jpeg) | |
ani.options(interval = 0.5) | |
for(i in 1:8){ | |
img <- paste("~/Documents/R/photo_", i, ".jpg", sep="") | |
img <- readJPEG(img , native = TRUE) | |
plot.new() | |
rect(0, 0, 1, 1, col = "white") | |
rasterImage(img, 0, 0, 1, 1) | |
ani.pause() | |
} | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment