scion: scion

Description Usage Arguments Details Value Author(s) Examples

View source: R/tabe.R

Description

scion

Usage

1
scion(.data, ..., false_fun, false_name, false_env)

Arguments

.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.

Details

.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.

Value

A tbl whose rows have passed the stated conditions

Author(s)

Seth Wenchel

Examples

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

restonslacker/taber documentation built on Oct. 5, 2020, 6:29 a.m.