From thomas@biostat.washington.edu  Wed Aug 13 17:21:00 1997
From: thomas@biostat.washington.edu (Thomas Lumley)
Date: Wed, 13 Aug 1997 09:21:00 -0700 (PDT)
Subject: R-alpha: Matrix: I surrender
In-Reply-To: <199708130823.KAA01224@aragorn.ci.tuwien.ac.at>
Message-ID: <Pine.SUN.3.95.970813085249.1515A-100000@zen>


To make what I was saying a little clearer, the fact that eg
y<-x[vec,]
y[1,]
returns an error if vec is of length 1 (or has one T, &c) is compatible
with S, but not with what most people expect when writing programs.
Statements like y<-x[vec,] nearly always need drop=F as otherwise any
future references to y must have special cases to handle vectors. 

The problem is that we should have drop=F when indexing by vectors that
happen to be of length 1 and drop=T when indexing by scalars. I suppose
it's reasonable to say that programmers can take care of themselves and we
should choose the best default for interactive use, which is certainly
drop=T. 

Perhaps we just need a mental health warning in the documentation and/or
the faq to remind programmers that array dimensions can vanish whenever
you subset. 

Also

Kurt wrote:
> 
> * Thomas, if you have ports of the above software, could you PLEASE
> package them?  (Btw, I have a finished `port' of the V&R `classif'
> library, and of the `clus' library which comes with the paper on JSS.)
> 

 I have ported the addreg library, with additions (and sent it back to
 Harald Fekjaer, who should be releasing it Real Soon Now).  The linear
 discrimination code I referred to is long obsolete and has been fixed (I
 saw it in 1992, I think). I'm intermittently working on the bayesian
 model averaging code, which was the major reason for creating the "leaps" 
 subset selection library. 


Thomas Lumley
-----------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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-alpha: Matrix: I surrender
Thomas Lumley