yesno_to_logical: Convert Yes/No values to logical

View source: R/converters.R

yesno_to_logicalR Documentation

Convert Yes/No values to logical

Description

A helper function to convert a two-valued character vector to a logical vector.

Usage

yesno_to_logical(x, yn = c("I", "N"), na_to_false = FALSE)

Arguments

x

A character vector.

yn

A character vector of length 2, containing the strings for "yes" (first element) and "no" (second element). Defaults to Hungarian shorthand for "igen" and "nem".

na_to_false

Convert NAs to FALSE?

Value

A logical vector


svraka/asmisc documentation built on June 12, 2025, 12:04 p.m.