I will try to clarify my wish regarding apply. My wish is related to the dimension attribute of an object. Of course by the nature of apply the dimension may change, but as you can see in my artifical examples below the same apply-operation applied to a matrix does behave differently to that respect.
> dim(matrix(0,nrow=1,ncol=1)) [1] 1 1 > dim(apply(matrix(0,nrow=1,ncol=1),1,function(x) return(x))) NULL > dim(matrix(0,nrow=2,ncol=1)) [1] 2 1 > apply(matrix(0,nrow=2,ncol=1),1,function(x) return(x)) [1] 0 0 > dim(apply(matrix(0,nrow=2,ncol=1),1,function(x) return(x))) NULL > dim(matrix(0,nrow=1,ncol=2)) [1] 1 2 > dim(apply(matrix(0,nrow=1,ncol=2),1,function(x) return(x))) [1] 2 1 In these examples I would expect "matrix-dimensions" for all cases instead of no dimensions at all in the first two cases. A follow up apply-operation (expecting a matrix like object will fail) and programming is laborious. This is the reason why I am asking for an extension of apply like "drop=FALSE" as it exists for subsetting of arrays. ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-devel