dists: Calculate distances between two 'Tracks' objects

Description Usage Arguments Details Value Examples

Description

Calculates a distance matrix with distances for each pair of tracks.

Usage

1
2
## S4 method for signature 'Tracks,Tracks'
dists(tr1, tr2, f, ...)

Arguments

tr1

An object of class Tracks.

tr2

An object of class Tracks.

f

A function to calculate distances. Default is mean.

...

Additional parameters passed to f.

Details

f can be any function applicable to a numerical vector or frechetDist.

Value

A matrix with distances between each pair of tracks or NA if they don't overlap in time.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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

## create Tracks objects
tracks1 <- Tracks(list(A3, track2))
tracks2 <- Tracks(list(track2, A3))

## calculate distances
## Not run: 
dists(tracks1, tracks2)
dists(tracks1, tracks2, sum)
dists(tracks1, tracks2, frechetDist)

## End(Not run)

trajectories documentation built on July 1, 2020, 11:42 p.m.