Convert canonical long time-series tables to wide form.
TSL2TSW.RdTSL2TSW() casts a canonical long TSL table with t, s, ID, and
OCID columns to wide TSW form with columns such as AT.H1, VT.H1,
and DT.H1.
Usage
TSL2TSW(.x, by = "auto", ids = c("AT", "VT", "DT"))Arguments
- .x
Canonical
TSLdata.tablewith columnst,s,ID, andOCID, plus optional metadata columns.- by
Metadata columns to keep as row keys. The default
"auto"uses all columns exceptt,s,ID, andOCID.- ids
Preferred order for signal IDs in the output columns. Other IDs present in
.xare kept after these values.
Examples
tsl <- data.table::data.table(RecordID = "R1", OCID = "H1",
ID = "AT", t = c(0, 0.01), s = c(1, 2))
TSL2TSW(tsl)
#> Key: <RecordID, t>
#> RecordID t AT.H1
#> <char> <num> <num>
#> 1: R1 0.00 1
#> 2: R1 0.01 2