Dear All!
If I pass an object to an assignment function I cannot get it's name by
deparse(substitute(argument)), but I get *tmp* and I found no way to get
the original name, in the example below it should be va1.
Is there a way?
Thanks,
Heinz
## example
'fu1-' - function(var, value) {
If you are willing to write fu2[Var] - 3 instead of fu2(Var) - 3
then this workaround may suffice:
fu2 - structure(NA, class = fu2)
[-.fu2 - function(x, ..., value) { print(match.call()[[3]]); fu2 }
# test
fu2[Var] - 3 # prints Var
On 7/27/06, Heinz Tuechler [EMAIL PROTECTED] wrote:
Dear
At 06:10 27.07.2006 -0400, Gabor Grothendieck wrote:
If you are willing to write fu2[Var] - 3 instead of fu2(Var) - 3
then this workaround may suffice:
fu2 - structure(NA, class = fu2)
[-.fu2 - function(x, ..., value) { print(match.call()[[3]]); fu2 }
# test
fu2[Var] - 3 # prints Var
Thank
The complexity of the function should not matter.
Here is another example of this technique:
http://tolstoy.newcastle.edu.au/R/help/04/06/1430.html
On 7/27/06, Heinz Tuechler [EMAIL PROTECTED] wrote:
At 06:10 27.07.2006 -0400, Gabor Grothendieck wrote:
If you are willing to write fu2[Var] - 3