I have a RasterBrick and I am trying to add new layers to it, (with addLayer) but every time I try I receive the following message:
Error in sapply(x, fromDisk) & sapply(x, inMemory) : operations are possible only for numeric, logical or complex types
The brick and the layers have the same crs, res, and extent, and I reprojected the brick to match the layers.
Is there anything else that might be keeping the two from merging?
The only thing I can think of is that the brick is stored on disk and the layer is stored on memory- but would that actually effect anything?
readAll
on the stack to bring it into memory (useinMemory
to check) does it work?y
. Are you trying to dox = addLayer(x, y)
? See how important it is to show your code?addLayers
might be better, or it might not even be needed - you can dostack(a,b,c)
and get the same effect I think...