My obj does not always come with a logical variable defined. So I do

my.foo <- function(obj,df,digits=5){
if (!is.na("obj$spec$Fisher")) Fisher<-obj$spec$Fisher
...
}

This works when "Fisher" is defined in/passed from obj. When it is not, I get error:

Error in (!is.na("obj$spec$Fisher")) & Fisher :
  operations are possible only for numeric, logical or complex types

I tried exist(Fisher), missing(Fisher)... to no vail. Any idea? Thanks.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to