ruler-report {ruler}R Documentation

Tidy data validation report

Description

A tibble representing the data validation result of certain data units in tidy way:

Usage

is_report(.x, .skip_class = FALSE)

get_report(.object)

Arguments

.x

Object to test.

.skip_class

Whether to skip checking inheritance from ruler_report.

.object

Object to get report value from exposure attribute.

Details

There are four basic combinations of var and id values which define five basic data units:

Value

get_report() returns report element of object if it is exposure and of its 'exposure' attribute otherwise.

Examples

my_row_packs <- row_packs(
  row_mean_props = . %>% dplyr::transmute(row_mean = rowMeans(.)) %>%
    dplyr::transmute(
      row_mean_low = row_mean > 20,
      row_mean_high = row_mean < 60
    ),
  row_outlier = . %>% dplyr::transmute(row_sum = rowSums(.)) %>%
    dplyr::transmute(
      not_row_outlier = abs(row_sum - mean(row_sum)) / sd(row_sum) < 1.5
    )
)
my_data_packs <- data_packs(
  data_dims = . %>% dplyr::summarise(
    nrow = nrow(.) == 32,
    ncol = ncol(.) == 5
  )
)

mtcars_exposed <- mtcars %>%
  expose(my_data_packs, .remove_obeyers = FALSE) %>%
  expose(my_row_packs)

mtcars_exposed %>% get_report()

mtcars_exposed %>%
  get_report() %>%
  is_report()

[Package ruler version 0.3.0 Index]