getBASSampleDriver: Manage BAS sampling.

View source: R/BAS.R

getBASSampleDriverR Documentation

Manage BAS sampling.

Description

This function repeatedly calls function spbal::getBASSample to generate the BAS sample. Once the requested number of points within the intersection of the shapefile and the study area have been obtained, the sample and seeds are returned to the caller.

Usage

getBASSampleDriver(shapefile, bb, n, seeds, verbose = FALSE)

Arguments

shapefile

sf shape file as a polygon to select sites from.

bb

Bounding box which defines the area around the study area. A bounding box must be supplied.

n

Number of sites to select. If using stratification it is a named vector containing sample sizes of each group.

seeds

A vector of 2 seeds, u1 and u2. If not specified, the default is NULL and will be defined randomly.

verbose

Boolean if you want to see any output printed to screen. Helpful if taking a long time. Default is FALSE i.e. no informational messages are displayed.

Value

A list containing two variables, $sample containing locations in the BAS sample, in BAS order and $seeds, the u1 and u2 seeds used to generate the sample.

Author(s)

This function was written by Phil Davies based on origin code by Paul van Dam-Bates from the BASMasterSample package.


spbal documentation built on April 4, 2025, 2:05 a.m.