do_align: Align two surface cross cuts using cross correlation

Description Usage Arguments Value Examples

Description

The first vector serves as a reference, the second vector is shifted, such that it aligns best with the first and has the same length as the first vector.

Usage

1
do_align(y1, y2, min.overlap = 0.1 * max(length(y1), length(y2)))

Arguments

y1

vector of striation marks (assuming equidistance between values)

y2

vector of striation marks

min.overlap

integer value: what is the minimal number of values between y1 and y2 that should be considered?

Value

list consisting of a) the maximal cross correlation, b) the lag resulting in the highest cross correlation, and c) a vector of length y1 with aligned values of y2.

Examples

1
2
3
4
5
6
x <- runif(20)
do_align(x, lead(x, 5))
do_align(x, lag(x, 5), min.overlap=2)
do_align(x, lag(x, 5), min.overlap=3)
do_align(x, x[-(1:5)], min.overlap=3)
do_align(x[-(1:5)], x, min.overlap=3)

erichare/bulletr documentation built on May 16, 2019, 8:26 a.m.