[prev in list] [next in list] [prev in thread] [next in thread]
List: bioc-devel
Subject: Re: [Bioc-devel] runmean and NAs
From: "Hahne, Florian" <florian.hahne () novartis ! com>
Date: 2012-07-11 10:17:28
Message-ID: CC231F44.5485%florian.hahne () novartis ! com
[Download RAW message or body]
Great, thanks a bunch!
--
On 7/10/12 10:31 PM, "Valerie Obenchain" <vobencha@fhcrc.org> wrote:
>Hi Florian,
>
>It has been on my TODO and II've just started working on this.
>
>On 07/10/2012 02:19 AM, Hahne, Florian wrote:
>> 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?
>
>Currently no. The Inf creates a numeric Rle
>
> > Rle(c(1:100, Inf))
>'numeric' Rle of length 101 with 101 runs
> Lengths: 1 1 1 1 1 1 1 1 ... 1 1 1 1 1
>1 1 1
> Values : 1 2 3 4 5 6 7 8 ... 94 95 96 97 98 99
>100 Inf
>
>so the code executed is Rle_real_runsum which has this check,
>
>// calculate stat
>if (i == 0) {
> if (!R_FINITE(*curr_value))
> error("some values are NA, NaN, +/-Inf");
>
>While I am in there I will address this Inf issue too.
>
>Valerie
>>
>> Thanks,
>> Florian
>>
>> _______________________________________________
>> Bioc-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>
_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic