[R] subscript data.frame
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Jan 26 16:56:32 CET 2000
> 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
>
> # assignment of 'X' not ignored
> > ddd[[1]][1] <- 'X'
> > is.factor(ddd[[1]])
> [1] TRUE
> > ddd
> a b
> 1 X 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?
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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