Function to bind several exposures into one.

bind_exposures(..., .validate_output = TRUE)

Arguments

...

Exposures to bind.

.validate_output

Whether to validate with is_exposure() if the output is exposure.

Details

Note that the output might not have names in list-column fun in packs info, which depends on version of dplyr package.

Examples

my_data_packs <- data_packs(
  data_dims = . %>% dplyr::summarise(nrow_low = nrow(.) < 10),
  data_sum = . %>% dplyr::summarise(sum = sum(.) < 1000)
)

ref_exposure <- mtcars %>%
  expose(my_data_packs) %>%
  get_exposure()

exposure_1 <- mtcars %>%
  expose(my_data_packs[1]) %>%
  get_exposure()
exposure_2 <- mtcars %>%
  expose(my_data_packs[2]) %>%
  get_exposure()
exposure_binded <- bind_exposures(exposure_1, exposure_2)

exposure_pipe <- mtcars %>%
  expose(my_data_packs[1]) %>%
  expose(my_data_packs[2]) %>%
  get_exposure()

identical(exposure_binded, ref_exposure)
#> [1] TRUE

identical(exposure_pipe, ref_exposure)
#> [1] TRUE