https://github.com/hadley/dplyr
Tip revision: 8dbb0990790a49199dba8bb5a7463569798fe93d authored by Romain François on 30 January 2014, 00:45:21 UTC
bullet pojnts in NEWS
bullet pojnts in NEWS
Tip revision: 8dbb099
failwith.Rd
\name{failwith}
\alias{failwith}
\title{Fail with specified value.}
\usage{
failwith(default = NULL, f, quiet = FALSE)
}
\arguments{
\item{default}{default value}
\item{f}{function}
\item{quiet}{all error messages be suppressed?}
}
\value{
a function
}
\description{
Modify a function so that it returns a default value when
there is an error.
}
\examples{
f <- function(x) if (x == 1) stop("Error!") else 1
\dontrun{
f(1)
f(2)
}
safef <- failwith(NULL, f)
safef(1)
safef(2)
}
\seealso{
\code{\link[plyr]{try_default}}
}
\keyword{debugging}