Methods for the alignment and merging of partially or inexactly aligned time-series.
The main alignment functions are named [type]_align and
in intended to be used in the form:
ans <- _align(ts1, ts2, ...)
In the simplest cases ts1 is a vector to be used as a
reference time-series and ts2 is a second time-series to be aligned
with it. However, either can also be a data.frame in which case an
extra argument by should be included to identify the data.frame columns
to use, e.g. for df1 containing ts1 and df2 containing
ts2:
ans <- _align(df1, df2, by=c("ts1", "ts2"), ...)
If the object to be aligned is a data.frame, all columns in that
data.frame are modified according to the ts1/ts2 alignment.
alignments can also be applied within a single data, e.g. for
df that contains both ts1 and ts2:
ans <- _align(df, by=c("ts1", "ts2"), ...)
(in which case only df$ts2 is aligned...)
The default output is typically a single data.frame containing the
aligned data, but other outputs may also be generated, e.g. plots and
summary reports. This behaviour can be changed using the common argument
output, and options include "plot", "summary",
"ans", and "alignment" (all outputs in the package object
class, see also alignment.generics). Multiple output may also
be requested but only the last is caught.
Example alignments include: n_align,
cor_align and cow_align.
Although the main alignment functions require two time-series,
some use sub-routines to reshape data, and these can also be applied
directly.
Examples of these include: regularize and
warp.
Carslaw, D.C., Ropkins, K., Laxen, D., Moorcroft, S., Marner, B. and Williams, M.L., 2008. Near-field commercial aircraft contribution to nitrogen oxides by engine, aircraft type, and airline by individual plume sampling. Environmental science & technology, 42(6), pp.1871-1876. https://doi.org/10.1021/es071926a.
Ropkins, K., Carlsaw, D.C., Goodman, P.S. and Tate, J.E., 2009. Application of non-linear time-alignment and integration methods to environmental time series. TrAC Trends in Analytical Chemistry, 28(3), pp.373-391. https://doi.org/10.1016/j.trac.2008.11.013.
Useful links: