Skip to contents

Summarise each realised path by merging consecutive stationary periods that were assigned to the same grid cell. Paths are identified by j and, when present, chain.

Usage

path_collapse(paths, stap = NULL, label_stap_id = FALSE)

Arguments

paths

A path data frame containing stap_id, ind, lat, and lon, and optionally j, chain, start, and end.

stap

A stationary-period data frame containing stap_id, start, and end. If NULL, these columns are taken from paths.

label_stap_id

logical; if TRUE, replace stap_id in the output with a character label of the form "{stap_id_start}->{stap_id_end}. The numeric stap_id_start and stap_id_end columns are always kept.

Value

A data frame with one row per collapsed stay and columns stap_id, stap_id_start, stap_id_end, ind, lat, lon, start, end, known, j, and chain.

See also

Other path: path_summary()