[BioC] unexpected result of rep(Rle(), times=<vector or Rle>)

Charles C. Berry cberry at tajo.ucsd.edu
Sun Jan 31 21:40:52 CET 2010


Using IRanges_1.4.0 here (checked elsewhere with 1.4.8):

I would expect

 	rep( Rle(x), times=Rle(x) ) == Rle( rep(x, x) )

but

> x <- rep(1:4,c(1,2,1,2))
> Rle(rep(x,x))
'integer' Rle of length 16 with 4 runs
   Lengths:  1 4 3 8
   Values :  1 2 3 4
> rep(Rle(x),times=Rle(x))
'integer' Rle of length 18 with 4 runs
   Lengths:  1 5 3 9
   Values :  1 2 3 4
> rep(Rle(x),times=x)
'integer' Rle of length 18 with 4 runs
   Lengths:  1 5 3 9
   Values :  1 2 3 4
>

Is this the intended behavior?

If so, why?

Chuck



Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901



More information about the Bioconductor mailing list