bash: Take a Bash

Description Usage Arguments Examples

View source: R/bash.R

Description

Equivalent to tryCatch().

Usage

1
bash(expr, e = NULL, w = NULL)

Arguments

expr

Expression to run, passed to tryCatch().

e, w

An object of class Error or Warning as returned by e() or w().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
safe_log <- function(x){
 result <- bash(log(x))
 
 if(is.e(result))
   stop(result$stop())

 return(result)
} 

if(interactive())
 safe_log("a")

erratum documentation built on Jan. 4, 2022, 1:08 a.m.