Headings of the segments of a movement track
angle.Rd
This function calculates the heading/azimuth/direction of movement of each segment between consecutive locations of a track.
Usage
# S4 method for class '.MoveTrackSingle'
angle(x)
# S4 method for class '.MoveTrackStack'
angle(x)
Details
Other terms for this measurment are azimuth or direction of travel/movement. The angles are relative to the North pole. The headings are calculated using the functions bearing
of the geosphere package.
Value
Angles in degrees (between -180 and 180). North is represented by 0.
If a move
object is provided, a numeric vector one element shorter than the number of locations is obtained.
If a moveStack
object is provided, a list with one element per individual containing a numeric vector one element shorter than the number of locations is obtained.
Examples
## angles from a Move object
data(leroy)
head(angle(leroy))
#> [1] 101.44448 157.41345 26.47859 -133.22121 -108.37639 72.45405
# to add this information to the move object, a "NA" has to be assigened
# e.g. to the last location (it also could be assigend to the first location).
leroy$angles <- c(angle(leroy), NA)
## angles from a MoveStack object
data(fishers)
str(angle(fishers))
#> List of 2
#> $ Leroy : num [1:918] 101.4 157.4 26.5 -133.2 -108.4 ...
#> $ Ricky.T: num [1:999] 115.7 70.2 -18.2 -78.9 76.5 ...
# to add this information to the moveStack object, a "NA" has to be assigened
# e.g. to the last location of each individual
fishers$angles <- unlist(lapply(angle(fishers), c, NA))