Hello,
as stated in the title all the pictures i download with the download.file
- function are heavily fragmented.
For reference the code i am using:
am <- read.xlsx(file.choose())
am$id <- str_extract(am$id, "\\d+")
am <- am[!is.na(am$id), ]
# am[apply(am, 1, function(x) sum(is.na(x)))>=9, ]
library("foreach")
foreach(i = 1:nrow(am)) %do% {
print(i)
urls <- str_split(am$image_url[i], "/")
download.file(am$image_url[i],
destfile = paste0(path3,quiet=T, str_extract_all(urls, "\\d+")[[1]][1], ".jpg"))
}
Even if I only use the download.file
-function for one picture it comes out fragmented.
And here how the picture look like vs how they should: (Imgur Link)
Doe anyone know the solution to my problem?
Thanks in advance and i'm more than happy to provide further information if needed