View source: R/selectRecords.R
| selectRecords | R Documentation |
Filters 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().
selectRecords(
M,
RecordID = NULL,
EventID = NULL,
StationID = NULL,
OwnerID = NULL
)
M |
record metadata |
RecordID |
character. Filter by |
EventID |
character. Filter by |
StationID |
character. Filter by |
OwnerID |
character. Filter by |
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"])
data.table(RecordID, OwnerID, EventID, StationID).
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.