[R] subscript data.frame

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Jan 26 17:27:45 CET 2000


Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> > From: "Jens Oehlschlägel-Akiyoshi" <jens.oehlschlaegel-akiyoshi at mdfactory.de>
> > 
> > is the following difference intended?
> > 
> > > ddd <- data.frame(a=1:3, b=1:3)
> > 
> > # assignment of 'X' silently ignored
> > > ddd[1,1] <- 'X'
> > > is.factor(ddd[[1]])
> > [1] FALSE
> > > ddd
> >   a b
> > 1 1 1
> > 2 2 2
> > 3 3 3

....

> It's a bug: the prototype has the second behaviour for both.  Could you put it
> in as a bug report please?

I think we have it already, and it's worse than JOA thinks:

> ddd <- data.frame(a=1:3, b=1:3)
> ddd[2,1] <- 'X'
> ddd
  a b
1 1 1
2 1 2
3 3 3


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list