From p.dalgaard@biostat.ku.dk  Tue Nov  2 10:55:32 1999
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 02 Nov 1999 11:55:32 +0100
Subject: problem with "[[<-" (PR#306)
In-Reply-To: saikat@stat.wisc.edu's message of "Mon, 1 Nov 1999 23:16:29 +0100 (MET)"
References: <199911012216.XAA01868@pubhealth.ku.dk>
Message-ID: <x2bt9dkvrv.fsf@blueberry.kubism.ku.dk>

saikat@stat.wisc.edu writes:

> This works in 0.65.1 but not in 0.90.0.
> 
> > form <- ~ a | b
> > form[[2]][[3]] <- as.name("u")
> Error: Object "u" not found

Ow! Obviously, eval() is called once too many. Robert?

The problem is that one gets to

"[[<-"(*tmp*, 3, value = u)

and the evaluator naturally tries to evaluate u.

> I can get around this as follows
> 
> > form.1 <- form[[2]]
> > form.1[[3]] <- as.name("u")
> > form[[2]] <- form.1
> > form
> ~a | u

..or form[[2]][[3]]<-quote(quote(u)), but that one is not likely to
last through a bugfix.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


problem with "[[<-" (PR#306)
Peter Dalgaard BSA