flip {cppcontainers}R Documentation

Toggle boolean values

Description

Toggle boolean values in a vector.

Usage

flip(x)

Arguments

x

A CppVector object of type boolean.

Details

Sets TRUE to FALSE and FALSE to TRUE.

Value

Invisibly returns NULL.

See Also

cpp_vector.

Examples

v <- cpp_vector(c(TRUE, TRUE, FALSE))
v
# TRUE TRUE FALSE

flip(v)
v
# FALSE FALSE TRUE


[Package cppcontainers version 1.0.0 Index]