From pdalgd at gmail.com  Mon Nov 10 14:47:16 2014
From: pdalgd at gmail.com (peter dalgaard)
Date: Mon, 10 Nov 2014 14:47:16 +0100
Subject: [Rd] ambiguity in the documented return value of Null() from
	package MASS
In-Reply-To: <438D2EC9EAFE5946B2D5864670EA468E0145C06617@MBXP01.ds.man.ac.uk>
References: <438D2EC9EAFE5946B2D5864670EA468E0145C06617@MBXP01.ds.man.ac.uk>
Message-ID: <7E647343-87CF-4DB2-969D-C4F7F4A76B28@gmail.com>

There is a maintainer for this contributed package...

However, a zero column vector _is_ numeric(0) -- with dimension attributes c(3,0). 

structure(numeric(0),dim=c(3,0))
c(Null(diag(3)))

I.e., the ambiguity is pretty slight. 

Presumably, the help file wording goes back to S-PLUS which (to my recollection) didn't allow zero-extent matrices. The actual behaviour is a clear improvement.

- Peter D.



On 10 Nov 2014, at 13:49 , Georgi Boshnakov <georgi.boshnakov at manchester.ac.uk> wrote:

> Hi,
> 
> Function Null from package MASS seems to return a matrix with zero columns and the expected number of rows when
> the null space of the argument contains only the zero vector, e.g. 
> 
>> library(MASS)
>> diag(nrow=3)
>     [,1] [,2] [,3]
> [1,]    1    0    0
> [2,]    0    1    0
> [3,]    0    0    1
> 
>> Null(diag(nrow=3))
> 
> [1,]
> [2,]
> [3,]
> 
> But the documentation of Null  seems to imply that the result is numeric(0):
> 
> -----------------------------------------------
> 
> Value: 
> 
> The matrix 'N' with the basis for the null space, or an empty
>     vector if the matrix 'M' is square and of maximal rank.
> 
> -----------------------------------------------
> 
> (R version 3.1.1 Patched (2014-09-21 r66653) -- "Sock it to Me")
> 
> Georgi
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] ambiguity in the documented return value of Null() from package MASS
peter dalgaard