Hi, thanks for your post, I tried what you said, and it runs, however when I type summary ... I obtain the following: What's happening? How can I solve it?
lmod1.lm <- tryCatch(lm(log(dat$inaltu)~log(dat$indiam),na.action=na.fail),error=function(err){NA}) summary(lmod1.lm, corr= TRUE) Mode NA's logical 1 > anova(lmod1.lm) Error en UseMethod("anova") : no applicable method for 'anova' applied to an object of class "logical" u...@host.com plot(lmod1.lm, which=1:4)u...@host.com Error en plot.window(...) : se necesitan valores finitos de 'ylim' Además: Mensajes de aviso perdidos 1: In min(x) : ningún argumento finito para min; retornando Inf 2: In max(x) : ningun argumento finito para max; retornando -Inf 3: In plot.window(...) : "which" is not a graphical parameter -- View this message in context: http://r.789695.n4.nabble.com/Returning-NA-from-lm-tp880442p3309163.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list 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.