nTry > 1, to reduce the risk of ending up in an unfavorable local optimum. Better results will generally be obtained by increasing the ratio nGridCells/nStrata and by increasing nTry.## S3 method for class 'SpatialPixels':
stratify(object, nStrata, priorPoints = NULL, maxIterations = 1000, nTry = 1,
equalArea = FALSE, verbose = getOption("verbose"))
## S3 method for class 'SpatialGrid':
stratify(object, nStrata, priorPoints = NULL, maxIterations = 1000, nTry = 1,
equalArea = FALSE, verbose = getOption("verbose"))
## S3 method for class 'SpatialPolygons':
stratify(object, nStrata, priorPoints = NULL, maxIterations = 1000, nTry = 1,
nGridCells = 2500, cellSize, equalArea = FALSE, verbose = getOption("verbose"))"SpatialPixels ", "SpatialGrid " or "SpatialPolygons "nStrata >= 1)."SpatialPoints ", containing the prior (i.e., existing) pointsstratify method will try nTry initial configurations and will keep the best solution in order to reduce the risk of ending up with an unfavorable solution.object is an instance of class "SpatialPolygons ", the approximate number of grid cells to be used for discretizing the vector map in object.object is an instance of class "SpatialPolygons ", the cell size to be used for discretizing the vector map in object. Note that cellsize takes precedence over argument FALSE the algorithm results in compact strata. If TRUE, the algorithm results in compact strata of equal size.TRUE, progress information and intermediate results will be printed to the output device.spsample for sampling, and estimate for inference.# read a vector representation of the `Farmsum' field (by means of rgdal-package)
shpFarmsum <- readOGR(dsn = system.file("maps", package = "spcosa"), layer = "farmsum")
# stratify `Farmsum' into 50 strata
myStratification <- stratify(shpFarmsum, nStrata = 50)
# plot the resulting stratification
plot(myStratification)Run the code above in your browser using DataLab