Home > Software design >  Extract input of a function in R
Extract input of a function in R

Time:02-17

I wonder if there might be a way to extract the input value (1:3) used in a after running object a?

library(clubSandwich)

a <- constrain_equal(1:3)

Desired output: vector 1:3

CodePudding user response:

Looks like

environment(a)$constraints

works for your example (ls(environment(a)) shows you which objects are available).

  • Related