Get distance between patches, last point of N to first point of N+1.

wat_bw_patch_dist(
  data,
  x1 = "x_end",
  x2 = "x_start",
  y1 = "y_end",
  y2 = "y_start"
)

Arguments

data

A dataframe of or extending the class data.frame. This must contain two pairs of coordinates, the start and end X and Y coordinates of a feature.

x1

The first X coordinate or longitude; for inter-patch distances, this is the last coordinate (X_end) of a patch n0.

x2

The second X coordinate; for inter-patch distances, this is the first coordinate (X_start) of a subsequent patch n1.

y1

The first Y coordinate or latitude; for inter-patch distances, this is the last coordinate (Y_end) of a patch n0.

y2

The second Y coordinate; for inter-patch distances, this is the first coordinate (Y_start) of a subsequent patch n1.

Value

A numeric vector of the length of the number of patches, or rows in the input dataframe. If the input dataframe has only a single row, the vector has a length of one, and its only element is 0. In all other cases, the vector has as its elements NA, followed by n-1 distances, where n is the number of rows.