Learn R Programming

vvconverter (version 0.7.0)

transform_01_to_ft: Transform 01 to FT

Description

If the vector is a 0/1 vector, it is converted to a logical one TRUE/FALSE vector. This transformation is performed only if the vector contains only values 0, 1, or NA. If this is not the case returns the original variable. This transformation can be done on numeric, string, and factor vectors.

Usage

transform_01_to_ft(x)

Value

The transformed vector if a transformation is possible. If no transformation is possible, the original vector returned.

Arguments

x

the vector to be tested and transformed.

See Also

Other vector calculations: academic_year(), clean_multiple_underscores(), interval_round(), month_name(), sum_0_1()

Other booleans: test_01()

Examples

Run this code
vector <- c(0, 1, 0, 1, 1, 1, 0)
transform_01_to_ft(vector)

Run the code above in your browser using DataLab