From hpages at fredhutch.org  Fri Dec 22 09:57:10 2017
From: hpages at fredhutch.org (=?UTF-8?B?SGVydsOpIFBhZ8Oocw==?=)
Date: Fri, 22 Dec 2017 00:57:10 -0800
Subject: [Rd] Unexpected dimnames attribute returned by cbind/rbind
Message-ID: <c2fa21f3-5983-b2ce-68e8-3cdbc3a3b4d9@fredhutch.org>

Hi,

   > m5 <- cbind(integer(5), integer(5))
   > m5
        [,1] [,2]
   [1,]    0    0
   [2,]    0    0
   [3,]    0    0
   [4,]    0    0
   [5,]    0    0
   > dimnames(m5)
   NULL

No dimnames, as expected.

   > m0 <- cbind(integer(0), integer(0))
   > m0
        [,1] [,2]
   > dimnames(m0)
   [[1]]
   NULL

   [[2]]
   NULL

Unexpected dimnames attribute!

rbind'ing empty vectors also returns a matrix with unexpected
dimnames:

   > dimnames(rbind(character(0), character(0)))
   [[1]]
   NULL

   [[2]]
   NULL

Cheers,
H.

-- 
Herv? Pag?s

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



[Rd] Unexpected dimnames attribute returned by cbind/rbind
=?UTF-8?B?SGVydsOpIFBhZ8Oocw==?=