allocate: allocate function

Description Usage Arguments Value

Description

A function to allocate coordinates to an observation whose spatial location is known to the regional level

Usage

1
allocate(poly, popden, survdat, pid, sid, n = 2, wid = 2000)

Arguments

poly

a SpatialPolygonsDataFrame, on which the survival data exist in aggregate form

popden

a sub-polygon raster image of population density

survdat

data.frame containing the survival data

pid

name of the variable in the survival data that gives the region identifier in poly

sid

the name of the variable in poly to match the region identifier in survdat to

n

the number of different allocations to make. e.g. if n is 2 (the default) two candidate sets of locations are available.

wid

The default is 2000, interpreted in metres ie 2Km. size of buffer to add to window for raster cropping purposes: this ensures that for each polygon, the cropped raster covers it completely.

Value

matrices x and y, both of size (number of observations in survdat x n) giving n potential candidate locations of points in the columns of x and y.


bentaylor1/spatsurv documentation built on May 12, 2019, 3:02 p.m.