as.rectangle(w, ...)
"owin"
),
a pixel image (object of class "im"
)
or other data determining such a window.w
does not belong to a recognised class,
the arguments w
and ...
are passed to as.owin
to determ"owin"
)
of type "rectangle"
representing a rectangle. 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 bounding.box
to compute the smallest
bounding rectangle of a dataset.
owin
,
as.owin
,
bounding.box
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)
Run the code above in your browser using DataLab