cache.capture_warning: Capture Warning

View source: R/cache.R

cache.capture_warningR Documentation

Capture Warning

Description

Utility function for capturing warnings.

Usage

cache.capture_warning(w)

Arguments

w

Captured warning passed by withCallingHandlers.

Examples

# this will only have an effect if a current cache exists.
## Not run: 
  if(!cache.ok(1)) withCallingHandlers({
     x = mtcars # base-R dataset.
     x = mtcars # base-R dataset.
       warning('warning 2-1') # this is the first warning we need tdo capture. 
       warning('warning 2-2') # this is the first warning we need tdo capture. 
       save.cache(x) # we'll capture it inside svae.caceh
  }, warning = cache.capture_warning)

## End(Not run)


oliver-wyman-actuarial/easyR documentation built on Jan. 27, 2024, 4:35 a.m.