[Rd] bug in rbind?
Krzysztof Banas
krzysztof at nus.edu.sg
Tue Jan 17 02:50:24 CET 2017
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]]
More information about the R-devel
mailing list