Select records from the master, keyed at the record level.
selectRecords.RdFilters buildMaster() output by any combination of RecordID,
EventID, StationID, OwnerID, then deduplicates to one row per
record. Output is the canonical selection shape consumed by
the readTS() family (readAT() / readVT() / readDT()) and
writeSelection().
Arguments
- M
master
data.table(output ofbuildMaster()).- RecordID
character. Filter by
RecordID. DefaultNULL.- EventID
character. Filter by
EventID. DefaultNULL.- StationID
character. Filter by
StationID. DefaultNULL.- OwnerID
character. Filter by
OwnerID. DefaultNULL.
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