1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/try.R
\name{\%except\%}
\alias{\%except\%}
\title{Try to evaluate an expressions and evaluate another expression on
exception}
\usage{
try \%except\% except
}
\arguments{
\item{try}{R expression}
\item{except}{fallback R expression to be evaluated if \code{try} fails}
}
\description{
Try to evaluate an expressions and evaluate another expression on
exception
}
\note{
Suppress log messages in the \code{except} namespace if you don't
want to throw a \code{WARN} log message on the exception branch.
}
\examples{
everything \%except\% 42
everything <- "640kb"
everything \%except\% 42
FunDoesNotExist(1:10) \%except\% sum(1:10) / length(1:10)
FunDoesNotExist(1:10) \%except\% (sum(1:10) / length(1:10))
FunDoesNotExist(1:10) \%except\% MEAN(1:10) \%except\% mean(1:10)
FunDoesNotExist(1:10) \%except\% (MEAN(1:10) \%except\% mean(1:10))
}
|