Runs a blueprint function where a condition is true, otherwise
returns NA
values
bp_where(condition, bp, ...)
condition | Condition to check before evaluating. Results will be given where
this is |
---|---|
bp | Blueprint function to run based on the condition |
... | arguments passed on to Blueprint, such as |
a tibble
#> # A tibble: 10 x 2 #> x y #> <dbl> <dbl> #> 1 NA NA #> 2 NA NA #> 3 -0.00289 0.389 #> 4 NA NA #> 5 NA NA #> 6 0.413 0.461 #> 7 0.724 0.315 #> 8 NA NA #> 9 NA NA #> 10 2.35 0.175#> # A tibble: 10 x 4 #> id cnd x y #> <int> <lgl> <dbl> <dbl> #> 1 1 TRUE -0.424 0.466 #> 2 2 FALSE NA NA #> 3 3 TRUE -0.872 0.390 #> 4 4 FALSE NA NA #> 5 5 TRUE 0.107 0.0201 #> 6 6 FALSE NA NA #> 7 7 FALSE NA NA #> 8 8 TRUE -0.587 0.377 #> 9 9 FALSE NA NA #> 10 10 TRUE -0.328 0.560