Learn R Programming

cppcontainers (version 1.0.4)

flip: Toggle boolean values

Description

Toggle boolean values in a vector.

Usage

flip(x)

Value

Invisibly returns NULL.

Arguments

x

A CppVector object of type boolean.

Details

Sets TRUE to FALSE and FALSE to TRUE.

See Also

cpp_vector.

Examples

Run this code
v <- cpp_vector(c(TRUE, TRUE, FALSE))
v
# TRUE TRUE FALSE

flip(v)
v
# FALSE FALSE TRUE

Run the code above in your browser using DataLab