SDALGCPUniformPoint: SDALGCPUniformPoint function

Description Usage Arguments Details Value Author(s) Examples

View source: R/dm_functions.R

Description

This function generate a random point pattern using a uniform sampling or completely spatial random sampling. An internal function for SDALGCP package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SDALGCPUniformPoint(
  poly,
  delta,
  weighted = FALSE,
  pop_shp = NULL,
  lambdamax = NULL,
  pop = NULL,
  n = NULL,
  rho = NULL,
  giveup = NULL,
  bound = NULL
)

Arguments

poly

polygon in which to generate the points

delta

distance between points

weighted

To specify if you want to use the population density, default to FALSE, i.e population density is not used.

pop_shp

Optional, The raster of population density map for population weighted approach

lambdamax

the maximum value of the population density in the polygon

pop

the population density.

n

optional; the number of points to create in the polygon, if not supplied, it is computed as n = rho*|A|*4/(π*delta^2)

rho

Optional, The packing density, default set to 0.55

giveup

Number of rejected proposals after which the algorithm should terminate.

bound

Spatial object; the boundary of the polygon

Details

This algorithm generates points inside the polygon using a uniform sampling or completely spatial random sampling.

Value

It returns a list of the coordinates of the points created in each polygon.

Author(s)

Olatunji O. Johnson o.johnson@lancaster.ac.uk

Emanuele Giorgi e.giorgi@lancaster.ac.uk

Peter J. Diggle p.diggle@lancaster.ac.uk

Examples

1
2
3
4
5
6
data(PBCshp)
require(sp)  #load sp package
poly <- PBCshp@polygons[[1]]@Polygons[[1]]@coords
#create a spatialpolygons object
bound <- SpatialPolygons(list(Polygons(list(Polygon(poly)), "x")))
point <- SDALGCPUniformPoint(poly=poly, delta=100, n=1, bound = bound)

olatunjijohnson/SDALGCP documentation built on March 20, 2021, 4:24 a.m.