bp_where: Blueprint based on a condition

Description Usage Arguments Value Examples

View source: R/blueprint.R

Description

Runs a blueprint function where a condition is true, otherwise returns NA values

Usage

1

Arguments

condition

Condition to check before evaluating. Results will be given where this is TRUE, and NA when this is FALSE

bp

Blueprint function to run based on the condition

...

arguments passed on to Blueprint, such as .seed

Value

a tibble

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
make_tbl <- blueprint(
  x = r_norm(),
  y = r_unif()
)

set_n(10)
i <- r_lgl()

bp_where(i, make_tbl)

df <- tibble::tibble(
  id = 1:10,
  cnd = r_lgl()
)
dplyr::mutate(df, bp_where(cnd, make_tbl))

rando documentation built on Feb. 16, 2021, 5:07 p.m.