FM_tc {formods}R Documentation

Run Try/Catch and Process Results

Description

Attempts to execute the text in cmd. This is done in a try/catch environment to capture any errors.

Usage

FM_tc(cmd, tc_env, capture)

Arguments

cmd

Character object containing the R command to evaluate in the try/catch block

tc_env

list of with names corresponding to object names and corresponding Values to define in the try/catch environment

capture

Character vector of values to capture after the command is successfully captured

Value

list with the following fields:

Examples

# Successful command
res_good = FM_tc("good_cmd=ls()", list(), c("good_cmd"))
res_good

# Failed command
res_bad = FM_tc("bad_cmd =not_a_command()", list(), c("bad_cmd"))
res_bad

[Package formods version 0.1.4 Index]