validate_group_map: Validate a symbol-to-group mapping
Description
Normalizes and checks a symbol → group mapping for a given set of symbols.
Accepts either a data.frame/data.table with columns Symbol and Group,
or a named character vector c(symbol = "group", ...).
Errors if any requested symbol is missing or mapped more than once.
Usage
validate_group_map(symbols, group_map)
Value
A two-column data.frame with columns Symbol and Group
(one row per symbol), sorted by Symbol.
Arguments
symbols
Character vector of symbols to validate/keep.
group_map
Data frame/data.table with columns Symbol,Group,
or a named character vector mapping symbol -> group.