Take Complement of a Window
Take the set complement of a window, within its enclosing rectangle or in a larger rectangle.
- an object of class
"owin"describing a window of observation for a point pattern.
- Optional. The enclosing rectangle, with respect to which the set complement is taken.
This yields a window object (of class
owin.object) representing the set complement
w with respect to the rectangle
frame is the enclosing box of
(originally specified by the arguments
w was created).
frame is specified, it must be a rectangle (an object of
"owin" whose type is
"rectangle") and it must be
larger than the enclosing box of
w. This rectangle becomes the
enclosing box for the resulting window.
w is a rectangle, then
frame must be specified.
Otherwise an error will occur (since the complement of
itself is empty).
For rectangular and polygonal windows, the complement is computed by reversing the sign of each boundary polygon, while for binary masks it is computed by negating the pixel values.
- Another object of class
"owin"representing the complement of the window, i.e. the inside of the window becomes the outside.
# rectangular a <- owin(c(0,1),c(0,1)) b <- owin(c(-1,2),c(-1,2)) bmina <- complement.owin(a, frame=b) # polygonal data(demopat) w <- demopat$window outside <- complement.owin(w) # mask w <- as.mask(demopat$window) outside <- complement.owin(w)