powered by
Try to evaluate an expression and return a default value if an error occurs or otherwise return its value.
tryEval(expr, def = NULL)
the expression to evaluate
the default value if an error occurs in the evaluation of expr
expr
# NOT RUN { x <- list(a=c(x=1,y=2),b=c(x=2,p=3)) list.map(x, tryEval(x+y, NA)) # }
Run the code above in your browser using DataLab