library(BiocStyle)
library(HPAanalyze)
library(dplyr)

1 The case

What to do if you want to systematically download images from HPA?

2 The solution

2.2 Download the images

dir.create("img")
for (i in 1:nrow(CCNB1_expr[[1]])) {
    download.file(CCNB1_expr[[1]]$imageUrl[i],
                  destfile = paste0("img/", CCNB1_ab$id[1], "_",
                                    CCNB1_expr[[1]]$patientId[i], "_",
                                    CCNB1_expr[[1]]$tissueDescription2[i], 
                                    ".jpg"),
                  mode = "wb")
}