Skip to content
Prev 395388 / 398502 Next

Dynamically create a (convenience) function in a package

If you don't know the name of the attributes in advance, how can you know
the function name to be able to call it? This seems like a very flawed
approach.

Also, I would discourage the use of eval(parse(text = )), it's almost
always not the right way to do what you want to do. In your case,

eval(bquote(function(x) attr(x, .(n))))

would be better.


On Mon, Oct 30, 2023, 06:28 Sigbert Klinke <sigbert at wiwi.hu-berlin.de>
wrote: