avail.lines: Create random, available lines

View source: R/avail.lines.R

avail.linesR Documentation

Create random, available lines

Description

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.

Usage

avail.lines(poly, n, length, dist)

Arguments

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.

Details

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.

Value

A SpatialLinesDataFrame object of random, available (i.e., pseudo-absence) lines.

Author(s)

Jason D. Carlisle, University of Wyoming


jcarlis3/ecoinfo documentation built on Sept. 9, 2023, 1:46 p.m.