[R-SIG-Finance] Compute jump test statistic

G See gsee000 at gmail.com
Mon Jun 18 23:40:29 CEST 2012


On Mon, Jun 18, 2012 at 4:38 PM, G See <gsee000 at gmail.com> wrote:
> What do you want to do with all of the NAs in your data.  You can't
> apply functions like max to data with NA
>
>> max(0, 1)
> [1] 1
>> max(NA, 1)
> [1] NA
>
> Maybe you want to use na.omit?
>
>> max(na.omit(c(NA, 0)), 1)
> [1] 1

or use `na.rm=TRUE`
> max(c(NA, 1), na.rm=TRUE)
[1] 1

> HTH,
> Garrett
>



More information about the R-SIG-Finance mailing list