data.frame does not recycle consistently (PR#1713)
Kevin.Wright@pioneer.com
Kevin.Wright@pioneer.com
Thu, 27 Jun 2002 18:13:53 +0200 (MET DST)
Full_Name: Kevin Wright
Version: 1.5.1
OS: Windows 95
Submission from: (NULL) (170.54.59.160)
Note that the examples below do work in S (S-Plus 2000).
It appears that data.frame does not recycle text strings. Maybe has something
to do with coercion to factors???
> data.frame(x=1:2,y=1)
x y
1 1 1
2 2 1
> data.frame(x=c("A","B"),y=T)
x y
1 A TRUE
2 B TRUE
> data.frame(x=c("A","B"),y="C")
Error in data.frame(x = c("A", "B"), y = "C") :
arguments imply differing number of rows: 2, 1
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._