library(spatstat)
owin() # the unit square
data(demopat)
W <- demopat$window
W # just says it is polygonal
as.mask(W) # just says it is a binary image
Run the code above in your browser using DataCamp Workspace