View source: R/inspect_valinvec.R
inspect_valinvec | R Documentation |
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.
inspect_valinvec(value, recode_map)
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. |
A logical value: 'TRUE' if the 'value' is a key in the 'recode_map', otherwise 'FALSE'.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.