Displaying 2 results from an estimated 2 matches for "localx".
Did you mean:
local
2002 May 17
1
What is the most efficient way to assign to PARTS of objects in other frames/environments?
Can please someone familiar with the R internals explain on the following:
PR#1434 from r-bugs clarifies that
assign("a[1]", x, SomeOtherFrame)
or
assign("a$a", x, SomeOtherFrame)
will NOT assign to an object 'a' in the other frame BUT create a new object
called 'a[1]' resp. 'a$a'.
This leads to the following question: what is the most
2002 May 17
0
What is the most efficient way to assign to PARTS of obje cts in other frames/environments?
...ext="a$a <- x"), envir=globalenv())
> > + }
> > > t1()
> > Error in eval(expr, envir, enclos) : Object "x" not found
> >
>
> Instead of
>
> assign("a$a",x,envir=SomeOtherFrame)
> you can do
> eval(substitute(a$a<-localx,localx=x),envir=SomeOtherFrame)
>
>
> -thomas
>
> Thomas Lumley Asst. Professor, Biostatistics
> tlumley at u.washington.edu University of Washington, Seattle
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-.-.-.-.-.-.-
> r-help mailing...