| TSL2IM | R Documentation |
Given a long time-series table with columns for the record identifier,
OCID, ID, t, and s, converts amplitudes to units.target and
computes standard intensity measures grouped by record x OCID x ID.
Valid ID content is either AT only, or a complete time-series set with
AT, VT, and DT.
TSL2IM(.x, units.source, units.target = "mm", output = c("IML", "IMW"))
.x |
|
units.source |
character. Source units of the |
units.target |
character. Target units for the returned intensities.
Default |
output |
character. |
A data.table. output = "IML" returns long rows with columns
<metadata cols>, OCID, ID, IM, value, units; output = "IMW" returns
wide intensity columns.
t <- seq(0, 1, by = 0.01)
tsl <- data.table::rbindlist(list(
data.table::data.table(t = t, s = sin(2 * pi * t),
ID = "AT", OCID = "H1"),
data.table::data.table(t = t, s = cos(2 * pi * t),
ID = "VT", OCID = "H1"),
data.table::data.table(t = t, s = sin(pi * t),
ID = "DT", OCID = "H1")
))
im <- TSL2IM(tsl, units.source = "mm")
head(im)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.