Description Usage Arguments Value See Also Examples
This function wraps purrr::reduce()
and dplyr::full_join()
to reduce
all or some dataframes in a list into a single dataframe.
1 |
lst |
A list of dataframes. |
df_names |
Names of the list elements to join. |
by |
A character vector of variables to join by. If NULL, the default,
*_join() will do a natural join, using all variables with common names
across the two tables. To join by different variables on x and y use a
named vector. For example, by = c("a" = "b") will match x.a to y.b. Passed
to |
A dataframe.
purrr::reduce()
and dplyr::full_join()
.
Other general functions to export data: list_csv
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | dfs <- list(
a = data.frame(x = 1),
b = data.frame(x = 2, y = 2),
c = data.frame(x = 1, z = 3)
)
list_df(dfs)
list_df(dfs, df_names = c("a", "c"))
list_df(dfs, df_names = c("b", "c"))
# Use argument `by` if dataframes have no matching variable,
list_df(
list(data.frame(x = 1), data.frame(z = 2)),
by = c("x" = "z")
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.