From: Martin Maechler <maechler_at_stat.math.ethz.ch>

Date: Sat, 04 Feb 2012 17:38:52 +0100

R-devel_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 04 Feb 2012 - 16:42:52 GMT

Date: Sat, 04 Feb 2012 17:38:52 +0100

> x: a vector, array or data frame

Of course, all these packages could write methods for NROW, NCOL
for their specific matrix class, but given that the current
definition is so simple,

I'd find it an unnecessary complication.

Rather I propose the following new version

NROW <- function(x) if(length(dim(x)) || is.data.frame(x)) nrow(x) else length(x) NCOL <- function(x) if(length(dim(x)) > 1L || is.data.frame(x)) ncol(x) else 1L

I've tested to see that it does not change any of the R 'make
check-all' checks...

but I'd really like to let this pass by as a general RFC..
(in spite of the fact that I'll offline for almost all the rest
of the weekend).

Martin Maechler

R-devel_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 04 Feb 2012 - 16:42:52 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

*
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 Sat 04 Feb 2012 - 21:40:13 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.
*