Description Usage Arguments Author(s) See Also Examples
The default rbind function will produce an
error if you attempt to use it on
data.frames with differing numbers of
columns. The RBIND function appends a list
of data.frames together by row, filling missing
columns with NA.
1 |
datalist |
A |
keep.rownames |
Logical. Should the original
|
Ananda Mahto
rbind and cbind for other
base R functions to combine data.frames;
rbind.fill for a function
with almost identical functionality (does not preserve
the rownames); CBIND.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Make up some data
x <- data.frame(a = 1:2, b = 2:3, c = 3:4, d = 4:5,
row.names = c("row_1", "another_row1"))
y <- data.frame(a = c(10, 20), b = c(20, 30), c = c(30, 40),
row.names=c("row_2", "another_row2"))
z <- data.frame(a = c(11, 21), b = c(22, 32), d = c(33, 43),
row.names = c("row_3", "another_row3"))
xx <- data.frame(a = 1:2, b = 3:4)
yy <- data.frame(a = 5:6, b = 7:8)
zz <- data.frame(a = 9:10, b = 11:12)
zz2 <- data.frame(a = 9:10, w = 11:12)
temp1 <- list(x, y, z)
temp2 <- list(xx, yy, zz)
temp3 <- list(xx, yy, zz2)
temp4 <- list(x, y, z, xx, yy, zz, zz2)
## Apply the function
RBIND(temp1)
RBIND(temp1, keep.rownames = FALSE)
RBIND(temp2)
RBIND(temp3)
RBIND(temp4)
RBIND(temp4, keep.rownames = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.