Learn R Programming

R package spbal.

A package to encapsulate a number of spatially balanced sampling algorithms, namely, BAS (equal, unequal, seed point, panels), Halton frames (for discretizing a continuous resource), HIP (equal probability) and Simple Random Sampling (SRS).

Copy Link

Version

Install

install.packages('spbal')

Monthly Downloads

143

Version

1.0.1

License

MIT + file LICENSE

Maintainer

Phil Davies

Last Published

March 28th, 2025

Functions in spbal (1.0.1)

cppBASpts

Generate numbers from a Halton Sequence.
contains_feature

Check if the sf object contains a specified feature.
BAS

Balanced Acceptance Sampling (BAS).
BoundingBox

Create a bounding box for a study region.
ValidatePanelDesign

Validate the panels and panel_overlap parameters.
HaltonFrame

Create a Halton Frame.
HaltonFrameBase

Generate a Halton Frame.
PanelDesignAssignPanelids

Assign panel ids to the samples.
filterOnDistance

Filter sample using a minimum distance.
findBASSeed

Randomly generates a point in the study region and maps it to the Halton Sequence.
findFirstStudyRegionPoint

Get a randomly chosen Halton point from within the study area and the associated seeds.
findRandomHaltonIndex

Randomly generates a point in the study region and maps it to the Halton Sequence.
generateUVector

Generate a vector of two random seeds.
hipX2split

Second dimension split.
getBASSample

Generate the BAS sample.
getHaltonPointsFromExpandableGrid

Generate a Halton frame.
getPanel

Extract all points with a specified panel id from a sample.
is_sf_points

Check if an object is an sf points object.
cppBASptsIndexed

Generate numbers from a Halton Sequence along a specified set of indices.
validate_parameters

Validate spbal function parameters.
getBASSampleDriver

Manage BAS sampling.
getHaltonFrame

Obtain a Halton Frame over a shapefile.
getSample

Extract a sample of a specified size from a master sample.
cppRSHalton_br

Generate numbers from a Halton Sequence with a random start
log_a_to_base_b

Compute the log of a to base b.
mod

Vector modulus.
hipPartition

Partition the population.
hipIndexRandomPermutation

Permute Halton indices.
hipX1split

First dimension split.
rotate.scale.coords

Scale and rotate points from the unit square to a defined projection.
removeDuplicates

Remove duplicate values from a NumericVector.
setBASIndex

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

Generate a rotation matrix for rotating objects later.
SRS

Simple random sampling.
HIP

Halton Iterative Partitioning (HIP).