This function is a simple wrapper that subsets a move or moveStack by a given time span. A move or moveStack containing data only for the subset time span is returned.

subset_move(m, from, to, tz = "UTC")

Arguments

m

a move or moveStack object (see df2move to convert a data.frame to a move object).

from

character or POSIXct, representing the start time. If character, the format "%m-%d-%y %H:%M:%S" must be used (see strptime).

to

character or POSIXct, representing the stop time. If character, the format "%m-%d-%y %H:%M:%S" must be used (see strptime).

tz

character, time zone that should be used if from and/or to are of type character.

Value

A move or moveStack object.

See also

Examples

library(moveVis)
library(move)

# load the example data
data("move_data")

# check min and max of move_data timestamps
min(timestamps(move_data))
#> [1] "2018-05-15 06:59:59 UTC"
max(timestamps(move_data))
#> [1] "2018-05-15 19:34:59 UTC"

# subset by character times
m <- subset_move(move_data, from = "2018-05-15 07:00:00", to = "2018-05-15 18:00:00")

# check min and max of result
min(timestamps(m))
#> [1] "2018-05-15 07:04:00 UTC"
max(timestamps(m))
#> [1] "2018-05-15 17:59:46 UTC"