zap_srcref: Zap source references

View source: R/attr.R

zap_srcrefR Documentation

Zap source references

Description

There are a number of situations where R creates source references:

  • Reading R code from a file with source() and parse() might save source references inside calls to function and ⁠{⁠.

  • sys.call() includes a source reference if possible.

  • Creating a closure stores the source reference from the call to function, if any.

These source references take up space and might cause a number of issues. zap_srcref() recursively walks through expressions and functions to remove all source references.

Usage

zap_srcref(x)

Arguments

x

An R object. Functions and calls are walked recursively.


rlang documentation built on June 22, 2024, 9:31 a.m.