Get sf-based multiline geometries of movements between patches.

wat_patch_traj(df, x1 = "x_end", x2 = "x_start", y1 = "y_end", y2 = "y_start")

Arguments

df

A dataframe with at least 2 pairs of coordinate columns, such as X_end Y_end, X_start, Y_start.

x1

Coordinate column for the beginning X coordinate of the linestring; this should be the last X coordinate of each patch if inter-patch linestrings are to be constructed. It is possible to use the X_start coordinate, but this will lead to issues and nonsensical output at this point.

x2

Coordinate column for the end X coordinate of the linestring; this should be the first X coordinate of each patch if inter-patch linestrings are to be constructed.

y1

Coordinate column for the beginning Y coordinate of the linestring; this should be the last Y coordinate of each patch if inter-patch linestrings are to be constructed. It is possible to use the X_start coordinate, but this will lead to issues and nonsensical output at this point.

y2

Coordinate column for the end Y coordinate of the linestring; this should be the first Y coordinate of each patch if inter-patch linestrngs are to be constructed.

Value

An sf MULTILINESTRING object representing the linear path between N patches, starting at the end point of the first patch, and ending at the first point of the Nth patch.