[R] Using assign() function as I did in Splus

Patrick Connolly p_connolly at ihug.co.nz
Thu Sep 28 12:51:51 CEST 2006

Years ago, when I used Splus, I used to do this sort of thing:

assign("data", data, frame = 1)

This was so that if the object data was used in, say a call to glm,
and I wished to do a summary of the glm object, data wasn't otherwise

Since I moved to R, the lexical scoping has virtually eliminated the
need to do that.  However, I've been trying to use the package samm 


It seems to me to be developed for Splus and ported to R (and then
mostly only for Windows).  There is a binary version for Linux, but
it's for R-1.9.x which means it's virtually useless.  There's a huge
number of functions in the package, and it's not easy to work out
what's producing what error.very

I suspect the problem isn't to do with using Windows instead of Linux
which I'm used to.  The only way I can make the required objects
visible is to assign them to pos = 1 which means they're debris to be
removed after the function finishes, and not a very elegant approach.

There's probably something tricky to do with environments I'm not
understanding here.  If I could replicate the frame = 1 idea, I'd feel
less of a klutz.  What would be a better approach?


   ___    Patrick Connolly   
 {~._.~}          		 Great minds discuss ideas    
 _( Y )_  	  	        Middle minds discuss events 
(:_~*~_:) 	       		 Small minds discuss people  
 (_)-(_)  	                           ..... Anon

More information about the R-help mailing list