unexpected result of rep(Rle(), times=<vector or Rle>)
0
0
Entering edit mode
Charles Berry ▴ 290
@charles-berry-5754
Last seen 5.7 years ago
United States
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
• 888 views
ADD COMMENT

Login before adding your answer.

Traffic: 761 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6