From Martin Maechler <maechler@stat.math.ethz.ch>  Thu Mar 25 13:12:48 1999
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Thu, 25 Mar 1999 14:12:48 +0100
Subject: [R] Change of parsing parameters to functions between 0.63.1  and 0.63.3 ?
In-Reply-To: <x2lnglzrn0.fsf@blueberry.kubism.ku.dk> (message from Peter
 Dalgaard BSA on 25 Mar 1999 13:21:39 +0100)
References: <Pine.GSO.4.05.9903241827480.6272-100000@auk.stats> <x2lnglzrn0.fsf@blueberry.kubism.ku.dk>
Message-ID: <199903251312.OAA06684@sophie.ethz.ch>

>>>>> "PD" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:

    PD> Prof Brian D Ripley <ripley@stats.ox.ac.uk> writes:
    >> On Wed, 24 Mar 1999, Athula Herath wrote:
    >> 
    >> > I wonder whether the mechanism of parsing parameters to functions
    >> has > changed between 0.63.1 and 0.63.3? The following code yeilds
    >> different
    >> 
    >> No, but the handling of attributes has.
    >> 
    >> > results in R 0.63.1 (Version 0.63.1 (Dec 5, 1998)) and R 0.63.3.
    >> > 
    >> > cave<-function(x,a,b) > { >
    >> return(c(mean(x[a],na.rm=T),mean(x[b],na.rm=T))) > } > datx <-
    >> data.frame(rbind(c(1,2,3,4),c(4,5,6,7))) >
    >> names(datx)<-c("A","B","C","D") > f1<-c("A","C") > f2<-c("B","D") >
    >> t1<-apply(datx,1,cave,f1,f2)
    >> 
    >> The help page for apply says

    PD> (moved to R-devel)

    PD> Hmm. I actually committed my patch for apply() before seeing Brians
    PD> reply. Given that

    PD> (a) The above code works as intended in Splus 3.4

    PD> (b) This is more or less orthogonal to the issue of having
    PD> attributes to the result of a subsetting operation (it has to do
    PD> with attributes on the arguments to FUN, not the result).

    PD> (c) Some effort was already being used in the case of more-than-one
    PD> dimensional slices to get the names passed down [using
    PD> array(newX[,i], d.call, dn.call) with dn.call containing the names]
    
    PD> ..should I consider that a bad move?
		           ^^^^^^
			   (your patch)
Yes, I actually think
your patch should be reverted ___ especially since it even breaks
     example(apply)

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


[R] Change of parsing parameters to functions between 0.63.1 and 0.63.3 ?
Martin Maechler