Hello,
I'm very new to R, and I'm trying to load multiple images in R and extract the RGB values of each image (as matrix). I managed to do it for single image at a time, but I need to do it for multiple images at once.
I tried the below code but it only saves the RGB matrices of the last image in the folder.
Can someone help me find a way to keep the values of all images?
Thank you!
filenames <- list.files(path="/Users/danah........")
for(i in filenames){
filepath <- file.path("/Users/dana..........", paste(i))
im <- load.image(filepath)
Red <- im[,,1]
Green <- im[,,2]
Blue <- im[,,3]
}
For the list approach, I think it might be a good idea but it keeps giving me an error message saying file not found (attached). I'm not sure what the issue is.