PSW2PSL: Convert wide response spectra to long form.

View source: R/tableContracts.R

PSW2PSLR Documentation

Convert wide response spectra to long form.

Description

PSW2PSL() melts spectra columns named ⁠<ID>.<OCID>⁠ back to canonical long spectra rows. Derived RotD components such as D50 and D100 are returned as ordinary OCID values.

Usage

PSW2PSL(.x, by = "auto", ids = c("PSA", "PSV", "SD"))

Arguments

.x

Wide spectra table with a Tn column and spectra columns named ⁠<ID>.<OCID>⁠.

by

Metadata columns to keep as row keys. The default "auto" uses all non-spectra columns except Tn.

ids

Preferred order for spectra IDs. Other IDs present in .x are kept after these values.

Value

A canonical long spectra data.table.

Examples

psw <- data.table::data.table(RecordID = "R1", Tn = 0.1, PSA.H1 = 1)
PSW2PSL(psw)

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