Correlation based (linear) alignment, row
offsetting second of two vector
s or data.frame
s
based on best fit as estimated by correlation coefficient.
Arguments
- x
First
vector
ordata.frame
, to be aligned and merged with.- y
Second
vector
ordata.frame
, to align and merge withx
.- by
If
x
ory
aredata.frame
s, the names of the columns thatcor_align
should align with.- ...
Other arguments:
min.overlap
By default,
cor_align
compares correlations for lags withx
/y
overlaps of 2000 rows or 20% if smaller. Other minimum (row number) overlaps can be set using the extra argumentmin.overlap
.output
The default
cor_align
output
isc("plot", "summary", "ans")
.output
options include:"ans"
,"plot"
,"summary"
and"alignment"
. Multipleoutput
s are allowed, but only the last is captured by return.alignment
is a special object class which may be helpful to those looking at alignments in more detail.
Value
By default, cor_align
returns x
and y
as an aligned data.frame
. It also provides a lag correlation
profile (plot) and alignment report. See above about modifying
outputs.