x <- data.frame( x=c(1, 2, 3), y=letters[1:3], z=rnorm(3), stringsAsFactors=FALSE )
rownames(x) <- c("apple", "banana", "cherry")
y <- data.frame( x=c(4, 5, 6), y=LETTERS[1:3], z=runif(3), stringsAsFactors=FALSE )
rownames(y) <- c("date", "eggplant", "fig")
tmp1 <- stack_list( list(x, y) )
tmp2 <- do.call( rbind, list(x, y) )
rownames(tmp2) <- 1:nrow(tmp2)
all.equal( tmp1[,1:3], tmp2 )
Run the code above in your browser using DataLab