Skip to content

Instantly share code, notes, and snippets.

@sirusb
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sirusb/d9cc7f40b6e11c4577d7 to your computer and use it in GitHub Desktop.
Save sirusb/d9cc7f40b6e11c4577d7 to your computer and use it in GitHub Desktop.
Rle example
# ننشئ شعاع يحتوي على أرقام من 1 إلى 10 بطول 40
x<- sort(sample(1:10,40,replace=T))
head(x)
#[1] 1 1 1 1 1 1
# Rle لحفضه
x <- Rle(x)
x
#integer-Rle of length 40 with 10 runs
# Lengths: 6 2 1 3 4 5 6 9 2 2
# Values : 1 2 3 4 5 6 7 8 9 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment