From krzysztof at nus.edu.sg  Tue Jan 17 02:50:24 2017
From: krzysztof at nus.edu.sg (Krzysztof Banas)
Date: Tue, 17 Jan 2017 01:50:24 +0000
Subject: [Rd] bug in rbind?
Message-ID: <D1E6227CBC482446B2D877554FCD338C2CCB4982@MBX01A.stf.nus.edu.sg>

I suspect there may be a bug in base::rbind.data.frame

Below there is minimal example of the problem:

m <- matrix (1:12, 3)
dfm <- data.frame (c = 1 : 3, m = I (m))
str (dfm)

m.names <- m
rownames (m.names) <- letters [1:3]
dfm.names <- data.frame (c = 1 : 3, m = I (m.names))
str (dfm.names)

rbind (m, m.names)
rbind (m.names, m)
rbind (dfm, dfm.names)

#not working
rbind (dfm.names, dfm)

Error in rbind(deparse.level, ...) : replacement has length zero

rbind (dfm, dfm.names)$m


     [,1] [,2] [,3] [,4]

<NA>    1    4    7   10

<NA>    2    5    8   11

<NA>    3    6    9   12

a       1    4    7   10

b       2    5    8   11

c       3    6    9   12



________________________________

Important: This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Thank you.

	[[alternative HTML version deleted]]



[Rd] bug in rbind?
Krzysztof Banas