Skip to content
Prev 22329 / 29559 Next

spatstat error: owin & "im" object

See at end.
On 13/02/15 11:09, Silvia Cordero-Sancho wrote:

            
Nothing whatever to do with "tiff" images.  The crux of the problem is 
that in your toy example, W was a rectangle; in your "real" example, W 
was a polygon.

If X is an image and W is a window, then

    X[W]

is an image *only* when W is a rectangle.  If W is not a rectangle, then
you need to do

    X[W,drop=FALSE]

to get an image as the result.  (Otherwise you get a *vector* of the 
pixel values for pixels that fall inside W.)

This is all spelled out in the help file for "[.im" but the help is 
lengthy, the possibilities are manifold and the issue is complex, so you 
would have to read the help file *very* carefully to figure this out.

I hope that the situation is clear now.

cheers,

Rolf Turner