avail.lines | R Documentation |
This function creates random, available (i,e, pseudo-absence) lines that are within the features of a specified polygon. The created lines conform to a user-specified proximity rule, i.e., lines are not created within a specified minimum distance from each other (rule enforced within a feature, but not between overlapping features). The direction of each line is random. All lines have the same length. Each line is fully contained within the polygon. Suited for input polygons with one or multiple features.
avail.lines(poly, n, length, dist)
poly |
SpatialPolygonsDataFrame, the area within which random, available lines are generated. |
n |
Scalar, the number of lines to create. |
length |
Scalar, the length of each line. Unit is meters for projected coordinate systems. |
dist |
Scalar, the minimum distance output lines can be from each other. Unit is meters for projected coordinate systems. |
Suited for input polygons with one or multiple features. For example, if n=5 and poly has 3 features, the output will have 15 total lines, 5 in each of the 3 polygon features. The output object will have a @data slot with columns that identify the polygon, a unique lineID, the coordinates of the line end-points, and the line length. Lengths may be slightly different from what is specified in the length argument. This is due to circles created by rgeos::gBuffer being imperfectly smooth.
A SpatialLinesDataFrame object of random, available (i.e., pseudo-absence) lines.
Jason D. Carlisle, University of Wyoming
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.