bug in functions of form "mcpar<-"

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
17 Jun 1998 19:37:41 +0200


Martyn Plummer <plummer@iarc.fr> writes:

> 
> This fairly harmless looking piece of code, which worked in
> 0.61 (and in S-PLUS) fails  in 0.62.1. 
> 
> R> "mcpar<-" <- function(x,mcpar) {attr(x,"mcpar") <- mcpar; x}
> R> mcpar(x) <- c(1,100,1)
> Error in mcpar<-(*tmp*, value = c(1, 100, 1)) : unused argument to function
> 
> The error message gives a hint about how to work around the problem -
> just replace the argument "mcpar" with "value". 
> 
> R> "mcpar<-" <- function(x,value) {attr(x,"mcpar") <- value; x}
> R> mcpar(x) <- c(1,100,1)
> R> 
> 
> This breaks release 0.3-3 of my "coda" package, but I will fix it.
> Martyn

Hmm. We had some pretty antisocial consequences from *not* using the
value= form with John Chambers' [<-.data.frame code, which assumes
that it is used that way in order to see whether i,j, or both are
absent. 

So Splus is using value= on indexing operations only?

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