On Dec 23, 2014, at 4:05 AM, Martin Maechler wrote:
>> Steven Yen
>>on Sun, 14 Dec 2014 09:30:56 -0500 writes:
>> Steven Yen
>>on Sun, 14 Dec 2014 09:30:56 -0500 writes:
>
>> Thanks. This worked!! :)
>> Fisher <- ifelse(!("Fisher" %in% names(obj$spec)), FALSE, obj$spec
Hi,
Sorry to chime in late, but here's an alternative solution, without
conditionals:
> obj <- list(spec=list("Fisher"=TRUE, "Tukey"=FALSE))
> obj$spec$Fisher
[1] TRUE
> !is.null(obj$spec$Fisher) && obj$spec$Fisher
[1] TRUE
> obj$spec$Pearson
NULL
> !is.null(obj$spec$Pearson) && obj$spec$
> On 23 Dec 2014, at 10:05 , Martin Maechler wrote:
>
>
> In cases like this one when the condition 'Cond' is a
> simple TRUE or FALSE (i.e. of length 1), using
>
> if(Cond) A else B
>
> instead of
>
> ifelse(Cond, A, B)
>
> is
>
> 1. much more R - like [[ "everything you do
> Steven Yen
> on Sun, 14 Dec 2014 09:30:56 -0500 writes:
> Steven Yen
> on Sun, 14 Dec 2014 09:30:56 -0500 writes:
> Thanks. This worked!! :)
> Fisher <- ifelse(!("Fisher" %in% names(obj$spec)), FALSE, obj$spec$Fisher)
"worked", yes.
But please --- for the mai
4 matches
Mail list logo