Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/dtw
28 September 2022, 07:50:27 UTC
  • Code
  • Branches (54)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.1-2
    • refs/tags/0.3-1
    • refs/tags/0.4-2
    • refs/tags/1.0-2
    • refs/tags/1.12-3
    • refs/tags/1.12-5
    • refs/tags/1.13-1
    • refs/tags/1.14-1
    • refs/tags/1.14-3
    • refs/tags/1.15
    • refs/tags/1.16
    • refs/tags/1.17-1
    • refs/tags/1.18-1
    • refs/tags/1.2-1
    • refs/tags/1.20-1
    • refs/tags/1.21-1
    • refs/tags/1.21-3
    • refs/tags/1.22-3
    • refs/tags/1.23-1
    • refs/tags/1.4-3
    • refs/tags/1.5-3
    • refs/tags/1.6-2
    • refs/tags/1.9-1
    • refs/tags/R-2.10.0
    • refs/tags/R-2.10.1
    • refs/tags/R-2.11.0
    • refs/tags/R-2.11.1
    • refs/tags/R-2.12.0
    • refs/tags/R-2.12.1
    • refs/tags/R-2.12.2
    • refs/tags/R-2.13.0
    • refs/tags/R-2.13.1
    • refs/tags/R-2.13.2
    • refs/tags/R-2.14.0
    • refs/tags/R-2.14.1
    • refs/tags/R-2.14.2
    • refs/tags/R-2.15.0
    • refs/tags/R-2.15.1
    • refs/tags/R-2.15.2
    • refs/tags/R-2.15.3
    • refs/tags/R-2.6.2
    • refs/tags/R-2.7.0
    • refs/tags/R-2.7.1
    • refs/tags/R-2.7.2
    • refs/tags/R-2.8.0
    • refs/tags/R-2.8.1
    • refs/tags/R-2.9.0
    • refs/tags/R-2.9.1
    • refs/tags/R-2.9.2
    • refs/tags/R-3.0.0
    • refs/tags/R-3.0.1
    • refs/tags/R-3.0.2
    • refs/tags/R-3.0.3
    No releases to show
  • ea7676e
  • /
  • man
  • /
  • dtwPlotTwoWay.Rd
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:030ebe94515480c9742fe3a075832044b85802a7
origin badgedirectory badge Iframe embedding
swh:1:dir:e8cd71f2b3c169805414f7c805c60d695ebfb79d
origin badgerevision badge
swh:1:rev:935e521fa862c893e52a85dbb72c3ae53246a8e4
origin badgesnapshot badge
swh:1:snp:e75a8a2617c9395688cff068aec5b1e7448d2a41
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 935e521fa862c893e52a85dbb72c3ae53246a8e4 authored by Toni Giorgino on 15 August 2009, 00:00:00 UTC
version 1.14-3
Tip revision: 935e521
dtwPlotTwoWay.Rd
\name{dtwPlotTwoWay}
\alias{dtwPlotTwoWay}



%- Also NEED an '\alias' for EACH other topic documented here.
\title{Plotting of dynamic time warp results: pointwise comparison}
\description{
  Display the query and reference time series and their alignment,
  arranged for visual inspection.
}

\usage{
dtwPlotTwoWay(d,xts=NULL,yts=NULL, offset=0,
			ts.type="l",pch=21, 
                        match.indices=NULL,
			match.col="gray70", match.lty=3,
			xlab="Index", ylab="Query value", 
			... )
}

%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{d}{ an alignment result, object of class \code{dtw}}
  \item{xts}{ query vector }
  \item{yts}{  reference vector }
  \item{xlab,ylab}{axis labels}
  \item{offset}{displacement between the timeseries, summed to reference}
  \item{match.col, match.lty}{color and line type of the match guide lines}
  \item{match.indices}{indices for which to draw a visual
    guide}
  \item{ts.type,pch}{graphical parameters for timeseries plotting, passed to \code{matplot}}
  \item{...}{additional arguments, passed to \code{matplot}}
}

\details{

  The two vectors are displayed via the \code{\link{matplot}} functions;
  their appearance can be customized via the \code{type} and \code{pch}
  arguments (constants or vectors of two elements).  If \code{offset} is
  set, the reference is shifted vertically by the given amount; this will
  be reflected by the \emph{right-hand} axis.

  Argument \code{match.indices} is used to draw a visual guide to
  matches; if a vector is given, guides are drawn for the corresponding
  indices in the warping curve (match lines). If integer, it is used as
  the number of guides to be plotted. The corresponding style is
  customized via the \code{match.col} and \code{match.lty} arguments.

  If \code{xts} and \code{yts} are not supplied, they will be recovered
  from \code{d}, as long as it was created with the two-argument call of
  \code{\link{dtw}}  with \code{keep.internals=T}.  Only
  single-variate time series can be plotted this way.
  
}


\author{Toni Giorgino }

\note{
  When \code{offset} is set values on the left axis only apply to
  the query.
}

\section{Warning}{ The function is incompatible with mechanisms for
     arranging plots on a device: \code{par(mfrow)}, \code{layout} and
     \code{split.screen}.}


\seealso{ \code{\link{dtwPlot}} for other dtw plotting functions,
\code{\link{matplot}} for graphical parameters. }

\examples{

## A noisy sine wave as query
## A cosine is for reference; sin and cos are offset by 25 samples

idx<-seq(0,6.28,len=100);
query<-sin(idx)+runif(100)/10;
reference<-cos(idx)
dtw(query,reference,step=asymmetricP1,keep=TRUE)->alignment;


## Equivalent to plot(alignment,type="two");
dtwPlotTwoWay(alignment);


## Highlight matches of chosen QUERY indices. We will do some index
## arithmetics to recover the corresponding indices along the warping
## curve

hq <- (0:8)/8              
hq <- round(hq*100)      #  indices in query for  pi/4 .. 7/4 pi

hw <- (alignment$index1 \%in\% hq)   # where are they on the w. curve?
hi <- (1:length(alignment$index1))[hw];   # get the indices of TRUE elems


## Beware of the reference's y axis, may be confusing
plot(alignment,offset=-2,type="two", lwd=3, match.col="grey50",
     match.indices=hi,main="Match lines shown every pi/4 on query");

legend("topright",c("Query","Reference (rt. axis)"), pch=21, col=1:6)



}

\concept{Dynamic Time Warp}


\keyword{ hplot }

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API