Skip to content
Back to formatted view

Raw Message

Message-ID: <365AD95B.79D8A8B6@alumni.uv.es>
Date: 1998-11-24T16:05:47Z
From: Kjetil Halvorsen
Subject: as.list

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