powered by
Converts textual activity outcomes (for example, `Active`/`Inactive`) into numeric values for matrix and modeling workflows.
Maps textual activity outcomes (for example, `Active`/`Inactive`) to numeric values for modeling workflows.
pc_activity_outcome_map(values, map = NULL, strict = FALSE, unknown = NA_real_)
Numeric vector aligned with `values`.
Outcome values (character/factor/numeric).
Optional named numeric map. Names are matched case-insensitively after trimming.
Logical. If `TRUE`, unknown non-empty labels raise an error.
Numeric value assigned to unknown labels when `strict = FALSE`.
Matching is case-insensitive after trimming whitespace. Custom maps augment the built-in defaults unless names overlap.
pc_activity_outcome_map(c("Active", "Inactive", "Unknown"))
Run the code above in your browser using DataLab