Displaying 2 results from an estimated 2 matches for "ifelsehw".
Did you mean:
ifelse
2016 Nov 26
3
ifelse() woes ... can we agree on a ifelse2() ?
...urns TRUE. Maybe use
if(!is.object(test))
instead of
if(is.atomic(test)) .
On ifelse-checks.R:
* In function 'chkIfelse', if the fourth function argument names is not "NA.", the argument name is changed, but the function body still uses the old name. That makes error in chkIfelse(ifelseHW) .
A fix:
? ? ? ? if(names(formals(FUN))[[4]] != "NA.") {
? ? ? ? ? ? body(FUN) <- do.call(substitute, list(body(FUN),
? ? ? ? ? ? ? ? setNames(list(quote(NA.)), names(formals(FUN))[[4]])))
? ? ? ? ? ? names(formals(FUN))[[4]] <- "NA."
? ? ? ? }
After fixing, chkIfelse(ife...
2016 Nov 28
0
ifelse() woes ... can we agree on a ifelse2() ?
...en more classes of "yes" and "no".
> On ifelse-checks.R:
> * In function 'chkIfelse', if the fourth function argument names is not "NA.", the argument name is changed, but the function body still uses the old name. That makes error in chkIfelse(ifelseHW) .
> A fix:
> ? ? ? ? if(names(formals(FUN))[[4]] != "NA.") {
> ? ? ? ? ? ? body(FUN) <- do.call(substitute, list(body(FUN),
> ? ? ? ? ? ? ? ? setNames(list(quote(NA.)), names(formals(FUN))[[4]])))
> ? ? ? ? ? ? names(formals(FUN))[[4]] <- "NA...