setBASIndex: Finds a set of Halton indices that will create BAS points...

View source: R/BAS.R

setBASIndexR Documentation

Finds a set of Halton indices that will create BAS points within a shape bounding box.

Description

This function is designed to be called internally for efficiency in site selection.

Usage

setBASIndex(shapefile, bb, seeds = base::c(0, 0))

Arguments

shapefile

Shape file as a polygon (sp or sf) to select sites for.

bb

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

seeds

A vector of 2 seeds, u1 and u2. seeds must have a value when this function is called.

Details

To be used when doing a Master Sample and the bounding box of the greater frame is potentially much larger than the the polygon being sampled. In this case, we don't want to generate points across the entire larger bounding box region and then clip them. Instead, we can make use of the Halton sequence and only generate BAS points near to the shape being sampled. This function finds returns those indices.

Value

A list containing two variables, $boxes containing indices of the BAS sample that fall into the bounding box, $J, the number of subdivision powers taken to find those boxes, $B, the number of boxes that the indices relate to (1-B), $xlim, the ylimit of the bounding box of the shapefile, shifted to the base[1]^J[1] coordinates on the unit box [0,1), $ylim, the ylimit of the bounding box of the shapefile, shifted to the base[2]^J[2] coordinates on the unit box [0,1).


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