Skip to content
Prev 8163 / 63424 Next

Odd outcome of attr with environments (PR#2148)

On Fri, 11 Oct 2002 j.c.rougier@durham.ac.uk wrote:

            
It's nothing to do with environments.  happy() is not an variable, so you
can't modify it: eg

R> f<-function(){ 42}
R> f()<-1
Error: invalid (NULL) left side of assignment
R> attr(f(),"foo")<-1
Error: invalid (NULL) left side of assignment
R> f()[1]<-1
Error: invalid (NULL) left side of assignment


	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._