Description Usage Arguments Details Value Author(s) Examples
Graft one dataset onto another
1 | graft(.data, combine_fun, data2)
|
.data |
A tbl or something that can be coerced into one |
combine_fun |
optional, A function that will combine two tbls such as full_join or bind_rows |
data2 |
A tbl or something that can be coerced into one |
Graft requires two data objects. The first must be provided by the user. The second can either be passed in or automatically pulled off of the package's internal stack of scions. These will be combined accoring to the following rules in order:
If either dataset has zero rows, the other dataset will be returned.
If combine_fun is specifed, combine_fun(.data, data2)
will be called
If all column names match, a row bind will occur
If at least some column names match, a full join will occur
If both have the same number of rows a column bind will be performed
A single tbl object
Seth Wenchel
1 2 3 4 | library(dplyr)
aframe <- data.frame(zed = runif(100))
set_to_zero <- . %>% mutate(zed = 0)
aframe %>% scion(zed >0.5, false_fun=set_to_zero) %>% mutate(zed=1) %>% graft
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.