Learn R Programming

JointAI (version 1.1.0)

two_value_to_factor: Convert two-value vectors to factors

Description

Convert two-value vectors to factors

Usage

two_value_to_factor(x)

Value

the vector converted to a factor if it has exactly two unique (non-missing) values and is not already a factor; otherwise the input

Arguments

x

a vector