Learn R Programming

crunch (version 1.18.0)

ContextManager: Context managers

Description

Context managers

Usage

ContextManager(enter = function() { }, exit = function() { },
  error = NULL, as = NULL)

Arguments

enter

function to run before doing things

exit

function to run after doing things

error

optional function to run if an error is thrown

as

character optional way to specify a default name for assinging the return of the enter function.

Value

an S3 class "contextManager" object

See Also

with-context-manager