# R-alpha: unlist(..) forever..

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Fri, 8 Aug 1997 14:56:17 +0200

[[ R-0.50 Alpha-3  --- i.e. both patches applied to 0.50-a1 ]]

There are less problems, but I think two remain

1) Peter Dalgaard's example {which "includes"  Kurt's unlist(lm(..))}

> unlist(list(1,2,x~y))
[[1]]
[1] 1

[[2]]
NULL

[[3]]
NULL

2) [unreported yet:]

l.ex <- list(a = list(1:5, LETTERS[1:5]), b = "Z", c = NA)

unlist(l.ex) #-- now 'okay' in 0.50-a3 !!

unlist(l.ex, recursive=FALSE) #-- --- recursive has no effect!
##-------------

which returns the same as the default recursive = TRUE

whereas S gives
S> unlist(list(a = list(1:5, LETTERS[1:5]), b = "Z", c = NA), rec = FALSE)
\$a1:
[1] 1 2 3 4 5

\$a2:
[1] "A" "B" "C" "D" "E"

\$b:
[1] "Z"

\$c:
[1] NA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-