try_default

0th

Percentile

Try, with default in case of error.

try_default wraps try so that it returns a default value in the case of error. tryNULL provides a useful special case when dealing with lists.

Keywords
internal
Usage
try_default(expr, default, quiet = FALSE)

tryNULL(expr)

Arguments
expr
expression to try
default
default value in case of error
quiet
should errors be printed (TRUE) or ignored (FALSE, default)
See Also

tryapply

Aliases
  • tryNULL
  • try_default
Documentation reproduced from package plyr, version 1.8.3, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.