[Bioc-devel] runmean and NAs

Hahne, Florian florian.hahne at novartis.com
Tue Jul 10 11:19:16 CEST 2012


Hi all,
I was asking a while ago whether it would be possible for the runmean
function to deal with NA values. Is that still on somebody's radar?
Something similar to na.rm would be great. Haven't checked the source code
for Rle_runsum yet, but ignoring Nas seems to be a straightforward thing
to do. Currently I get

> runmean(Rle(c(1:100, NA)), 10)
Error in .Call2("Rle_runsum", x, as.integer(k), PACKAGE = "IRanges") :
  some values are NA


On a related note, why is this not working?
> runmean(Rle(c(1:100, Inf)), 10)
Error in .Call2("Rle_runsum", x, as.integer(k), PACKAGE = "IRanges")
some values are NA, NaN, +/-Inf


Shouldn't that simply return Inf for the respective vector elements?


Thanks,
Florian



More information about the Bioc-devel mailing list