x <- Rle(10:1, 1:10)
x
runLength(x)
runValue(x)
nrun(x)
diff(x)
unique(x)
sort(x)
x[c(1,3,5,7,9)]
x > 4
x2 <- Rle(LETTERS[c(21:26, 25:26)], 8:1)
table(x2)
y <- Rle(c(TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE,TRUE))
y
as.vector(y)
rep(y, 10)
c(y, x > 5)
Run the code above in your browser using DataLab