Learn R Programming

MLmorph (version 0.1.1)

factorize_binary_vector: Turn binary vector into a factor

Description

Turn binary vector into a factor

Usage

factorize_binary_vector(data_vector, custom_labels = NULL)

Value

A factor with two levels in TRUE, FALSE order.

Arguments

data_vector

Logical vector.

custom_labels

Optional length-2 character vector: first for TRUE, second for FALSE.

Examples

Run this code
factorize_binary_vector(c(TRUE, FALSE, TRUE))

Run the code above in your browser using DataLab