Convert wide time-series tables to canonical long form.
TSW2TSL.RdTSW2TSL() melts wide time-series columns named <ID>.<OCID> back to
canonical TSL rows.
Usage
TSW2TSL(.x, by = "auto", ids = c("AT", "VT", "DT"))Arguments
- .x
Wide
TSWdata.tablewith atcolumn, or a legacy constructortstime column, plus signal columns named<ID>.<OCID>.- 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
tsw <- data.table::data.table(RecordID = "R1", t = c(0, 0.01),
AT.H1 = c(1, 2))
TSW2TSL(tsw)
#> RecordID OCID ID t s
#> <char> <char> <char> <num> <num>
#> 1: R1 H1 AT 0.00 1
#> 2: R1 H1 AT 0.01 2