merge_dfs {gcplyr} | R Documentation |
Collapse a list of dataframes, or merge two dataframes together
Description
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
.
Usage
merge_dfs(
x,
y = NULL,
by = NULL,
drop = FALSE,
collapse = FALSE,
names_to = NA,
join = "full",
warn_morerows = TRUE,
...
)
Arguments
x |
First data.frame, or list of data frames, to be joined |
y |
Second data.frame, or list of data frames, to be joined |
by |
A character vector of variables to join by, passed directly to the join function |
drop |
Should only |
collapse |
A logical indicating whether x or y is a list containing data frames that should be merged together before being merged with the other |
names_to |
Column name for where If a value of |
join |
Type of join used to merge
See full_join, left_join, right_join, or inner_join for more details |
warn_morerows |
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. |
Value
Data.frame containing merged output of x
and
y