Suppose I scrape 4 image files from website using httr
and rvest
, how can I open (not download) the files in a 2x2 matrixes? For example, using the example from this post
I have:
library(rvest); library(dplyr)
url <- "http://www.calacademy.org/explore-science/new-discoveries-an-alaskan-butterfly-a-spider-physicist-and-more"
webpage <- html_session(url)
link.titles <- webpage %>% html_nodes("img")
img.url <- link.titles[13] %>% html_attr("src")
download.file(img.url, "test.jpg", mode = "wb")
But instead of 1 image, I have 4 images and instead of downloading the file, I want to open the images in a 2x2 matrix, like:
Edited for comment:
What do you mean by open is displaying the images without creating a temporary intermediary file. This is because there will be thousands of images and I am trying not to overwhelm the computer. What do you mean by display the images is displaying them as a plot.