[BioC] BUG: median(IRanges::Rle(NA),na.rm=TRUE)) should return NA

Cook, Malcolm MEC at stowers.org
Wed Sep 4 16:28:29 CEST 2013


Hi,

I think the Rle functions should preserve semantics from stats.  

Here is at least one case where they do not:

> median(Rle(NA),na.rm=TRUE)
Error in x[FALSE] : subscript out of bounds

# but:

> median(c(NA),na.rm=TRUE)
[1] NA

# some other border cases:

> median(c())
NULL
# arguably correct, if you read the docs and appreciate that as(NA,class(c())) is NULL

> median(Rle())
Error in x[FALSE] : subscript out of bounds
# should probably be NULL


Agreed?

Can be fixed?

Thanks!

~ Malcolm Cook 
Computational Biology / Shilatifard Lab - Stowers Institute for Medical Research - Kansas City



More information about the Bioconductor mailing list