inspect_valinvec: Inspect if a value is in a recode map

View source: R/inspect_valinvec.R

inspect_valinvecR Documentation

Inspect if a value is in a recode map

Description

Check whether a given value is present as a key in a specified recode map. Inputs can be validated against a set of predefined categories or labels.

Usage

inspect_valinvec(value, recode_map)

Arguments

value

A single value to inspect, which is checked against the keys of a recode map.

recode_map

A named vector where the names represent the keys to check against. The values of the vector are ignored.

Value

A logical value: 'TRUE' if the 'value' is a key in the 'recode_map', otherwise 'FALSE'.

Examples

recode_map <- c(male = "M", female = "F")
inspect_valinvec("female", recode_map) # TRUE - "female" is a key in the recode map
inspect_valinvec("other", recode_map) # FALSE - "other" is not a key in the recode map

trustmebro documentation built on June 8, 2025, 11:01 a.m.