Entering edit mode
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