shang stud <facS93 <at> mors.hampshire.edu> writes:

: 
: Hello all:
: 
: I wonder if there is a generic way to assign the name of a function as an
: attribute of the function. For example,
: 
: w = function(x) x^2;
: attr(w, "name") =  "w";
: 
: This assigns the name attribute of function w to be "w".
: 
: Would it be possible to put the second line of the code inside the
: function definition? I would like to avoid typing specifically the
: name, "w", when assigning the attribute.
: 

structure(function(x) x^2, name = "w")

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to