Exposure is a result of exposing data to rules. It is implemented with S3 class exposure which is a list of the following structure: packs_info - a packs_info object; report - tidy data validation report.

is_exposure(.x)

get_exposure(.object)

remove_exposure(.object)

Arguments

.x

Object to test.

.object

Object to get or remove exposure attribute from.

Value

get_exposure() returns object if it is exposure and its attribute 'exposure' otherwise.

remove_exposure() returns object with removed attributed 'exposure'.

Examples

my_col_packs <- col_packs(
  col_sum_props = . %>% dplyr::summarise_all(
    rules(
      col_sum_low = sum(.) > 100,
      col_sum_high = sum(.) < 1000
    )
  )
)
mtcars_exposed <- mtcars %>% expose(my_col_packs)
mtcars_exposure <- mtcars_exposed %>% get_exposure()

is_exposure(mtcars_exposure)
#> [1] TRUE

identical(remove_exposure(mtcars_exposed), mtcars)
#> [1] TRUE

identical(get_exposure(mtcars_exposure), mtcars_exposure)
#> [1] TRUE