runs | R Documentation |
Identify runs of identical values in a vector
runs(x)
x |
A vector. |
An integer vector of the same length as x
,
where each value identifies the run to which
the same-position value in x
belongs.
Sercan Kahveci
myvec <- sample(letters[1:3],size=20,replace=TRUE)
cbind(myvec,runs(myvec))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.