Skip to contents

Replace a boolean

Usage

replace_boolean(x, true_value = NULL, false_value = NULL)

Arguments

x

A boolean vector

true_value

A single value, that will replace TRUE values

false_value

A single value, that will replace FALSE values

Value

A numeric value

Examples


replace_boolean(c(T,T,T,F,F),1,2)
#> [1] 1 1 1 2 2