Draws a Halton Lattice sample from a linear (line) resource .
Draws a Halton Lattice sample from a
A SpatialLines or SpatialLinesDataFrame object. This object must contain at least 1 line. If it contains more than 1 line, the HAL sample is drawn from the union of all lines.
Sample size. Number of locations to draw from the set of all lines
A 2X1 vector of base powers.
Option specifying how spatial balance is maintained. The options are "1D" or "2D".
Under "1D" all lines in
Under "2D" a systematic sample of points along the union of all lines
A HAL sample is drawn from the union of all lines in
discretization of lines using points spaced
pt.spacing apart. The
discretized points are then sampled using the HAL method
for points (see
SpatialPointsDataFrame containing locations in the HAL sample,
in HAL order.
Attributes of the sample points are:
sampleID: A unique identifier for every sample point. This encodes the HAL order.
return[order(return$sampleID),]will sort the returned object in HAL order.
sampleID's, in the HAL case, are not consecutive.
sampleID's are usually the Halton indices for the Halton boxes containing the point, after adding random cycles for multiple points in the same box (see
halton.frame). If the sample cycled around to the beginning of the frame, because random start fell at the end, the sample number is appended to the beginning of the normal
sampleID's so they will sort the frame in the proper order.
geometryID: The ID of the line in
xon which each sample point falls. The ID of lines in
Any attributes of the original lines (in
Additional attributes of the output object, beyond those which
make it a
frame: Name of the input sampling frame.
frame.type: Type of resource in sampling frame. (i.e., "line").
sample.type: Type of sample drawn. (i.e., "BAS").
balance: The type of balance ("1d" or "2d").
random.start: The random seed for the random-start 1D or 2D Halton sequence that produced the sample. If
random.start: The random start of the sample in the 1D or 2D Halton frame. The Halton frame is a list of all points sorted in Halton order. Halton order is the Halton index of each point, with random cycles added to multiple points in the same Halton box. If
balance=="2D", this is a random number between 0 and the number of points in the discretization of
balance=="1D", this is a random number between 0 and the number of points in the 1D Halton lattice discretization of
eta). The sample consists of the
nconsecutive units starting at
random.start+1in the sorted Halton frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# Default sample of Hawaii coastline. 1D balance samp <- hal.line( HI.coast, 100 ) # Desire frame with spacing = 500 meters # Frame has ~3144 points = lineLength(HI.coast)/500 samp <- hal.line( HI.coast, 100, balance="2D", frame.spacing=500) # Desire 2000 points in frame # Set frame.spacing = lineLength / 2000 # Set Halton lattice to contain # 2592 boxes = prod(c(2,3)^c(5,4)) samp <- hal.line( HI.coast, 100, J=c(5,4), balance="2D", frame.spacing=lineLength(HI.coast)/2000)
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.