[BioC] RangedData negative row subscript

Charles C. Berry cberry at tajo.ucsd.edu
Tue Feb 2 19:00:42 CET 2010



I was expecting rd[ -1 , ] to be a RangedData object that contained all 
but the first row:


> rd <- RangedData(IRanges(start=1:20,width=2),space=rep(letters[1:4],5))
> rd[['one']] <- 'one'
> rd[1:2,] # OK
RangedData with 2 rows and 1 value column across 4 spaces
         space    ranges |         one
   <character> <IRanges> | <character>
1           a    [1, 2] |         one
2           a    [5, 6] |         one
> rd[ 1:2, -1 ] # OK
RangedData with 2 rows and 0 value columns across 4 spaces
         space    ranges |
   <character> <IRanges> |
1           a    [1, 2] |
2           a    [5, 6] |
> rd[ -1:1, ] # OK
Error in rd[-1:1, ] :
   selecting rows: negative and positive indices cannot be mixed
> rd[ -(1:4), ] # Not what I wanted and no warning
RangedData with 0 rows and 1 value column across 4 spaces
>

This seems like a bug.

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