Simon Harmel
Simon Harmel

Reputation: 1489

Extract input of a function in R

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

Upvotes: 0

Views: 230

Answers (1)

Ben Bolker
Ben Bolker

Reputation: 226722

Looks like

environment(a)$constraints

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

Upvotes: 3

Related Questions