View source: R/dinamic.R View source: R/recodeBinary.R
recodeBinary | R Documentation |
Recode binary vectors
recodeBinary(binary.vec, k)
binary.vec |
A binary vector of length |
k |
A positive integer. |
This function is called internally by peeling
.
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.
test = c(1, 0, 0, 1, 1, 0, 0, 1, 0)
recodeBinary(test, 5)
#Returns (0, 0, 0, 1, 1, 0, 0, 0, 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.