Learn R Programming

SDALGCP (version 0.4.0)

SDALGCPRegularPoint: SDALGCPRegularPoint function

Description

This function generate a random point pattern using a regular (systematically aligned) sampling. An internal function for SDALGCP package.

Usage

SDALGCPRegularPoint(
  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/(\pi*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

Value

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

Details

This algorithm generates points inside the polygon using a regular (systematically aligned) sampling.

Examples

Run this code
# NOT RUN {
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 <- SDALGCPRegularPoint(poly=poly, delta=100, n=1, bound = bound)
# }

Run the code above in your browser using DataLab