Learn R Programming

spsurvey (version 4.0.0)

irsarea: Select an Independent Random Sample (IRS) of an Area Resource

Description

This function selects an IRS of an area resource.

Usage

irsarea(shapefilename = NULL, areaframe, samplesize = 100,
  SiteBegin = 1, maxtry = 1000)

Arguments

shapefilename

Name of the input shapefile. If shapefilename equals NULL, then the shapefile or shapefiles in the working directory are used. The default is NULL.

areaframe

Data frame containing id, mdcaty, area, and mdm.

samplesize

Number of points to select in the sample. The default is 100.

SiteBegin

First number to start siteID numbering. The default is 1.

maxtry

Maximum number of iterations for randomly generating a point within the frame to select a site when type.frame equals "area". The default is 1000.

Value

data frame of sample points containing: siteID, id, x, y, mdcaty, and weight.

Other Functions Required

getRecordIDs

C function to obtain the shapefile record IDs for records from which sample points will be selected

getShapeBox

C function to obtain the shapefile minimum and maximum values for the x and y coordinates

pointInPolygonFile

C function to determine the polygon IDs and the probability values associated with a set of point, where polygons are specified by a shapefile