transform_01_to_ft {vvconverter}R Documentation

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)

Arguments

x

the vector to be tested and transformed.

Value

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

See Also

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

Other booleans: test_01()

Examples

vector <- c(0, 1, 0, 1, 1, 1, 0)
transform_01_to_ft(vector)

[Package vvconverter version 0.5.10 Index]