Description Usage Arguments Details Value Author(s) Examples
scion
1 |
.data |
A tbl or something that can be coerced into one |
... |
conditions that will be passed to dplyr::filter |
false_fun |
A function or functional that will be applied to the data that doesn't pass the supplied filters (the scion) |
false_name |
optional, the name of the object to which the scion will be assigned. |
false_env |
optional, the environment into which the scion will be assigned. If specified, false_name must also be specified. If unspecified (default), scions will be placed into the internal package environment. |
.data
will be split into two chunks based on the conditions. The scion will be passed through false_fun
and then either placed on
the package's internal stack or assigned as specified by false_name
and false_env
.
A tbl whose rows have passed the stated conditions
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.