The argument w should be either
  a pixel image (object of class "im")
  or a mask window (an object of class
  "owin" of type "mask").
If drop=FALSE (the default), the 
  functions raster.x and raster.y return
  a matrix of the same dimensions as the
  pixel image or mask itself, with entries giving the \(x\) coordinate
  (for raster.x) or \(y\) coordinate (for raster.y)
  of each pixel in the pixel grid.
If drop=TRUE, pixels that lie outside the
  window w (or outside the domain of the image w)
  are removed, and raster.x and raster.y 
  return numeric vectors containing the coordinates of the
  pixels that are inside the window w.
The function raster.xy returns a list
  with components x and y
  which are numeric vectors of equal length containing the pixel coordinates.