From jens.oehlschlaegel-akiyoshi@mdfactory.de  Thu Dec 23 18:15:36 1999
From: jens.oehlschlaegel-akiyoshi@mdfactory.de (jens.oehlschlaegel-akiyoshi@mdfactory.de)
Date: Thu, 23 Dec 1999 19:15:36 +0100 (MET)
Subject: different subscripting behaviour using  $<-  or  [<-  for data.frames (PR#387)
Message-ID: <199912231815.TAA21687@pubhealth.ku.dk>



I observe if

> char <- letters[1:2]
> fac <- factor(char)
> dd <- data.frame(char=I(char), fac=fac)

then

> dd[,"char"] <- char
> dd[,"char"]
[1] a b
Levels:  a b

and

> dd$char <- char
> dd$char
[1] "a" "b"

are different.

After the latter operation the data.frame contains a character column, which
neither has attribute "AsIs" nor has been converted to class factor. Is this
intended?


platform Windows
arch     x86
os       Win32
system   x86, Win32
status
major    0
minor    90.1
year     1999
month    December
day      15
language R

--
Dr. Jens Oehlschlgel-Akiyoshi
MD FACTORY GmbH
Bayerstrasse 21

80335 Mnchen

Tel.: 089 545 28-27
Fax.: 089 545 28-10
http://www.mdfactory.de

Standard Disclaimers: Opinions expressed here are personal
and are not otherwise represented.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


different subscripting behaviour using $<- or [<- for data.frames (PR#387)
jens.oehlschlaegel-akiyoshi@mdfactory.de