# install quickcode if not available # install.packages(quickcode) # load quickcode library library(quickcode) #clean() #clear the environment # let's load the r2resize to provide toolbars for the image resizing library(r2resize) add.resizer(line.color = "brown", line.height = "3", default.image.width = "30%")
For this example, we will download 3 random png images from the web in the category of 'school' to a temp directory and then display it. The r2resize package provides the image resizer that lets us view the images nicely below.
storlocation <- tempdir() genRandImg(fp = storlocation, n = 3, cat = "school", ext = "png") getdownloadedfiles = list.files(path = storlocation, pattern = ".png", full.names = TRUE)
Display the images:
r paste0("")
r paste0("")
r paste0("")
For this example, we will download 6 random jpg images from the web in the category of 'school' to a temp directory and then display it.
storlocation2 <- tempdir() genRandImg(fp = storlocation2, n = 6, cat = "animals", ext = "jpg") getdownloadedfiles = list.files(path = storlocation2, pattern = ".jpg", full.names = TRUE)
Display the images:
r paste0("")
r paste0("")
r paste0("")
r paste0("")
r paste0("")
r paste0("")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.