Calculates the total 2D path length from x- and z-coordinate movement data, optionally within a specified time window. Assumes the data contains at least two rows with columns `pos_x`, `pos_z`, and `time`.

extract_path_length(movement_data, min_time = NULL, max_time = NULL)

Arguments

movement_data

A data frame containing `pos_x`, `pos_z`, and `time` columns.

min_time

Optional minimum time for filtering the movement data.

max_time

Optional maximum time for filtering the movement data.

Value

A numeric value representing the total path length, or `NA_real_` if the input is invalid or insufficient.

Examples

extract_path_length(movement_data)
#> Error: object 'movement_data' not found
extract_path_length(movement_data, min_time = 10, max_time = 50)
#> Error: object 'movement_data' not found