Learn R Programming

Xmisc (version 0.2.1)

character_to_logical: Convert a character string to logical.

Description

Convert a character string to logical.

Usage

character_to_logical(x, ignore.case = TRUE)

Arguments

x
character
ignore.case
logical, whether case is ignored

Value

logical. TRUE for "y","yes","t","true" and "1"; FALSE for "n","no","f","false" and "0".

Examples

Run this code
character_to_logical("yes")
try(character_to_logical("hi"))

Run the code above in your browser using DataLab