On Wed, Jul 14, 2010 at 7:39 AM, thmsfuller...@gmail.com
<thmsfuller...@gmail.com> wrote:
> Hi All,
>
> The last line if the following code returns the error right below this
> paragraph. Essentially, I use the operator %:% to retrieve a variable
> in a nested frame. Then I want to use the same operator (with '<-') to
> change its value.  I'm not sure if this is possible in R with %:%
> operator. Would you please help and let me how to correct the code if
> it is possible?

Why not just do

e1$e2$a <- 3

?

If you are trying to do something more complicated, it may help to
understand that e1 %:% e2 %:% a <- 3 is effectively the same as

tmp1 <- e1 %:% e2
tmp1 %:% a <- 3

tmp2 <- e1
tmp2 %:% e2 <- tmp1

e1 <- tmp2

so your %:%<- function is going to get called multiple times.

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-help@r-project.org 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.

Reply via email to