Does anyone know how to keep rownames in the rbind.fill
function.
library(plyr)
#creating data
a <- mtcars[ 1:5 , c("mpg","hp","gear") ]
b <- mtcars[ 6:10 , c("mpg","disp","gear") ]
#does not work because there are different colnames
rbind(a,b)
#works but eliminates the rownames
bound <- rbind.fill( a , b )
I am setting up a loop where objects will be connected using rbind.fill
. Right now I am using the combine function like this:
namess <- c( rownames(a) , rownames(b) )
rownames(bound) <- namess
I thought that there might be a better way. Thanks!
plyr
has a bug report forum/place, but if it does someone should link to it and this should be submitted imo. – Precedenceplyr
functions that operate ondata.frame
s shouldn't support row names? This seems like a natural and trivial change to add torbind.fill
. – Precedenceddply
. – Survivalddply
, but it does torbind.fill
. Just because other functions inplyr
don't/can't deal withdata.frame
row names, doesn't mean this one shouldn't either. – Precedence