binary.swap: swap the 1's and 0's around

Description Usage Arguments Value Author(s) Examples

Description

swap the 1's and 0's around

Usage

1

Arguments

x

a numeric vector of 0/1

Value

a numeric vector like the input, but with 1's and 0's swapped.

Author(s)

Mark Cowley, 2011-09-02

Examples

1
2
3
4
5
6
7
input <- c(0,1,0,1)
binary.swap(input)
## Not run: 
binary.swap(c(input, NA))
# Error in binary.swap(c(input, NA)) : x must be 0's and 1's

## End(Not run)

drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.