raster.x {spatstat}R Documentation

Cartesian Coordinates for a Pixel Raster

Description

Return the x and y coordinates of each pixel in a binary pixel image.

Usage

 raster.x(w)
 raster.y(w)
 raster.xy(w)

Arguments

w

A window (an object of class "owin") of type "mask" representing a binary pixel image.

Details

The argument w should be a window (an object of class "owin", see owin.object for details). A window of type "mask" represents a binary pixel image.

The functions raster.x and raster.y return a matrix of the same dimensions as the binary pixel image itself, with entries giving the x coordinate (for raster.x) or y coordinate (for raster.y) of each pixel in the image.

The function raster.xy returns a list with components x and y which are numeric vectors of equal length containing the pixel coordinates.

Value

raster.x and raster.y return a matrix of the same dimensions as the pixel grid in w, and giving the value of the x (or y) coordinate of each pixel in the raster.

raster.xy returns a list with components x and y which are numeric vectors of equal length containing the pixel coordinates.

Author(s)

Adrian Baddeley Adrian.Baddeley@csiro.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz

See Also

owin, as.mask

Examples

  u <- owin(c(-1,1),c(-1,1)) # square of side 2
  w <- as.mask(u, eps=0.01) # 200 x 200 grid
  X <- raster.x(w)
  Y <- raster.y(w)
  disc <- owin(c(-1,1), c(-1,1), mask=(X^2 + Y^2 <= 1))
  ## Not run: plot(disc)
  # approximation to the unit disc

[Package spatstat version 1.25-3 Index]