Skip to content

unlisting a list with names components (PR#645)

1 message · pperkins@ucsd.edu

#
hi -

i apologize if this is a duplicate.

i think the lines below demonstrate a problem with unlist when the list
contains components that are names.  _anything_ can go in a list,
right?  this came up in the context of trying to
unlist(list(attr(terms(formula), "variables")).

perhaps unrelated but i thought i'd mention: unlist() complains about a
call/formula object, but sapply() does not (a call certainly "looks"
like a list, but includes names at some level).

- peter perkins


$ R --vanilla
[1] "package:base"
[1] "package:base"
a   b
"a" "b"
$a
[1] "a"

$b
b
[1] "list"
[1] "list"


--please do not edit the information below--

Version:
 platform = powerpc-unknown-linux-gnu
 arch = powerpc
 os = linux-gnu
 system = powerpc, linux-gnu
 status =
 major = 1
 minor = 1.1
 year = 2000
 month = August
 day = 15
 language = R

Search Path:
 .GlobalEnv, Autoloads, package:base



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