[Rd] ambiguity in the documented return value of Null() from package MASS
William Dunlap
wdunlap at tibco.com
Mon Nov 10 17:40:39 CET 2014
> Presumably, the help file wording goes back to S-PLUS which
> (to my recollection) didn't allow zero-extent matrices.
Splus (and S) started having reasonable support for zero-extent
matrices in May 2001 (i.e., Splus 6.0, which I think corresponds
to S version 4-m of June 2, 1999), Splus5.0 (Nov 20, 1998, corresponding
to S version 4-? of Oct 26, 1998) have very partial support for them.
% Splus6.0
S-PLUS : Copyright (c) 1988, 2001 Insightful Corp.
S : Copyright Lucent Technologies, Inc.
Version 6.0.1 Release 1 for Linux 2.2.12 : 2001
Working data will be in .Data
> library(MASS)
> Null(diag(3))
numeric matrix: 3 rows, 0 columns.
> load.date()
[1] "Fri May 4 01:09:06 PDT 2001"
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Nov 10, 2014 at 5:47 AM, peter dalgaard <pdalgd at gmail.com> wrote:
> 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
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
[[alternative HTML version deleted]]
More information about the R-devel
mailing list