Thank you a lot!!! That was fantastic! It worked perfectly!!!
Laura

Hi Laura,

try using the functions try() and inherits() to "catch" any errors in the loop:


summaryList <- list()
for (i in 1:35)
{
    tempSummary <- try(summary(resultList[[i]]), silent = TRUE)
    if (inherits(tempSummary, "try-error"))
    {
        summaryList[[i]] <- NA
    } else {
        summaryList[[i]] <- tempSummary
    }
}


I hope you can make it work?! :-)

Christian

______________________________________________
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.

Reply via email to