Re: [Rd] [R] Semantics of sequences in R

From: Stefan Evert <stefan.evert_at_uos.de>
Date: Mon, 23 Feb 2009 12:12:39 +0100

Dear vQ,

> vectors (can-be-considered-lists),

can you please stop repeating this nonsense? I don't think anybody ever claimed that vectors can be considered list. It's rather the other way round: lists can also be seen as vectors to R (possibly they are implemented as such, but I don't much about the internals of R).

> a <- as.list(1:10)
> b <- 1:10
> is.vector(a)

[1] TRUE
> is.list(a)

[1] TRUE
> is.vector(b)

[1] TRUE
> is.list(b)

[1] FALSE Hence the confusion about

> mode(as.vector(a))

[1] "list"

which prompted the original comment that you are taking so much exception to.

> as to "it could only work in very specific circumstances" -- no, it
> would work for any list whatsoever, provided the user has a correctly
> implemented comparator.  for example, i'd like to sort a list of  
> vectors
> by the vectors' length -- is this a very exotic idea?

Honestly, I can't think of a situation where I would want to do than in R. In a Perl script, quite likely; but this is a kind of data manipulation that R wasn't really designed for IMHO.

Not that I'd mind having sort() operate properly on lists; it just isn't something I miss in the language.

Best,
Stefan

[ stefan.evert@uos.de | http://purl.org/stefan.evert ]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 23 Feb 2009 - 10:18:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 23 Feb 2009 - 12:30:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive