Write a selection table to selection/<name>.csv / .json.
writeSelection.RdDeduplicates (OwnerID, EventID, StationID) so the CSV
carries one row per station folder (= one record). The JSON sidecar
captures audit metadata: name, timestamp, total hits, hits per owner.
Details
The CSV is the canonical input contract for any downstream
orchestrator that iterates over a selection: each row identifies one
(OwnerID, EventID, StationID) station folder under whichever
records root the orchestrator was given.
Examples
x <- data.table::data.table(
OwnerID = c("AAA", "AAA"),
EventID = c("E1", "E1"),
StationID = c("S1", "S1"),
DIR = c("H1", "H2")
)
path <- file.path(tempdir(), "gmsp-selection-example")
unlink(path, recursive = TRUE)
suppressMessages(writeSelection(x, name = "demo", path = path))
list.files(path)
#> [1] "demo.csv" "demo.json"