readTwoCol: Read a 2-column whitespace-delimited ASCII record.

View source: R/readTwoCol.R

readTwoColR Documentation

Read a 2-column whitespace-delimited ASCII record.

Description

Time in column 1 (seconds), signal in column 2. No header. Separator (space or tab) is auto-detected by fread. Trailing all-NA columns (some providers leave a trailing tab -> phantom column) are dropped.

Usage

readTwoCol(file)

Arguments

file

Path to the file.

Details

OCID extracted from filename. Three known patterns:

  • SEED-like: NET.STA.LOC.CHA__... -> CHA

  • CENA: ⁠<date>_<time>_NET.STA.CHA_AccTH⁠ -> CHA

  • CLSMD: ⁠<X>_acc.txt⁠ -> X

Value

LONG data.table(t, OCID, s).

Examples

dir <- tempfile()
dir.create(dir)
file <- file.path(dir, "N_acc.txt")
writeLines(c("0 1", "0.01 2"), file)
readTwoCol(file)


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