TSL2CAV: CAV ratio history from canonical acceleration time series.

View source: R/intensityRatios.R

TSL2CAVR Documentation

CAV ratio history from canonical acceleration time series.

Description

TSL2CAV() computes the cumulative absolute velocity history from acceleration rows in a canonical TSL table and returns the relative value CAV(t) / max(CAV).

Usage

TSL2CAV(.x, units.source, units.target = "mm", output = c("wide", "long"))

Arguments

.x

data.table. Long-format TSL with at least OCID, ID, t, and s columns plus optional metadata columns. Only rows with ID == "AT" are used.

units.source

character. Source length units of the s column ("mm", "cm", or "m"). Canonical TSL acceleration is interpreted as length units per second squared.

units.target

character. Target length units used for intermediate calculations. Default "mm".

output

character. "wide" returns one row per metadata and t, with one ratio column per OCID; "long" returns columns ⁠<metadata>, OCID, t, ratio⁠.

Value

See TSL2AI().

Examples

t <- seq(0, 1, by = 0.01)
tsl <- data.table::data.table(RecordID = "R1", OCID = "H1",
                              ID = "AT", t = t,
                              s = 1000 * sin(2 * pi * t))
TSL2CAV(tsl, units.source = "mm")


gmsp documentation built on July 18, 2026, 5:07 p.m.