Window: Extract or Change the Window of a Spatial Object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/window.R

Description

Given a spatial object (such as a point pattern or pixel image) in two dimensions, these functions extract or change the window in which the object is defined.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
   Window(X, ...)

   Window(X, ...) <- value

   ## S3 method for class 'ppp'
Window(X, ...)

   ## S3 replacement method for class 'ppp'
Window(X, ...) <- value

   ## S3 method for class 'psp'
Window(X, ...)

   ## S3 replacement method for class 'psp'
Window(X, ...) <- value

   ## S3 method for class 'im'
Window(X, ...)

   ## S3 replacement method for class 'im'
Window(X, ...) <- value

Arguments

X

A spatial object such as a point pattern, line segment pattern or pixel image.

...

Extra arguments. They are ignored by all the methods listed here.

value

Another window (object of class "owin") to be used as the window for X.

Details

The functions 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:

Many other classes of spatial object have a method for Window, but not Window<-. See Window.ppm.

Value

The result of Window is a window (object of class "owin").

The result of Window<- is the updated object X, of the same class as X.

Author(s)

\adrian \rolf

and \ege

See Also

Window.ppm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
   ## 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)

Example output

Loading required package: nlme
Loading required package: rpart

spatstat 1.52-1       (nickname: 'Apophenia') 
For an introduction to spatstat, type 'beginner' 


Note: spatstat version 1.52-1 is out of date by more than 3 months; we recommend upgrading to the latest version.
window: rectangle = [0, 1] x [0, 1] units
window: polygonal boundary
enclosing rectangle: [525, 10575] x [450, 7125] furlongs
window: rectangle = [0, 1] x [0, 1] units
window: binary image mask
257 x 257 pixel array (ny, nx)
enclosing rectangle: [-1, 1] x [-1, 1] units

spatstat documentation built on Jan. 10, 2019, 5:04 p.m.