From thomas@biostat.washington.edu  Mon Sep 22 23:08:54 1997
From: thomas@biostat.washington.edu (Thomas Lumley)
Date: Mon, 22 Sep 1997 15:08:54 -0700 (PDT)
Subject: R-alpha: x[NA]
In-Reply-To: <x2wwk9j9d0.fsf@bush.kubism.ku.dk>
Message-ID: <Pine.SUN.3.95.970922150648.2314B-100000@troi>

On 23 Sep 1997, Peter Dalgaard BSA wrote:

> 
> > BTW, while you obviously can't mix logical and numerical references I
> > think it's unfortunate that you can't mix numeric and name-based
> > references like
> > R> names(x)<-letters[1:4]
> > R> x
> > a b c d 
> > 1 2 3 4 
> > R> x[c("a",2)]
> > Error: subscript out of bounds
<snip> 
> I think that the possibility of setting names(x)<-4:1 will demonstrate
> why that can't work... Besides, can you be sure that the dependent
> variable is the first one in a model frame any more?
> 
Why?
R> x<-1:4
R> names(x)<-4:1
R> x[1]
4 
1 
R> x["1"]
1 
4 
So why not x[c(1,"1")] giving 1,4?


	-thomas


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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: x[NA]
Thomas Lumley