Description
Bearing towards the next coordinate in the tracks.
Usage
t_bearing(
tracks, t_id = "id", bind = TRUE, drop = TRUE, cname = "bearings"
)
Arguments
tracks
psyo. Data frame with tracks.
t_id
character or numeric. Column name in tracks that identifies the separate tracks.
bind
logical. Return the distance as list (FALSE) or add it to tracks (TRUE).
drop
logical. If TRUE and only one observation is returned drop the data frame and collapse the return value to a vector.
cname
character. Column name of the returned calculation result.
Details
For the last coordinate within a track the function returns empty because there are no bearings towards a following coordinate possible.
If the succeeding coordinate is the same like the current coordinate, the function return empty for the current coordinate.
Examples
Run this code# NOT RUN {
data(psyo)
psyo <- t_bearing(psyo)
# }
Run the code above in your browser using DataLab