Learn R Programming

briskaR (version 1.0.4)

simulateInitialPartition: simulateInitialPartition Method

Description

This function creates an object SpatialPolygonsDataFrame and simulates a landscape with neutral and source fields.

Usage

simulateInitialPartition(
  n = 500,
  prop = 0.4,
  range = 10,
  xmin = 0,
  xmax = 5000,
  ymin = 0,
  ymax = 5000
)

Arguments

n

Numeric, numbers of cells

prop

Numeric [0,1] toxic cells proportion

range

Aggregation parameter (range of the spatial Exponential covariance of Gaussian process)

xmin

x-axis left coordinates in space unit (see projections_briskaR)

xmax

x-axis right coordinates in space unit (see projections_briskaR)

ymin

y-axis bottom coordinates in space unit (see projections_briskaR)

ymax

y-axis top coordinates in space unit (see projections_briskaR)

Value

An SpatialPolygonsDataFrame object with n fields, prop pourcentage of toxic fields of size (xmin,xmax) (ymin,ymax)

Details

In the function the first step is a binomial point process to simulate a SpatialPointsDataFrame with sources and neutral marks, which depends on the aggregation parameter. The second step of the function is the Voronoi tesselation from the simulated points and returns a SpatialPolygonsDataFrame.

Examples

Run this code
# NOT RUN {
# Simulate a 5000m x 5000m landscape with 500 cells (e.g. fields)
# whose 40% (200 cells) are sources.
# The projection by default is Lambert93 projection.
land <- simulateInitialPartition(n=500,prop=0.4,range=10,xmin=0,xmax=5000,ymin=0,ymax=5000)
plot(land)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab