From p.dalgaard@biostat.ku.dk  Wed Apr 10 15:27:00 2002
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 10 Apr 2002 16:27:00 +0200
Subject: [Rd] Strange assignment bug (PR#1450)
In-Reply-To: <200204101336.PAA09300@pubhealth.ku.dk>
References: <200204101336.PAA09300@pubhealth.ku.dk>
Message-ID: <x28z7v7hor.fsf@blueberry.kubism.ku.dk>

G.Innocent@vet.gla.ac.uk writes:

> 6) The above code appears to be the minimum of code required to reproduce
> the results on my machine.

You can do better than that:

> f
function(A) {
  A$p[1] <- 2
  E <- A$p 
  E[1:2] <- 0.1*A$p[2:3]
  return(A)
}
> x
  p
1 0
2 1
3 2
> f(x)
    p
1 0.1
2 0.2
3 2.0

Notice that the last line changing E is effectively changing A$p, so
something is up with our duplication-avoidance scheme. Luke?

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


[Rd] Strange assignment bug (PR#1450)
Peter Dalgaard BSA