Skip to content
Prev 199752 / 398502 Next

when vectorising does not work: silent function fail?

Have you tried something like this:

my.results = apply(chr, 2, function(x){
    result <- try(anova(lrm( cpstc.f ~ x + time.cpstc + age + sex + mri))[1,3])
    if (inherits(result, "try-error")) return(NULL)
    result
})

This should catch the error and have NULL in that list element.

On Tue, Nov 10, 2009 at 10:04 AM, Federico Calboli
<f.calboli at imperial.ac.uk> wrote: