https://github.com/cran/dtw
Tip revision: ece68f6f6896952ec018d3f9a1c330569c2ce0bb authored by Toni Giorgino on 17 June 2009, 00:00:00 UTC
version 1.13-1
version 1.13-1
Tip revision: ece68f6
dtwDist.R
###############################################################
# #
# (c) Toni Giorgino <toni.giorgino@gmail.com> #
# Laboratory for Biomedical Informatics #
# University of Pavia - Italy #
# www.labmedinfo.org #
# #
# $Id: distance.R 51 2007-12-11 10:59:08Z tonig $
# #
###############################################################
## Compute a dissimilarity matrix, akin to "dist", analogue/distance,
## vegan/vegdist, etc. , based on the dtw "distance" measure.
## Apply FUN to all row pairs
dtwDist <- function(mx,my=mx,...) {
mye<-function(y,x,FUN,...) {
apply(x,1,FUN,y,...);
}
apply(my,1,mye,mx,dtwpairdist,...);
}