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

From: Patrick Connolly <p_connolly_at_ihug.co.nz>
Date: Thu 28 Sep 2006 - 10:51:51 GMT


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 visible.

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

http://www2.dpi.qld.gov.au/fieldcrops/14715.html

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?

TIA

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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu Sep 28 20:54:35 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 28 Sep 2006 - 11:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.