tf_align: Apply warping functions to align functional data

View source: R/register.R

tf_alignR Documentation

Apply warping functions to align functional data

Description

tf_align() applies the inverse warping function to unregistered data to obtain aligned (registered) functions.

Usage

tf_align(x, warp, ...)

## S3 method for class 'tfd'
tf_align(x, warp, ..., keep_new_arg = FALSE)

## S3 method for class 'tfb'
tf_align(x, warp, ...)

Arguments

x

tf vector of functions. For tf_warp(), these should be registered/aligned functions and unaligned functions for tf_align().

warp

tf vector of warping functions used for transformation. See Details.

...

additional arguments passed to tfd().

keep_new_arg

keep new arg values after (un)warping or return tfd vector on arg values of the input (default FALSE is the latter)? See Details.

Value

the aligned tf vector (registered functions)

See Also

Other registration functions: tf_estimate_warps(), tf_landmarks_extrema(), tf_register(), tf_registration, tf_warp()

Examples

# Estimate warps, then align manually:
t <- seq(0, 2 * pi, length.out = 101)
x <- tfd(t(sapply(c(-0.3, 0, 0.3), function(s) sin(t + s))), arg = t)
warps <- tf_estimate_warps(x, method = "affine", type = "shift")
aligned <- tf_align(x, warps)
plot(aligned, col = 1:3)

tf documentation built on April 7, 2026, 5:07 p.m.