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

rescue.rectangle

Convert Window Back To Rectangle


Description

Determines whether the given window is really a rectangle aligned with the coordinate axes, and if so, converts it to a rectangle object.

Usage

rescue.rectangle(W)

Arguments

W

A window (object of class "owin").

Details

This function decides whether the window W is actually a rectangle aligned with the coordinate axes. This will be true if W is

  • a rectangle (window object of type "rectangle");

  • a polygon (window object of type "polygonal" with a single polygonal boundary) that is a rectangle aligned with the coordinate axes;

  • a binary mask (window object of type "mask") in which all the pixel entries are TRUE.

If so, the function returns this rectangle, a window object of type "rectangle". If not, the function returns W.

Value

Another object of class "owin" representing the same window.

Author(s)

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

See Also

Examples

w <- owin(poly=list(x=c(0,1,1,0),y=c(0,0,1,1)))
  rw <- rescue.rectangle(w)

  w <- as.mask(unit.square())
  rw <- rescue.rectangle(w)

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.