lapply( *, names) -- bug ?!

About this list Date view Thread view Subject view Author view Other groups

Subject: lapply( *, names) -- bug ?!
From: Martin Maechler (maechler@stat.math.ethz.ch)
Date: Fri 23 Jul 1999 - 17:15:03 EST


Message-Id: <199907230715.JAA04888@sophie.ethz.ch>

This came on S-news

The more direct test being

sapply(c(a=1,b=2), names)

Problem:
          R ("all" versions)
          behaves the same as S+5.1, which is wrong IMO.

{since some might disagree, I didn't yet post to R-bugs ..}

------- Start of forwarded message -------
Date: Thu, 22 Jul 1999 23:14:57 -0230
From: "Paul Y. Peng" <ypeng@math.mun.ca>
To: s-news <s-news@wubios.wustl.edu>
Subject: [S] Feature or bug?

In S-PLUS 3.3 (DEC Alpha) and S-PLUS 2000,

> z <- c("a"=1, "b"=2)
> lapply(z, function(x)names(x))
$a:
[1] "a"

$b:
[1] "b"

But in S-PLUS 5.1 (Linux),

> z <- c("a"=1, "b"=2)
> lapply(z, function(x)names(x))
$a:
NULL

$b:
NULL

Is this a new feature of S-PLUS 5? Do I miss anything in
S-PLUS 5? Thank you for your help.
------- End of forwarded message -------

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


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:06 EST