This function is essentially a wrapper for any of dplyr
's
mutate-joins (by default, a full_join).
The most typical use of this function is to merge designs with measures
data, or to use the collapse functionality to merge a list of dataframes
into a single dataframe. Merging is done by column names that match
between x
and y
.
merge_dfs(
x,
y = NULL,
by = NULL,
drop = FALSE,
collapse = FALSE,
names_to = NA,
join = "full",
warn_morerows = TRUE,
...
)
Data.frame containing merged output of x
and
y
First data.frame, or list of data frames, to be joined
Second data.frame, or list of data frames, to be joined
A character vector of variables to join by, passed directly to the join function
Should only complete_cases
of the resulting
data.frame be returned?
A logical indicating whether x or y is a list containing data frames that should be merged together before being merged with the other
Column name for where names(x)
or names(y)
will be entered in if collapse = TRUE
.
If a value of NA
then names(x)
or
names(y)
will not be put into a column in the
returned data.frame
Type of join used to merge x
and y
. Options
are 'full' (default), 'inner', 'left', and 'right'.
A full
join keeps all observations in x
and
y
A left
join keeps all observations in x
A right
join keeps all observations in y
An inner
join only keeps observations found in
both x
and y
(inner joins are not appropriate
in most cases because observations are frequently dropped).
See full_join, left_join, right_join, or inner_join for more details
logical, should a warning be passed when the output has more rows than x and more rows than y?
Other arguments to pass to the underlying join function. See full_join, left_join, right_join, or inner_join for options.