rotate {binaryLogic} | R Documentation |
A circular shift
rotate(x, n)
x |
The binary number to rotate. (binary or logical vector). |
n |
The number of bits to rotate. |
rotates the vector from left to right. The value from MSB is used to fill up the vector at LSB. Returns a binary/logical vector.
shiftLeft and shiftRight
x <- as.binary(c(1,0,0,1,1,1,0,1), logic=TRUE); x rotate(x,1) rotate(x,2)