Window(X, ...) Window(X, ...) <- value
## S3 method for class 'ppp':
Window(X, \dots)
## S3 method for class 'ppp':
Window(X, \dots) <- value
## S3 method for class 'psp':
Window(X, \dots)
## S3 method for class 'psp':
Window(X, \dots) <- value
## S3 method for class 'im':
Window(X, \dots)
## S3 method for class 'im':
Window(X, \dots) <- value
"owin"
) to be used as the
window for X
.Window
is a window (object of class
"owin"
). The result of Window<-
is the updated object X
,
of the same class as X
.
Window
and Window<-
are generic. Window(X)
extracts the spatial window in which X
is
defined.
Window(X) <- W
changes the window in which X
is defined
to the new window W
, and discards any data outside W
.
In particular:
X
is a point pattern (object of class"ppp"
)
thenWindow(X) <- W
discards any points ofX
which
fall outsideW
.X
is a line segment pattern (object of class"psp"
) thenWindow(X) <- W
clips the segments ofX
to the boundaries ofW
.X
is a pixel image (object of class"im"
)
thenWindow(X) <- W
has the effect that pixels
lying outsideW
are retained but their pixel values
are set toNA
. Many other classes of spatial object have a method
for Window
, but not Window<-
.
See Window.ppm
.
Window.ppm
## point patterns
Window(cells)
X <- demopat
Window(X)
Window(X) <- as.rectangle(Window(X))
## line segment patterns
X <- psp(runif(10), runif(10), runif(10), runif(10), window=owin())
Window(X)
Window(X) <- square(0.5)
## images
Z <- setcov(owin())
Window(Z)
Window(Z) <- square(0.5)
Run the code above in your browser using DataLab