[R] language inconsistency puzzle (in the tradition of Bill Venables (Hi Bill) puzzle "what is x")

oehl_list@gmx.de oehl_list at gmx.de
Thu Nov 7 20:10:54 CET 2002


> # let's say we have two vectors a and b
> # lets make a copy of a 
> 
> a2 <- a
> 
> # not surprisingly
> identical(a[b], a2[b])
[1] TRUE
> 
> # now assigning same to same
> a[b] <- a2[b]
> 
> # and SURPRISE
> identical(a, a2)
[1] FALSE
> 

WHAT IS a AND b ?

Hint: this "works" under 1.5.1 and 1.6.1. 
However, the final value of a will differ between 1.5.1 and 1.6.1 under
certain circumstances. Explain why it is both, DOUBLY INCONSISTENT AND
UNAVOIDABLE.

BTW, the prototype does the same. 

The serious side of this: I think the situation deserves at least a WARNING.

Best


Jens Oehlschlägel


-- 



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list