RangedData negative row subscript
1
0
Entering edit mode
Charles Berry ▴ 290
@charles-berry-5754
Last seen 5.0 years ago
United States
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
• 736 views
ADD COMMENT
0
Entering edit mode
@michael-lawrence-3846
Last seen 2.3 years ago
United States
This bug has already been fixed in the devel version. Thanks for reporting it, Michael On Tue, Feb 2, 2010 at 10:00 AM, Charles C. Berry <cberry@tajo.ucsd.edu>wrote: > > > 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@tajo.ucsd.edu UC San Diego > http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901 > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 735 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