Select records from a record metadata table.
selectRecords.RdFilters a record metadata table by any combination of RecordID,
EventID, StationID, and OwnerID, then deduplicates to one row
per record. Output is the canonical selection shape consumed by the
readTS() family (readAT() / readVT() / readDT()) and
writeSelection().
Details
Filter args are character vectors (length 1+). NULL means "no
restriction on this dimension". With all NULL, returns every
record in M – protect with explicit filters for non-trivial work.
For richer filters (magnitude, distance, intensity), filter M
first and pass the subset:
selectRecords(M[EventMagnitude > 7 & Repi < 100 & PGA > 600 & DIR == "H1"])Examples
master <- data.table::data.table(
RecordID = c("R1", "R1", "R2"),
OwnerID = c("AAA", "AAA", "BBB"),
EventID = c("E1", "E1", "E2"),
StationID = c("S1", "S1", "S2"),
DIR = c("H1", "H2", "H1")
)
selectRecords(master, OwnerID = "AAA")
#> RecordID OwnerID EventID StationID
#> <char> <char> <char> <char>
#> 1: R1 AAA E1 S1