From p.dalgaard@kubism.ku.dk  Tue Sep 23 10:13:23 1997
From: p.dalgaard@kubism.ku.dk (Peter Dalgaard BSA)
Date: 23 Sep 1997 11:13:23 +0200
Subject: R-alpha: x[NA]
In-Reply-To: Thomas Lumley's message of Mon, 22 Sep 1997 15:08:54 -0700 (PDT)
References: <Pine.SUN.3.95.970922150648.2314B-100000@troi>
Message-ID: <x2souwl7f0.fsf@bush.kubism.ku.dk>

Thomas Lumley <thomas@biostat.washington.edu> writes:

> 
> On 23 Sep 1997, Peter Dalgaard BSA wrote:

> > 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?

Because 

> c(1,"1")
[1] "1" "1"

so we'd have to introduce mixed-type vectors first. However, I suppose
that one might make

> x[list(1,"1")]

work.

-- 
   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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: x[NA]
Peter Dalgaard BSA