Description Usage Arguments Details Value Author(s) See Also Examples
The resulting data.frame will have nrow(x)
+ nrow(y)
rows, and
length(union(colnames(x), colnames(y)))
columns.
1 | rbind.smart(x, y, sort.col = NULL)
|
x, y |
matrix-like objects to be merged |
sort.col |
Which column would you like the resulting data to be sorted
on? Set to NULL to disable, in which case, rows corresponding to |
If x and y contain the same colnames, then rbind.smart
==
rbind
.
If x and y contain partially overlapping colnames, then the result will be the union of all colnames, with NA's filled in where appropriate.
If x and y contain no overlapping colnames, then the result will have x in top left and y in bottom right, filled in with NA's. as in:
1 2 | x
: X; y: Y rbind.smart(x, y) -> X NA NA Y
|
Naming rules: column classes from
x
take precedence over those from y
, and the colnames of
result will be all of the colnames from x, then the colnames from y that
were not also in x at the end.
A data.frame with nrow(x)
+ nrow(y)
rows, and
length(union(colnames(x), colnames(y)))
columns.
Mark Cowley, 11 April 2006
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.