create.pgrid
creates a grid of locations from the boundaries of domain and other information.create.pgrid(xmin, xmax, ymin, ymax, nx, ny, midpoints = FALSE,
poly.coords = NULL)
TRUE
or FALSE
) indicating whether the boundary values are for the midpoint of a pixel (midpoints = TRUE
) or for the boundary of the spatial domain in general (midpoints = FALSE
), in whicxmin
, xmax
, ymin
, and ymax
. If this is propgrid
with the following components:poly.coords
. If poly.coords
is not provided, this is a vector of 1s.TRUE
, it is assumed that the boundaries of the spatial domain correspond to the midpoints of the cell/pixel in the grid. Otherwise, it is assumed that the boundaries correspond to the actual borders of the region of interest. If poly.coords
is supplied, the grid returned is the grid of midpoints contained in the convex hull of poly.coords
.pgrida <- create.pgrid(0, 1, 0, 1, nx = 50, ny = 50, midpoints = FALSE)
pgridb <- create.pgrid(.01, .99, .01, .99, nx = 50, ny = 50, midpoints = TRUE)
Run the code above in your browser using DataLab