incadata (version 0.5.3)

is.incalogical: Coerce to logical if value is logical according to INCA

Description

It is common that check boxes are blanks by default but that this should be interpreted as TRUE. There are however some uncommon cases were the boxes are instead marked with "False" if FALSE, but otherwise left blank. We can therefore not be certain of a blank value and will therefore treat it as NA.

Usage

is.incalogical(x)

incalogical2logical(x)

Arguments

x

vector

Value

is.incalogical returns TRUE if the vector is logical according to INCA:s internal rules, FALSE otherwise. incalogical2logical returns a logical vector if x can be coerced to such.

Details

Note that logical vectors in INCA will behave differently when used internally in INCA. This is handled by the functions. or w

Examples

Run this code
# NOT RUN {
is.incalogical(c("", "", "True", ""))  # TRUE
is.incalogical(c("", "False", "", "")) # TRUE
is.incalogical(c("", "FALSE", "", "")) # FALSE
is.incalogical(logical(2)) # will be recognised as well
# }

Run the code above in your browser using DataLab