powered by
Recode binary vectors
recodeBinary(binary.vec, k)
A binary vector of length m that contains a single contiguous string of 1's, namely the string that contains the 1 in the kth position of binary.vec.
A binary vector of length m (>= 1) whose kth entry is 1.
m
k
A positive integer.
This function is called internally by peeling.
peeling
test = c(1, 0, 0, 1, 1, 0, 0, 1, 0) recodeBinary(test, 5) #Returns (0, 0, 0, 1, 1, 0, 0, 0, 0)
Run the code above in your browser using DataLab