Learn R Programming

move (version 1.0)

time.lag: Calculates the time lags between the coordinates

Description

The time.lag function calculates the time lags between locations.

Usage

## S3 method for class '.MoveTrackSingle':
time.lag(x,...)
  ## S3 method for class '.MoveTrackStack':
time.lag(x,...)

Arguments

x
a Move or MoveStack object
...
further arguments

Value

  • The function returns a numeric vector with the time lags.

Details

Optionally the argument units can be passed on to ensure the time lag in a certain unit, this is especially useful in case a move stack is bursted. For more information on the units argument see the help of difftime.

Examples

Run this code
load(system.file("extdata", "move.RData", package="move"), .GlobalEnv)
stack <- moveStack(list(leroy,leroy))

head(time.lag(leroy)) #calculate timelags for a Move object
head(time.lag(stack)) #calculate timelags for a MoveStack object
head(time.lag(stack, units="hours")) #calculate timelags in different units

Run the code above in your browser using DataLab