4

So i am importing a number of images in a training and then in a test list... then i am resizing them to 100x100 so they dont take too many spaces... after resizing i wanted to combine everything so that i will end up with 4 dimensions in the end. The testing images combined perfectly but the training images keep showing up this error i mentioned in the question: error in (function (classes fdef mtable) unable to find an inherited method for function combine for signature "list" "list"... and i am doing the exact same thing for testing... dont know why this is happening... any help?? also R session aborts after this error because error during wrap comes up in a loop

#importing all training images in a list
setwd("C:/Users/Joanne/OneDrive/Third Year/Thesis Stuff/Sets/TrainingColourSet")
colourImages <- list.files(pattern = "*.jpeg")
Images <- list()
for (i in 1:length(colourImages)) {
  Images[[i]] <- readImage(colourImages[[i]])
}

#importing all testing images in a list
setwd("C:/Users/Joanne/OneDrive/Third Year/Thesis Stuff/Sets/TestingColourSet")
colourtestingImages <- list.files(pattern = "*.jpeg")
TestingImages <- list()
for (i in 1:length(colourtestingImages)) {
  TestingImages[[i]] <- readImage(colourtestingImages[[i]])
}

#Structure and Combine
str(Images)
for(i in 1:1120) {
  Images[[i]] <-resize(Images[[i]],100,100)
}
Images <- combine(Images)

str(TestingImages)
for(i in 1:351) {
  TestingImages[[i]] <-resize(TestingImages[[i]],100,100)
}
TestingImages <- combine(TestingImages)
Joanne Fsadni
  • 103
  • 1
  • 8

0 Answers0