# Problem with [,,,1]

#### BeaLena

##### New Member
Hi everybody,
I have some problems with this operator []
I have this code:
for (file in files) {
+ }
Error in mask3D * (!is.na(img)) : non-conformable arrays
> dim(!is.na(img))
[1] 64 64 18
> for (file in files) {
+ }
Error in mask3D * (!is.na(img)) : non-conformable arrays
> dim(!is.na(img))
1] 64 64 19 1

The mask has dimension 64 64 19, what I need to do for having my img of the same dimensions?

#### JesperHP

##### TS Contributor
It looks weird you need to make a reproducible example because the above behavior is not standard as shown by

Code:
A=array(NA,dim=c(12,12,13,1))
dim(A[,,,1])
so I'm thinking something else is going on in code not shown which may originate in the loop structure which implies reference to several files not necessarily resulting in matching dimensions in all cases

#### BeaLena

##### New Member
Solved!
Thanks anyway.
Yes, it wasn't a code problem, but a problem in my images