Learn R Programming

move (version 1.0)

seglength: Calculates the segment length of a track

Description

Calculates the segment length of a track

Usage

## S3 method for class 'SpatialPointsDataFrame':
seglength(x)

Arguments

x
a SpatialPointsDataFrame, like a Move or MoveStack object

Value

  • If the SptialPointsDataFrame is projected in longitude latitude coordinates, the returned values are in kilometer. If not, the distances are calculated with the Pythagoras' theorem and the distances are Euclidean distances in map units.

Details

The seglength function calculates the distances between point 1 and point 2, point 2 and point 3, ... .

Examples

Run this code
load(system.file("extdata", "move.RData", package="move"), .GlobalEnv)
  stack <- moveStack(list(leroy,leroy))
  
  head(seglength(leroy)) #Move object in longlat projection
  head(seglength(stack)) #MoveStack object in aeqd projection

Run the code above in your browser using DataLab