Skip to content
Prev 247709 / 398521 Next

Parameters/data that live globally

On Tue, 18 Jan 2011, analyst41 at hotmail.com wrote:

            
Sure.

But probably better to work in R as the developers intended, rather than 
trying to simulate COMMON blocks per se.

See

 	?list
 	?environment
 	?search
 	10.7 Scope in Intro to R
 	?get
 	?assign

You can collect objects in an environment and pass it to a function or put 
it in the search path. Then you can get/assign objects.

Probably it is easier to work with a list. Here is a toy example
$y
[1] 4 5

$x
[1] 5 6
HTH,

Chuck
Charles C. Berry                            Dept of Family/Preventive Medicine
cberry at tajo.ucsd.edu			    UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901