buildMS: Build a new Master Sample with a random rotation and seed.

View source: R/defintions.r

buildMSR Documentation

Build a new Master Sample with a random rotation and seed.

Description

Randomly generate a seed from 10,000 possible values in right now 2 dimensions. Note that in van Dam-Bates et al. (2018) we required that the random seed falls into main object shape, such as one of the islands in New Zealand, or within marine environment for BC west coast. However, with a random rotation, we are able to ignore that detail. If this function is used without a random rotation, we recommend running it until the first master sample point does indeed fall within the largest scale of the master sample use.

Usage

buildMS(shp, d = 2, showOutput = TRUE, rotate = TRUE)

Arguments

shp

Spatial feature that defines the boundary of the area to define a bounding box over.

d

Dimension of the new Master Sample, at this stage we only work with d=2.

showOutput

Print the rotation and random seed when it is generated.

rotate

Boolean of whether or not to randomly rotate the bounding box.

Value

bounding box for a master sample.

Examples

## Not run: 
data(NS_bioregion)
bb <- buildMS(shp = NS_bioregion)         # Vertically aligned master sample bounding box.
bb.rot <- rotate.shp(bb, bb, back = TRUE) # Actual bounding box.
plot(st_geometry(NS_bioregion))
plot(st_geometry(bb.rot), add = TRUE)

## End(Not run)

paul-vdb/DFO-master-sample documentation built on April 5, 2022, 4:35 p.m.