Resolves a call to the function that really runs (following S3 dispatch), walks its internal call tree, and reports how replayable the call would be as standalone code, together with a static security scan of the involved functions.
Arguments
- expr
An unevaluated function call, written as you would normally run it, e.g.
predict(fit, newdata = recent_data)orstats::fivenum(x). For S3 generics the dispatch argument can be evaluated once to determine the method, controlled byeval_dispatch.- max_depth
Maximum depth to follow same-package internal helpers.
- eval_dispatch
Should a computed (call-shaped) dispatch argument be evaluated once to resolve the S3/S4 method? The default
TRUEgives accurate method resolution but executes that piece of your code; the printed output says so whenever it happens. SetFALSEto leave computed dispatch unresolved and analyze the generic itself. Bare symbols are still inspected to resolve dispatch and may force a promise binding; literals are inspected directly.
Value
An object of class insider_explain with components resolution
(the resolved function and method), tree (the static call tree),
status (replay feasibility), and audit (a data frame of risky calls
found by the static scan).
Examples
x <- c(1, 3, 5, 7, 100)
explain_call(stats::fivenum(x))
#>
#> ── insideR call explanation ────────────────────────────────────────────────────
#> Original call: `stats::fivenum(x)`
#> Executing function: `fivenum()` from stats
#>
#> ── Function path ──
#>
#> fivenum()
#> ── Replay status ──
#>
#> Full standalone replay looks possible.
#>
#> ── Security notes (static scan) ──
#>
#> No risky calls detected by the static scan.