First time using R so probably something trivial but I can\'t figure out why I am getting this error. It happens in the first iteration of the for loop at img[cell_columns,cell_