A run is a consecutive sequence of repeated values or observations. For repeated values, R's "run-length encoding" concisely describes a vector in terms of its runs. Consider:
dat <- c(1, 2, 2, 2, 3, 1, 4, 4, 1, 1)
We have a length-one run of 1s; then a length-three run of 2s; the...