Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.rectangle

Window Frame


Description

Extract the window frame of a window or other spatial dataset

Usage

as.rectangle(w, ...)

Arguments

w

A window, or a dataset that has a window. Either a window (object of class "owin"), a pixel image (object of class "im") or other data determining such a window.

...

Optional. Auxiliary data to help determine the window. If w does not belong to a recognised class, the arguments w and ... are passed to as.owin to determine the window.

Details

This function is the quickest way to determine a bounding rectangle for a spatial dataset.

If w is a window, the function just extracts the outer bounding rectangle of w as given by its elements xrange,yrange.

The function can also be applied to any spatial dataset that has a window: for example, a point pattern (object of class "ppp") or a line segment pattern (object of class "psp"). The bounding rectangle of the window of the dataset is extracted.

Use the function boundingbox to compute the smallest bounding rectangle of a dataset.

Value

A window (object of class "owin") of type "rectangle" representing a rectangle.

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Examples

w <- owin(c(0,10),c(0,10), poly=list(x=c(1,2,3,2,1), y=c(2,3,4,6,7)))
  r <- as.rectangle(w)
  # returns a 10 x 10 rectangle

  data(lansing)
  as.rectangle(lansing)

  data(copper)
  as.rectangle(copper$SouthLines)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.