roxygen3 (version 0.1)

object_from_call: [DEV] Given a call that modifies the R environment, find the object that it creates.

Description

This function is aimed primarily at developers extending this package. You shouldn't need to use it for everyday operation.

Given a call that modifies the R environment, find the object that it creates.

Usage

object_from_call(call, env, srcref)

Arguments

call
unevaluated function call
env
environment in which to evaluate function call

Value

a list giving the name and value of the object that the call creates. NULL is returned if the call doesn't modify the package environment in a way that roxygen recognises.

Details

object_from_call works in a pseudo-S3 manner - given a call like f(a, b, c) it will call object_from_call.f.

Examples

Run this code
a <- 1
object_from_call(quote(a <- 1), environment())

Run the code above in your browser using DataLab