Learn R Programming

trajectories (version 0.2-9)

compare: Compares objects of class Track

Description

Calculates distances between two tracks for the overlapping time interval.

Usage


# S4 method for Track
compare(tr1, tr2)

Value

A difftrack object. Includes both tracks extended with additional points for the timestamps of the other track. Also includes SpatialLines representing the distances between the tracks.

Arguments

tr1

An object of class Track.

tr2

An object of class Track.

Author

Nikolai Gorte <n.gorte@gmail.com>

Examples

Run this code
## example tracks
library(sp)
library(xts)
data(A3)
track2 <- A3
index(track2@time) <- index(track2@time) + 32
track2@sp@coords <- track2@sp@coords + 0.003

## compare and plot
difftrack <- compare(A3, track2)
plot(difftrack)

Run the code above in your browser using DataLab