MultMerge | R Documentation |
Merge multiple data frames by row names, or do other versions of database join operations.
MultMerge(..., all.x = TRUE, all.y = TRUE, by = NULL)
... |
data frames to be coerced to one. |
all.x |
logical; if |
all.y |
logical; analogous to |
by |
column used for merging, if this is not defined rownames will be used by default. The column must be included in all the provided data frames. |
A data frame. The rows are sorted according to the appearance of previously unobserved rownames. So the rownames appearing in the first data frame are first, then the rownames in the second data frame, which have no corespondence in the first data frame and so on. The columns are the remaining columns in x1 and then those in x2 and then those in x3. The result has the row names resulting from the merge.
Andri Signorell <andri@signorell.net>
merge
x1 <- SetNames(data.frame(v=letters[1:6], w=1:6),
rownames=c("A", "B", "C", "D", "E", "F"))
x2 <- SetNames(data.frame(v=letters[1:3], ww=11:13),
rownames=c("B", "C", "D"))
x3 <- SetNames(data.frame(v=letters[12:16], wwww=22:26),
rownames=c("A", "C", "E", "G", "J"))
# default is "merge by rownames"
MultMerge(x1, x2, x3)
# ... which does not really make sense here
# merge by column v
MultMerge(x1, x2, x3, by="v")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.