From khal@alumni.uv.es  Tue Nov 24 16:05:47 1998
From: khal@alumni.uv.es (Kjetil Halvorsen)
Date: Tue, 24 Nov 1998 17:05:47 +0100
Subject: as.list
References: <Pine.GSO.3.96.981122160247.10722A-100000@toucan.stats>
Message-ID: <365AD95B.79D8A8B6@alumni.uv.es>

I don't understand the behavior of "as.list"
(really as.list.default) on arguments which
are expressions. An artificial example:

> as.list(expression( x <- 1, y <- 2))
[[1]]
<-

[[2]]
<-

as.list.default contains the following code:

 if (is.expression(x)) {
        l <- vector("list")
        for (sub in x) l <- c(l, sub[[1]])

--- why the sub[[1]] part?

eliminating the [[1]], I get:

> my.as.list(expression( x <- 1, y <- 2))
[[1]]
x <- 1

[[2]]
y <- 2


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


as.list
Kjetil Halvorsen