hip.point: hip.point - Halton Iterative Partition (HIP) of point...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/hip.point.r

Description

Draws a Halton Iterative Partition (HIP) sample from a SpatialPoints* object.

Usage

1
hip.point(x, n, J = NULL, plot.lattice = FALSE)

Arguments

x

A SpatialPoints or SpatialPointsDataFrame object representing the 2-dimensional point resource from which samples are taken. This object must contain at least 1 point.

n

Sample size. The number locations to draw from the set of points contained in x. If the sample size returned is less than the desired sample size, increase n until the desired sample size is reached.

J

A 2X1 vector of base powers. J[1] is for horizontal, J[2] for vertical dimension. J determines the size and shape of the smallest Halton boxes. There are bases[1]^J[1] vertical columns of Halton boxes over x's bounding box, and bases[2]^J[2] horizontal rows of Halton boxes over the bounding box, for a total of prod(bases^J) boxes. The dimension of each box is c(dx,dy)/ (bases^J), where c(dx,dy) are the horizontal and vertical extents of x's bounding box. If J=NULL (the default), J is chosen so that Halton boxes are as square as possible.

plot.lattice

Boolean. If TRUE, plots the sample drawn with corresponding halton lattice.

Details

A brief description of Halton Iterative Partition (HIP) sampling for points: Given a set of Halton Iterative Partition parameters x (SpatialPoints* object) and n (sample size), a lattice of Halton boxes is constructed iteratively over the bounding box of x. This results in enough Halton boxes on the bounding box to uniquely cover the point resource. That is, one and only one point per box. The Halton index (the inverse of the Halton sequence) of all boxes is computed and assigned to points that lie in each box. Finally, a random number between 0 and the largest Halton index is drawn, and the next n points associated with the next n Halton boxes are taken as the sample, wrapping to the beginning if necessary.

Value

A SpatialPoints objects containing locations in the HIP sample, in HIP order.

Additional attributes of the output object, beyond those which make it a SpatialPoints, are:

Author(s)

Michael Kleinsasser
Aidan McDonald

See Also

hip.polygon, SDraw, bas.point

Examples

1
2
3
4
#   Draw sample of cities in the state of Washington
data(WA.cities)
samp <- hip.point( WA.cities, 100 )
  

SDraw documentation built on July 8, 2020, 6:23 p.m.