if (interactive()) {
### example taken from
### http://www.news.com.au/technology/environment/nasa-images-reveal-
### aral-sea-is-shrinking-before-our-eyes/story-e6frflp0-1227074133835
library(jpeg)
library(terra)
web_img2000 <- "http://cdn.newsapi.com.au/image/v1/68565a36c0fccb1bc43c09d96e8fb029"
jpg2000 <- readJPEG(readBin(web_img2000, "raw", 1e6))
img2000 <- rast(jpg2000)
web_img2013 <- "http://cdn.newsapi.com.au/image/v1/5707499d769db4b8ec76e8df61933f2a"
jpg2013 <- readJPEG(readBin(web_img2013, "raw", 1e6))
img2013 <- rast(jpg2013)
slideView(img2000, img2013, label1 = "before", label2 = "after", legend = FALSE)
## adjust layout of the info slider
slideView(
img2000
, img2013
, sliderInfoCSS = list(
"background-color" = "#00ffff"
, "color" = "#ff00ff"
, opacity = 0.8
, "font-size" = "30px"
, "font-family" = "courier"
)
, legend = FALSE
)
}
Run the code above in your browser using DataLab