spatstat (version 1.41-1)

square: Square Window

Description

Creates a square window

Usage

square(r=1)
 unit.square()

Arguments

r
Numeric. The side length of the square, or a vector giving the minimum and maximum coordinate values.

Value

  • An object of class "owin" (see owin.object) specifying a window.

Details

If r is a number, square(r) is a shortcut for creating a window object representing the square $[0,r] \times [0,r]$. It is equivalent to the command owin(c(0,r),c(0,r)).

If r is a vector of length 2, then square(r) creates the square with x and y coordinates ranging from r[1] to r[2]. unit.square creates the unit square $[0,1] \times [0,1]$. It is equivalent to square(1) or square() or owin(c(0,1),c(0,1)).

These commands are included mainly to improve the readability of some code.

See Also

owin.object, owin

Examples

Run this code
W <- square(10)
 W <- square(c(-1,1))

Run the code above in your browser using DataCamp Workspace