Skip to contents

This sequences, catches errors and allows parameters to be passed by name

Usage

augment_generic(df, ...)

Arguments

df

a data frame

...

unnamed parameters are a list of functions, named parameters are passed to those functions (if they match formal arguments).

Value

the altered df

Examples

fn1 = function(df,v) {df %>% dplyr::filter(cut=="Fair") %>% dplyr::mutate(x_col = color)}
fn2 = function(df,v) {df %>% dplyr::filter(color==v$color$J)}
df = ggplot2::diamonds %>% augment_generic(fn1, fn2)
#> caching item: ~/.cache/avoncap/augment-4c0c0c577381837fb7b8ee36b440288a-edeab590551be3b5cf91e8512430373b.rda
#> Created x_col using: cut, color
#> Created  using: color