shape2Frame: Clip a Halton Frame based on the bounding box to the current...

View source: R/HaltonFunctions.r

shape2FrameR Documentation

Clip a Halton Frame based on the bounding box to the current shape.

Description

Take a shapefile as a sf object and clips boxes from a Halton frame around it. Size of those boxes is chosen by choosing J, the number of base 2,3 powers to subdivide. Intended for internal use but can be useful in other context.

Usage

shape2Frame(
  shp,
  bb = NULL,
  base = c(2, 3),
  J = c(2, 2),
  projstring = NULL,
  rotate = FALSE
)

Arguments

shp

shape as spatial features object to wrap into Halton frame.

bb

Master Sample bounding box.

base

Co-prime base for BAS, do not change from 2,3.

J

Definition for the number of grid cells of Halton frame.

projstring

Projection that the master sample is in, can be passed as part of the bounding box.

rotate

Boolean if you want to rotate shape before exporting.

Value

rotated sf spatial object.

Examples

## Not run: 
bb <- getBB()
data(NS_bioregion)
haltonBoxes <- shape2Frame(shp = NS_biogregion, J = c(6,4), bb = bb)

## End(Not run)

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