Hi,
I am trying to create an binary mask and use it to create a ppp object and
to be able to compute a density surface. I have failed in defining the owin
as a mask. Please read code below:

####Definition of the window as matrix: from raster to image and from image
image to matrix
sudan1 <-readGDAL("sudanbndry1")
im.sudan <- as.im(sudan1)
Vsudan <- im.sudan$v
Wsudan <- levelset(Vsudan,21,"==")
matrix.sudan <- as.matrix(Wsudan)

###Points pattern###

sudan98 <- read.csv("sudan98.txt")
sudan98sa <- ppp(sudan98$Longitude, sudan98$Latitude,
owin(mask=matrix.sudan,xrange,yrange))

Error in owin(...) :
  If one of xrange, yrange is specified then both must be.

Your feedback are welcome, thanks.
Jose Funes
IFPRI
Washington, DC

	[[alternative HTML version deleted]]

