dists | R Documentation |
Tracks
objectsCalculates a distance matrix with distances for each pair of tracks.
## S4 method for signature 'Tracks,Tracks'
dists(tr1, tr2, f, ...)
tr1 |
An object of class |
tr2 |
An object of class |
f |
A function to calculate distances. Default is |
... |
Additional parameters passed to |
f
can be any function applicable to a numerical vector or frechetDist.
A matrix with distances between each pair of tracks or NA
if they don't overlap in time.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.