Description Usage Arguments Details Examples
View source: R/merge_multiple.R
Merge multiple data.frame
s
1 2 |
x |
a list of |
by |
name of the column to be merged by, by default the full intersect of
column names between |
all |
include all rows, including those with no match |
sort |
sort the output on the |
incomparables |
values which cannot be matched. |
include, exclude |
numric, logical or character vector specifying which columns to include in or exclude from the merge |
If there are duplicate columns that aren't being used to merge by, one of two
things will happen. If the parent data.frame
s of the duplicate columns
are named, then that name will be appended to the relevant column names. If
the data.frame
s aren't named, then the data.frame
s idices in
the parent list are appended to the relevant column names.
Inclusion and exclusion are performed in sequence, so that if both
include
and exclude
are specified, exclude
acts on the
result from include
.
1 2 3 4 5 6 7 8 9 10 11 12 | dtf1 <- data.frame(ast=1:4, bar=1:4, kat=c("A", "B", "C", "D"))
dtf2 <- data.frame(ast=1:6, bar=1:6, jun=9:4)
dtf3 <- data.frame(ast=2:6, bar=2:6, kat=c("A", "B", "C", "D", "E"))
dtf4 <- data.frame(ast=3:4, bar=3:4)
dtf5 <- data.frame(ast=1:-3, bar=0:4, git=0:4)
ll <- list(d1=dtf1, d2=dtf2, dtf3, A=dtf4, dtf5)
merge_multiple(ll, by="bar")
merge_multiple(ll, by="bar", all=TRUE, include=1:2)
merge_multiple(ll, by="bar", all=TRUE, exclude="kat")
merge_multiple(x=ll, by=c("bar", "ast"), all=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.