This function aligns movement data to a uniform time scale with a uniform temporal resolution throughout the complete movement sequence. This prepares the provided movement data to be interpretable by frames_spatial, which necessitates a uniform time scale and a consistent, unique temporal resolution for all moving individuals to turn recording times into frame times.

align_move(
  m,
  res = "minimum",
  unit = NA,
  spaceMethod = "greatcircle",
  ...,
  verbose = TRUE
)

Arguments

m

move or moveStack, which is allowed to contain irregular timestamps and diverging temporal resolutions to be aligned (see df2move to convert a data.frame to a move object).

res

either numeric, representing the temporal resolution, to which m should be aligned to (see argument unit), or character:

  • "minimum" to use the smallest temporal resolution of m (default)

  • "maximum" to use the largest temporal resolution of m

  • "mean" to use the rounded average temporal resolution of m

unit

character, temporal unit of res. Either "secs", "mins", "hours", "days". No effect, if res is not defined.

spaceMethod

character, either "euclidean", "greatcircle" or "rhumbline", indicating the interpolation function to be used to interpolate locations of m to the aligned time scale. Interpolation is performed using move::interpolateTime.

...

deprecated arguments including digit.

verbose

logical, if TRUE, messages and progress information are displayed on the console (default).

Value

Aligned move or moveStack, ready to be used with frames_spatial-

See also

Examples

library(moveVis)
library(move)
data("move_data")

# the tracks in move_data have irregular timestamps and sampling rates.
# print unique timestamps and timeLag
unique(timestamps(move_data))
unique(unlist(timeLag(move_data, units = "secs")))

# use align_move to correct move_data to a uniform time scale and lag using interpolation.
# resolution of 4 minutes:
m <- align_move(m = move_data, res = 4, unit = "mins")
unique(unlist(timeLag(m, units = "mins")))

# resolution of 1 hour:
m <- align_move(move_data, res = 1, unit = "hours")
unique(unlist(timeLag(m, units = "hours")))

# resolution of 15 seconds:
m <- align_move(move_data, res = 15, unit = "secs")
unique(unlist(timeLag(m, units = "secs")))