Skip to contents

This function returns the speed between consecutive locations of Move or MoveStack object.

Usage

# S4 method for class '.MoveTrackSingle'
speed(x)
  # S4 method for class '.MoveTrackStack'
speed(x)

Arguments

x

a move, moveStack or moveBurst object

Author

Marco Smolla & Anne Scharf

Value

Speed in map units/second.
If the projection of the coordinates is long/lat all values are returned in m/s, otherwise in the map units/second of the projection of the move object. Check and set the projection of your Move, MoveStack or MoveBurst object using the proj4string() function.

If a move or moveBurst 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

# speeds from a Move object 
data(leroy)
head(speed(leroy))
#> [1] 0.007147213 0.006588408 0.014615000 0.010688607 0.013125191 0.015074495
# 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$speed <- c(speed(leroy), NA)

## speeds from a MoveStack object
data(fishers)
str(speed(fishers))
#> List of 2
#>  $ Leroy  : num [1:918] 0.00715 0.00659 0.01461 0.01069 0.01313 ...
#>  $ Ricky.T: num [1:999] 0.0928 0.0825 0.0691 0.0769 0.3766 ...
# to add this information to the moveStack object, a "NA" has to be assigened
# e.g. to the last location of each individual (the speed belongs to the following segment).
fishers$speed <- unlist(lapply(speed(fishers),c, NA ))