powered by
A circular shift
rotate(x, n)
The binary number to rotate. (binary or logical vector).
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
# NOT RUN { x <- as.binary(c(1,0,0,1,1,1,0,1), logic=TRUE); x rotate(x,1) rotate(x,2) # }
Run the code above in your browser using DataLab