Skip to contents

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.

Value

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

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

Examples

dir <- tempfile()
dir.create(dir)
file <- file.path(dir, "N_acc.txt")
writeLines(c("0 1", "0.01 2"), file)
readTwoCol(file)
#>        t   OCID     s
#>    <num> <char> <int>
#> 1:  0.00      N     1
#> 2:  0.01      N     2