Skip to content

Implement harmonize_fct() #3

@jonthegeek

Description

@jonthegeek

This function will map an input vector to a factor, optionally applying a lookup table. It is the core vector-level engine for harmonizing categorical data.

The signature should be:

harmonize_fct(.data, ..., .spec = NULL, lookup = NULL)

MVP Behavior:

  • The function will take an input vector (.data).
  • It will apply the named vector provided in lookup to translate values.
  • If a .spec object (from specify_fct()) is provided, it will validate the resulting values against the levels in the spec, coercing the final output to a factor.
  • If .spec is NULL, the function will perform the mapping but skip the validation, returning a factor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions