mt_segments: Create a 'LINESTRING' for each track segment

View source: R/mt_segments.R

mt_segmentsR Documentation

Create a LINESTRING for each track segment

Description

Creates a LINESTRING for each segment between consecutive points within a track.

Usage

mt_segments(x)

Arguments

x

A move2 object.

Details

The last location of each track is formed by a POINT as no segment can be formed.

Value

A sfc object containing LINESTRINGs for each segment of a trajectory.

See Also

  • mt_track_lines() For transforming the full tracks into one LINESTRING.

Examples

track <- mt_sim_brownian_motion()
mt_segments(track)
## adding the segments as an attribute to the move2 object
track$segments <- mt_segments(track)
track


move2 documentation built on April 4, 2025, 12:24 a.m.