point2Frame: Get the Halton Boxes around a point resource ordered by BAS...

View source: R/MasterSample.r

point2FrameR Documentation

Get the Halton Boxes around a point resource ordered by BAS Master Sample. If you pass discrete points to this function it will return how the Halton frame is represented and what the ordering is.

Description

Get the Halton Boxes around a point resource ordered by BAS Master Sample. If you pass discrete points to this function it will return how the Halton frame is represented and what the ordering is.

Usage

point2Frame(pts, bb = NULL, base = c(2, 3), J = NULL, size = 100)

Arguments

pts

Shape file as a polygon (sp or sf) to generate the boxes for.

bb

Bounding box which defines the Master Sample. Default is BC Marine Master Sample.

base

Co-prime base of Halton sequence

J

Definition for the number of grid cells of Halton frame.

size

Physical target size of Halton boxes (square ish) if J is NULL.

Examples

## Not run: 
library(bcmaps)
# If you haven't already installed this:
install.packages('bcmapsdata', repos='https://bcgov.github.io/drat/')
library(bcmapsdata)
cities <- get_layer("bc_cities")
bb <- buildMS(hydro, d = 2, FALSE)
# For visibility will make boxes 10 km
cities.halton <- point2Frame(pts = cities, bb = bb, size = 10000)
plot(st_geometry(cities), pch = 20, cex = 0.1)
plot(st_geometry(cities.halton), add= TRUE)
#What is the actual area of a Halton box?
st_area(cities.halton[1,])/1000^2

## End(Not run)

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