Run Length Encoding

DESCRIPTION:

Computes the length and the value of runs of the same value in a vector or bdVector.

USAGE:

rle(x) 

REQUIRED ARGUMENTS:

x
vector or bdVector object.

VALUE:

a list containing:
length
a vector or bdVector containing the length of each run.
values
a vector or bdVector the same length as length, with the values of each run.

SEE ALSO:

.

EXAMPLES:

x <- c(16,16,16,16,8,8,8,4,4,2,32,32,32,32,32) 
rle(x) 
# Produces the following output:
# $lengths: 
# [1] 4 3 2 1 5 
# $values: 
# [1] 16  8  4  2 32