This function select a GRTS sample of a finite resource. This function uses hierarchical randomization to ensure that the sample will include no more than one point per cell and then picks a point in selected cells.
grtspts(src.frame = "shapefile", shapefilename = NULL, ptsframe,
samplesize = 100, SiteBegin = 1, shift.grid = TRUE,
do.sample = TRUE, startlev = NULL, maxlev = 11)
Source of the frame, which equals "shapefile" if the frame is to be read from a shapefile, or "att.frame" if the frame is included in ptsframe. The default is "shapefile".
Name of the input shapefile. If src.frame equals "shapefile" and shapefilename equals NULL, then the shapefile or shapefiles in the working directory are used. The default is NULL.
Data frame containing id, x, y, mdcaty, and mdm.
Number of points to select in the sample. The default is 100.
First number to start siteID numbering. The default is 1.
Option to randomly shift the hierarchical grid. The default is TRUE.
Option to select a sample, where TRUE means select a sample and FALSE means return the entire sample frame in reverse hierarchical order. The default is TRUE.
Initial number of hierarchical levels to use for the GRTS grid, which must be less than or equal to maxlev (if maxlev is specified) and cannot be greater than 11. The default is NULL.
Maximum number of hierarchical levels to use for the GRTS grid, which cannot be greater than 11. The default is 11.
Data frame of sample points containing: siteID, id, x, y, mdcaty, and weight.
numLevels
C function to determine the number of levels for hierarchical randomization
cell.wt
calculates total inclusion probability for a cell
constructAddr
C function to construct the hierarchical address for all points
ranho
C function to construct the randomized hierarchical address for all points
pickGridCells
C function to select grid cells that get a sample point
selectpts
pick sample point(s) from selected cells