From jmartin2003 at notamusica.com  Tue Jul 29 18:01:46 2003
From: jmartin2003 at notamusica.com (jmartin2003@notamusica.com)
Date: Tue Jul 29 17:01:36 2003
Subject: [Rd] cbind/rbind inconsistency with NULL parameter (PR#3585)
Message-ID: <200307291501.h6TF1kJH021916@pubhealth.ku.dk>

R-Version: 1.7.1  (2003-06-16)
OS: Debian/GNU Linux

cbind and rbind handle NULL parameters inconsistently.

Consider:
  > cbind()
  NULL
  > cbind(NULL)
  NULL

And:
  > cbind(diag(x = 1, 1, 1))
       [,1]
  [1,]    1
  > cbind(NULL, diag(x = 1, 1, 1))
       [,1]
  [1,]    1

These seem to indicate that NULL parameters will be ignored in any call to
cbind and rbind. However:

> cbind(NULL, diag(x = 1, 0, 1))
     [,1] [,2]

I.e. if one dimension of another parameter to cbind/rbind is zero,
cbind/rbind will create a row/column from the NULL parameter.

This inconsistency creates problems in the construction of matrices within
loops and similar constructs.


[Rd] cbind/rbind inconsistency with NULL parameter (PR#3585)
jmartin2003@notamusica.com