diff --git a/DESCRIPTION b/DESCRIPTION index 5505108d4..6d0b253df 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,31 +1,29 @@ Type: Package Package: pointblank +Title: Data Validation and Organization of Metadata for Local and Remote + Tables Version: 0.12.2.9000 -Title: Data Validation and Organization of Metadata for Local and Remote Tables -Description: Validate data in data frames, 'tibble' objects, 'Spark' - 'DataFrames', and database tables. Validation pipelines can be made using - easily-readable, consecutive validation steps. Upon execution of the - validation plan, several reporting options are available. User-defined - thresholds for failure rates allow for the determination of appropriate - reporting actions. Many other workflows are available including an - information management workflow, where the aim is to record, collect, and - generate useful information on data tables. Authors@R: c( - person("Richard", "Iannone", , "rich@posit.co", c("aut", "cre"), + person("Richard", "Iannone", , "rich@posit.co", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-3925-190X")), - person("Mauricio", "Vargas", , "mavargas11@uc.cl", c("aut"), + person("Mauricio", "Vargas", , "mavargas11@uc.cl", role = "aut", comment = c(ORCID = "0000-0003-1017-7574")), - person("June", "Choe", , "jchoe001@gmail.com", c("aut"), + person("June", "Choe", , "jchoe001@gmail.com", role = "aut", comment = c(ORCID = "0000-0002-0701-921X")), - person("Olivier", "Roy", role = c("ctb")) - ) + person("Olivier", "Roy", role = "ctb") + ) +Description: Validate data in data frames, 'tibble' objects, 'Spark' + 'DataFrames', and database tables. Validation pipelines can be made + using easily-readable, consecutive validation steps. Upon execution of + the validation plan, several reporting options are available. + User-defined thresholds for failure rates allow for the determination + of appropriate reporting actions. Many other workflows are available + including an information management workflow, where the aim is to + record, collect, and generate useful information on data tables. License: MIT + file LICENSE -URL: https://rstudio.github.io/pointblank/, https://github.com/rstudio/pointblank +URL: https://rstudio.github.io/pointblank/, + https://github.com/rstudio/pointblank BugReports: https://github.com/rstudio/pointblank/issues -Encoding: UTF-8 -LazyData: true -ByteCompile: true -RoxygenNote: 7.3.2 Depends: R (>= 3.5.0) Imports: @@ -33,16 +31,16 @@ Imports: blastula (>= 0.3.3), cli (>= 3.6.0), DBI (>= 1.1.0), + dbplyr (>= 2.3.0), digest (>= 0.6.27), dplyr (>= 1.1.0), - dbplyr (>= 2.3.0), fs (>= 1.6.0), glue (>= 1.6.2), gt (>= 0.9.0), htmltools (>= 0.5.4), knitr (>= 1.42), - rlang (>= 1.0.3), magrittr, + rlang (>= 1.0.3), scales (>= 1.2.1), testthat (>= 3.2.0), tibble (>= 3.1.8), @@ -53,21 +51,27 @@ Suggests: arrow, bigrquery, data.table, + dittodb, duckdb, ggforce, ggplot2 (>= 3.5.0), jsonlite, + lifecycle, log4r, lubridate, - RSQLite, - RMySQL, - RPostgres, + odbc, readr, rmarkdown, - sparklyr, - dittodb, - odbc -Roxygen: list(markdown = TRUE) + RMySQL, + RPostgres, + RSQLite, + sparklyr +ByteCompile: true Config/testthat/edition: 3 Config/testthat/parallel: true -Config/testthat/start-first: expectation_fns, scan_data,tidyselect_fails_safely_batch,test_fns +Config/testthat/start-first: expectation_fns, + scan_data,tidyselect_fails_safely_batch,test_fns +Encoding: UTF-8 +LazyData: true +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.2 diff --git a/NAMESPACE b/NAMESPACE index 24736fbf4..e39af4d0f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -61,6 +61,7 @@ export(deactivate_steps) export(draft_validation) export(email_blast) export(email_create) +export(error_on_fail) export(expect_col_count_match) export(expect_col_exists) export(expect_col_is_character) diff --git a/R/action_levels.R b/R/action_levels.R index 47aa940a9..773b5e417 100644 --- a/R/action_levels.R +++ b/R/action_levels.R @@ -26,8 +26,8 @@ #' The `action_levels()` function works with the `actions` argument that is #' present in the [create_agent()] function and in every validation step #' function (which also has an `actions` argument). With it, we can provide -#' threshold *failure* values for any combination of `warn`, `stop`, or `notify` -#' failure states. +#' threshold *failure* values for any combination of `warn`, `error`, or +#' `critical` failure states. #' #' We can react to any entering of a state by supplying corresponding functions #' to the `fns` argument. They will undergo evaluation at the time when the @@ -41,57 +41,58 @@ #' warnings, throwing errors) in the case of validation functions operating #' directly on data (e.g., `mtcars %>% col_vals_lt("mpg", 35)`). There are two #' helper functions that are convenient when using validation functions directly -#' on data (the `agent`-less workflow): `warn_on_fail()` and `stop_on_fail()`. +#' on data (the `agent`-less workflow): `warn_on_fail()` and `error_on_fail()`. #' These helpers either warn or stop (default failure threshold for each is set #' to `1`), and, they do so with informative warning or error messages. The -#' `stop_on_fail()` helper is applied by default when using validation functions -#' directly on data (more information on this is provided in *Details*). +#' `error_on_fail()` helper is applied by default when using validation +#' functions directly on data (more information on this is provided in +#' *Details*). #' #' @details #' #' The output of the `action_levels()` call in `actions` will be interpreted #' slightly differently if using an *agent* or using validation functions #' directly on a data table. For convenience, when working directly on data, any -#' values supplied to `warn_at` or `stop_at` will be automatically given a stock +#' values supplied to `warn` or `error` will be automatically given a stock #' `warning()` or `stop()` function. For example using #' `small_table %>% col_is_integer("date")` will provide a detailed stop message #' by default, indicating the reason for the failure. If you were to supply the -#' `fns` for `stop` or `warn` manually then the stock functions would be +#' `fns` for `warn` or `error` manually then the stock functions would be #' overridden. Furthermore, if `actions` is NULL in this workflow (the default), -#' **pointblank** will use a `stop_at` value of `1` (providing a detailed, +#' **pointblank** will use a `error` value of `1` (providing a detailed, #' context-specific error message if there are any *failing* units). We can #' absolutely suppress this automatic stopping behavior at each validation #' step by setting `active = FALSE`. In this interactive data case, there is no -#' stock function given for `notify_at`. The `notify` failure state is less +#' stock function given for `critical`. The `critical` failure state is less #' commonly used in this workflow as it is in the *agent*-based one. #' #' When using an *agent*, we often opt to not use any functions in `fns` as the -#' `warn`, `stop`, and `notify` failure states will be reported on when using +#' `warn`, `error`, and `critical` failure states will be reported on when using #' `create_agent_report()` (and, usually that's sufficient). Instead, using the #' `end_fns` argument is a better choice since that scheme provides useful data #' on the entire interrogation, allowing for finer control on side effects and #' reducing potential for duplicating any side effects. #' -#' @param warn_at *Threshold value for the 'warn' failure state* +#' @param warn *Threshold value for the 'warn' failure state* #' #' `scalar(val>=0)` // *default:* `NULL` (`optional`) #' #' Either the threshold number or the threshold fraction of *failing* test #' units that result in entering the `warn` failure state. #' -#' @param stop_at *Threshold value for the 'stop' failure state* +#' @param error *Threshold value for the 'stop' failure state* #' #' `scalar(val>=0)` // *default:* `NULL` (`optional`) #' #' Either the threshold number or the threshold fraction of *failing* test -#' units that result in entering the `stop` failure state. +#' units that result in entering the `error` failure state. #' -#' @param notify_at *Threshold value for the 'notify' failure state* +#' @param critical *Threshold value for the 'notify' failure state* #' #' `scalar(val>=0)` // *default:* `NULL` (`optional`) #' #' Either the threshold number or the threshold fraction of *failing* test -#' units that result in entering the `notify` failure state. +#' units that result in entering the `critical` failure state. #' #' @param fns *Functions to execute when entering failure states* #' @@ -99,21 +100,27 @@ #' #' A named list of functions that is to be paired with the appropriate failure #' states. The syntax for this list involves using failure state names from -#' the set of `warn`, `stop`, and `notify`. The functions corresponding to the -#' failure states are provided as formulas (e.g., +#' the set of `warn`, `error`, and `critical`. The functions corresponding to +#' the failure states are provided as formulas (e.g., #' `list(warn = ~ warning("Too many failures."))`. A series of expressions for #' each named state can be used by enclosing the set of statements with `{ }`. #' +#' @inheritParams rlang::args_dots_empty +#' +#' @param warn_at `r lifecycle::badge("deprecated")` +#' @param stop_at `r lifecycle::badge("deprecated")` +#' @param notify_at `r lifecycle::badge("deprecated")` +#' #' @return An `action_levels` object. #' #' @section Defining threshold values: #' -#' Any threshold values supplied for the `warn_at`, `stop_at`, or `notify_at` -#' arguments correspond to the `warn`, `stop`, and `notify` failure states, -#' respectively. A threshold value can either relates to an absolute number of -#' test units or a fraction-of-total test units that are *failing*. Exceeding -#' the threshold means entering one or more of the `warn`, `stop`, or `notify` -#' failure states. +#' Any threshold values supplied for the `warn`, `error`, or `critical` +#' arguments correspond to the failure states of the same name. +#' A threshold value can either relates to an absolute number of +#' test units or a fraction-of-total test units that are *failing*. +#' Exceeding the threshold means entering one or more of the `warn`, `error`, +#' or `critical` failure states. #' #' If a threshold value is a decimal value between `0` and `1` then it's a #' proportional failure threshold (e.g., `0.15` indicates that if 15 percent of @@ -131,14 +138,14 @@ #' ``` #' #' Create an `action_levels` object with fractional values for the `warn`, -#' `stop`, and `notify` states. +#' `error`, and `critical` states. #' #' ```r #' al <- #' action_levels( -#' warn_at = 0.2, -#' stop_at = 0.8, -#' notify_at = 0.5 +#' warn = 0.2, +#' error = 0.8, +#' critical = 0.5 #' ) #' ``` #' @@ -189,7 +196,7 @@ #' ) %>% #' col_vals_gt( #' columns = a, value = 2, -#' actions = warn_on_fail(warn_at = 0.5) +#' actions = warn_on_fail(warn = 0.5) #' ) %>% #' col_vals_lt( #' columns = d, value = 20000 @@ -221,7 +228,7 @@ #' small_table %>% #' col_vals_gt( #' columns = a, value = 2, -#' actions = warn_on_fail(warn_at = 2) +#' actions = warn_on_fail(warn = 2) #' ) #' ``` #' @@ -252,7 +259,7 @@ #' #' #' With the same pipeline, not supplying anything for `actions` (it's `NULL` by -#' default) will have the same effect as using `stop_on_fail(stop_at = 1)`. +#' default) will have the same effect as using `error_on_fail(error = 1)`. #' #' ```r #' small_table %>% @@ -274,7 +281,7 @@ #' small_table %>% #' col_vals_gt( #' columns = a, value = 2, -#' actions = stop_on_fail(stop_at = 1) +#' actions = error_on_fail(error = 1) #' ) #' ``` #' @@ -287,7 +294,7 @@ #' ``` #' #' -#' This is because the `stop_on_fail()` call is auto-injected in the default +#' This is because the `error_on_fail()` call is auto-injected in the default #' case (when operating on data) for your convenience. Behind the scenes a #' 'secret agent' uses 'covert actions': all so you can type less. #' @@ -301,26 +308,47 @@ NULL #' @rdname action_levels #' @export action_levels <- function( + warn = NULL, + error = NULL, + critical = NULL, + fns = NULL, + ..., warn_at = NULL, stop_at = NULL, - notify_at = NULL, - fns = NULL + notify_at = NULL ) { - fns <- normalize_fns_list(fns = fns) + # Gradual argument name deprecation + ## Deprecation message + if (!missing(warn_at) || !missing(stop_at) || !missing(notify_at)) { + warn_deprecated_action_levels() + } + ## Guard partial matching and redundant args + rlang::check_dots_empty() + rlang::check_exclusive(warn, warn_at, .require = FALSE) + rlang::check_exclusive(error, stop_at, .require = FALSE) + rlang::check_exclusive(critical, notify_at, .require = FALSE) + ## Resolve names + warn <- warn %||% warn_at + error <- error %||% stop_at + critical <- critical %||% notify_at + + if (!inherits(fns, "action_fns")) { + fns <- normalize_fns_list(fns = fns) + } - warn_list <- normalize_fraction_count(warn_at) - stop_list <- normalize_fraction_count(stop_at) - notify_list <- normalize_fraction_count(notify_at) + warn_list <- normalize_fraction_count(warn) + error_list <- normalize_fraction_count(error) + critical_list <- normalize_fraction_count(critical) action_levels <- list( warn_fraction = warn_list$fraction, warn_count = warn_list$count, - stop_fraction = stop_list$fraction, - stop_count = stop_list$count, - notify_fraction = notify_list$fraction, - notify_count = notify_list$count, + stop_fraction = error_list$fraction, + stop_count = error_list$count, + notify_fraction = critical_list$fraction, + notify_count = critical_list$count, fns = fns ) @@ -333,102 +361,117 @@ action_levels <- function( #' @rdname action_levels #' @export -warn_on_fail <- function(warn_at = 1) { - action_levels(warn_at = warn_at, fns = list(warn = ~stock_warning(x = x))) +warn_on_fail <- function(warn = 1, warn_at = NULL) { + rlang::check_exclusive(warn, warn_at, .require = FALSE) + if (!missing(warn_at)) { + warn_deprecated_action_levels() + } + warn <- warn_at %||% warn + + action_levels( + warn = warn, + fns = action_fns(warn = ~stock_warning(x = x)) + ) } #' @rdname action_levels #' @export -stop_on_fail <- function(stop_at = 1) { - action_levels(stop_at = stop_at, fns = list(stop = ~stock_stoppage(x = x))) +error_on_fail <- function(error = 1) { + action_levels( + error = error, + fns = action_fns(error = ~stock_stoppage(x = x)) + ) } -normalize_fns_list <- function(fns) { +#' @rdname action_levels +#' @export +stop_on_fail <- function(stop_at = 1) { + cli::cli_warn(c( + "!" = "`stop_on_fail()` is deprecated.", + " " = "Please use `error_on_fail()` instead." + )) + error_on_fail(error = stop_at) +} - if (is.null(fns) || (is.list(fns) && length(fns) == 0)) { - return(list(warn = NULL, stop = NULL, notify = NULL)) +action_fns <- function(warn = NULL, error = NULL, critical = NULL) { + fns <- structure( + list(warn = warn, error = error, critical = critical, + # temp compatibility with rest of internals + stop = error, notify = critical), + class = "action_fns" + ) + if (!all(vapply(fns, function(x) is.null(x) || is_formula(x), logical(1)))) { + cli::cli_abort("Action functions must be supplied as formulas.") } + fns +} - are_formulas <- - fns %>% - vapply( - FUN.VALUE = logical(1), USE.NAMES = FALSE, - FUN = function(x) rlang::is_formula(x) - ) - - if (!all(are_formulas)) { +normalize_fns_list <- function(fns) { - stop( - "All components of the `fns` list must be formulas.", - call. = FALSE - ) + if (is.null(fns)) { + return(action_fns()) } - if ("" %in% names(fns)) { + nms <- c("warn", "error", "critical", + "stop", "notify") - stop("The `fns` list must be fully named.", call. = FALSE) - } + stopifnot( + "`fns` must be a `action_fns()` object" = is.list(fns), + "The `fns` list must be fully named." = !("" %in% rlang::names2(fns)), + "`fns` must contain valid action levels" = all(names(fns) %in% nms) + ) - if (!all(names(fns) %in% c("warn", "stop", "notify"))) { + cli::cli_warn(c( + "!" = "Passing a list to `fns` is deprecated.", + " " = "Please use `action_fns()` instead." + )) - stop( - "All names in the `fns` list must be one of `warn`, `stop`, or `notify`.", - call. = FALSE - ) - } + warn <- fns$warn %||% fns$warn_at + error <- fns$error %||% fns$error_at + critical <- fns$critical %||% fns$notify_at + + action_fns(warn, error, critical) - fns } normalize_fraction_count <- function(x) { - if (!is.null(x) && !any(c(inherits(x, "numeric"), inherits(x, "integer")))) { + fraction_count <- list(fraction = NULL, count = NULL) - stop( - "All values provided to `action_levels()` must be either ", - "`numeric` or `integer` types.", - call. = FALSE - ) + if (is.null(x)) { + return(fraction_count) } - if (!is.null(x) && x <= 0) { + stopifnot( + "Action level thresholds must be a single number." = + length(x) == 1 || is.numeric(x), + "Action level threshold values must be positive." = x > 0 + ) - stop( - "All values provided to `action_levels()` must be `>=0`.", - call. = FALSE - ) - } - - if (!is.null(x)) { - if (x < 1) { - fraction <- x - count <- NULL - } else if (x >= 1) { - count <- floor(x) %>% as.numeric() - fraction <- NULL - } + if (x < 1) { + fraction_count$fraction <- x } else { - fraction <- NULL - count <- NULL + fraction_count$count <- floor(x) } - list(fraction = fraction, count = count) + fraction_count + } prime_actions <- function(actions) { if (!is.null(actions)) { - if (is.null(actions$fns$warn)) { - actions$fns$warn <- ~stock_warning(x = x) - } - if (is.null(actions$fns$stop)) { - actions$fns$stop <- ~stock_stoppage(x = x) - } + actions$fns <- + action_fns( + warn = actions$fns$warn %||% ~stock_warning(x = x), + error = actions$fns$stop %||% ~stock_stoppage(x = x), + critical = actions$fns$critical + ) } else { actions <- action_levels( - stop_at = 1, - fns = list(stop = ~stock_stoppage(x = x)) + error = 1, + fns = action_fns(error = ~stock_stoppage(x = x)) ) } @@ -507,3 +550,13 @@ stock_warning <- function(x) { warning(failure_message, call. = FALSE) } + +warn_deprecated_action_levels <- function() { + cli::cli_warn( + c("!" = "`warn_at`, `stop_at`, and `notify_at` are deprecated.", + " " = "Action levels are now `warn`, `error`, and `critical`."), + class = "deprecatedWarning", + .frequency = "regularly", + .frequency_id = "pointblank-action-levels-args-deprecation" + ) +} diff --git a/R/col_count_match.R b/R/col_count_match.R index 33e5b379b..078a50cce 100644 --- a/R/col_count_match.R +++ b/R/col_count_match.R @@ -353,7 +353,7 @@ expect_col_count_match <- function( col_count_match( count = {{ count }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -406,7 +406,7 @@ test_col_count_match <- function( col_count_match( count = {{ count }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_exists.R b/R/col_exists.R index 986c9e0e3..024dc2a10 100644 --- a/R/col_exists.R +++ b/R/col_exists.R @@ -334,7 +334,7 @@ expect_col_exists <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_exists( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -404,7 +404,7 @@ test_col_exists <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_exists( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_is_character.R b/R/col_is_character.R index 6d34e92a8..c8105d677 100644 --- a/R/col_is_character.R +++ b/R/col_is_character.R @@ -325,7 +325,7 @@ expect_col_is_character <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_character( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -396,7 +396,7 @@ test_col_is_character <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_character( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_is_date.R b/R/col_is_date.R index 351e70da6..4c4b0b1bc 100644 --- a/R/col_is_date.R +++ b/R/col_is_date.R @@ -317,7 +317,7 @@ expect_col_is_date <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_date( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -390,7 +390,7 @@ test_col_is_date <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_date( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_is_factor.R b/R/col_is_factor.R index 0e8a3350c..b20010b38 100644 --- a/R/col_is_factor.R +++ b/R/col_is_factor.R @@ -323,7 +323,7 @@ expect_col_is_factor <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_factor( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -396,7 +396,7 @@ test_col_is_factor <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_factor( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_is_integer.R b/R/col_is_integer.R index 0796f8900..8aec61d58 100644 --- a/R/col_is_integer.R +++ b/R/col_is_integer.R @@ -321,7 +321,7 @@ expect_col_is_integer <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_integer( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -394,7 +394,7 @@ test_col_is_integer <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_integer( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_is_logical.R b/R/col_is_logical.R index c6832e161..b6a852fe0 100644 --- a/R/col_is_logical.R +++ b/R/col_is_logical.R @@ -318,7 +318,7 @@ expect_col_is_logical <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_logical( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -391,7 +391,7 @@ test_col_is_logical <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_logical( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_is_numeric.R b/R/col_is_numeric.R index 459b4ee1e..80b4e4d09 100644 --- a/R/col_is_numeric.R +++ b/R/col_is_numeric.R @@ -318,7 +318,7 @@ expect_col_is_numeric <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_numeric( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -391,7 +391,7 @@ test_col_is_numeric <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_numeric( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_is_posix.R b/R/col_is_posix.R index 229d8c873..b13f186dc 100644 --- a/R/col_is_posix.R +++ b/R/col_is_posix.R @@ -318,7 +318,7 @@ expect_col_is_posix <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_posix( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -391,7 +391,7 @@ test_col_is_posix <- function( create_agent(tbl = object, label = "::QUIET::") %>% col_is_posix( columns = {{ columns }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_schema_match.R b/R/col_schema_match.R index 1408e78f4..6c90afa25 100644 --- a/R/col_schema_match.R +++ b/R/col_schema_match.R @@ -410,7 +410,7 @@ expect_col_schema_match <- function( complete = complete, in_order = in_order, is_exact = is_exact, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -467,7 +467,7 @@ test_col_schema_match <- function( complete = complete, in_order = in_order, is_exact = is_exact, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_between.R b/R/col_vals_between.R index d0715a8f7..621afe7d4 100644 --- a/R/col_vals_between.R +++ b/R/col_vals_between.R @@ -509,7 +509,7 @@ expect_col_vals_between <- function( inclusive = inclusive, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -599,7 +599,7 @@ test_col_vals_between <- function( inclusive = inclusive, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_decreasing.R b/R/col_vals_decreasing.R index d8545fd97..f632de3ad 100644 --- a/R/col_vals_decreasing.R +++ b/R/col_vals_decreasing.R @@ -487,7 +487,7 @@ expect_col_vals_decreasing <- function( increasing_tol = increasing_tol, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -567,7 +567,7 @@ test_col_vals_decreasing <- function( increasing_tol = increasing_tol, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_equal.R b/R/col_vals_equal.R index fa81a154b..a704a3544 100644 --- a/R/col_vals_equal.R +++ b/R/col_vals_equal.R @@ -437,7 +437,7 @@ expect_col_vals_equal <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -518,7 +518,7 @@ test_col_vals_equal <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_expr.R b/R/col_vals_expr.R index ab8f930fb..7ef6a5591 100644 --- a/R/col_vals_expr.R +++ b/R/col_vals_expr.R @@ -432,7 +432,7 @@ expect_col_vals_expr <- function( col_vals_expr( expr = {{ expr }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -485,7 +485,7 @@ test_col_vals_expr <- function( col_vals_expr( expr = {{ expr }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_gt.R b/R/col_vals_gt.R index 07b64c80e..903ecadf3 100644 --- a/R/col_vals_gt.R +++ b/R/col_vals_gt.R @@ -559,7 +559,7 @@ expect_col_vals_gt <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -640,7 +640,7 @@ test_col_vals_gt <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_gte.R b/R/col_vals_gte.R index 2588a08b2..1c944ce22 100644 --- a/R/col_vals_gte.R +++ b/R/col_vals_gte.R @@ -436,7 +436,7 @@ expect_col_vals_gte <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -517,7 +517,7 @@ test_col_vals_gte <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_in_set.R b/R/col_vals_in_set.R index 37cbdde20..333c431fb 100644 --- a/R/col_vals_in_set.R +++ b/R/col_vals_in_set.R @@ -427,7 +427,7 @@ expect_col_vals_in_set <- function( columns = {{ columns }}, set = {{ set }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -505,7 +505,7 @@ test_col_vals_in_set <- function( columns = {{ columns }}, set = {{ set }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_increasing.R b/R/col_vals_increasing.R index 1b55db9c8..3c8805c2c 100644 --- a/R/col_vals_increasing.R +++ b/R/col_vals_increasing.R @@ -475,7 +475,7 @@ expect_col_vals_increasing <- function( decreasing_tol = decreasing_tol, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -561,7 +561,7 @@ test_col_vals_increasing <- function( decreasing_tol = decreasing_tol, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_lt.R b/R/col_vals_lt.R index 179c64ef6..95d5f4b35 100644 --- a/R/col_vals_lt.R +++ b/R/col_vals_lt.R @@ -438,7 +438,7 @@ expect_col_vals_lt <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -519,7 +519,7 @@ test_col_vals_lt <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_lte.R b/R/col_vals_lte.R index 7d21a5a65..a96a3a07c 100644 --- a/R/col_vals_lte.R +++ b/R/col_vals_lte.R @@ -439,7 +439,7 @@ expect_col_vals_lte <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -520,7 +520,7 @@ test_col_vals_lte <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_make_set.R b/R/col_vals_make_set.R index caab56fd2..e25f982d7 100644 --- a/R/col_vals_make_set.R +++ b/R/col_vals_make_set.R @@ -429,7 +429,7 @@ expect_col_vals_make_set <- function( columns = {{ columns }}, set = {{ set }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -507,7 +507,7 @@ test_col_vals_make_set <- function( columns = {{ columns }}, set = {{ set }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_make_subset.R b/R/col_vals_make_subset.R index 23106f1cf..09c0f0426 100644 --- a/R/col_vals_make_subset.R +++ b/R/col_vals_make_subset.R @@ -425,7 +425,7 @@ expect_col_vals_make_subset <- function( columns = {{ columns }}, set = {{ set }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -503,7 +503,7 @@ test_col_vals_make_subset <- function( columns = {{ columns }}, set = {{ set }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_not_between.R b/R/col_vals_not_between.R index d23982593..fa80f8d8b 100644 --- a/R/col_vals_not_between.R +++ b/R/col_vals_not_between.R @@ -512,7 +512,7 @@ expect_col_vals_not_between <- function( inclusive = inclusive, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -602,7 +602,7 @@ test_col_vals_not_between <- function( inclusive = inclusive, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_not_equal.R b/R/col_vals_not_equal.R index 052fe586f..ab332f29e 100644 --- a/R/col_vals_not_equal.R +++ b/R/col_vals_not_equal.R @@ -436,7 +436,7 @@ expect_col_vals_not_equal <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -517,7 +517,7 @@ test_col_vals_not_equal <- function( value = {{ value }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_not_in_set.R b/R/col_vals_not_in_set.R index 3f8fc1348..0321d2f13 100644 --- a/R/col_vals_not_in_set.R +++ b/R/col_vals_not_in_set.R @@ -422,7 +422,7 @@ expect_col_vals_not_in_set <- function( columns = {{ columns }}, set = {{ set }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -500,7 +500,7 @@ test_col_vals_not_in_set <- function( columns = {{ columns }}, set = {{ set }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_not_null.R b/R/col_vals_not_null.R index 44129a0b4..e6439edda 100644 --- a/R/col_vals_not_null.R +++ b/R/col_vals_not_null.R @@ -409,7 +409,7 @@ expect_col_vals_not_null <- function( col_vals_not_null( columns = {{ columns }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -483,7 +483,7 @@ test_col_vals_not_null <- function( col_vals_not_null( columns = {{ columns }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_null.R b/R/col_vals_null.R index ee1814340..63d1b826d 100644 --- a/R/col_vals_null.R +++ b/R/col_vals_null.R @@ -408,7 +408,7 @@ expect_col_vals_null <- function( col_vals_null( columns = {{ columns }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -482,7 +482,7 @@ test_col_vals_null <- function( col_vals_null( columns = {{ columns }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_regex.R b/R/col_vals_regex.R index f961a16f7..e394dba57 100644 --- a/R/col_vals_regex.R +++ b/R/col_vals_regex.R @@ -430,7 +430,7 @@ expect_col_vals_regex <- function( regex = {{ regex }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -510,7 +510,7 @@ test_col_vals_regex <- function( regex = {{ regex }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/col_vals_within_spec.R b/R/col_vals_within_spec.R index 1557481f4..c8287434e 100644 --- a/R/col_vals_within_spec.R +++ b/R/col_vals_within_spec.R @@ -495,7 +495,7 @@ expect_col_vals_within_spec <- function( spec = {{ spec }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -575,7 +575,7 @@ test_col_vals_within_spec <- function( spec = {{ spec }}, na_pass = na_pass, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/conjointly.R b/R/conjointly.R index 5f203832c..844a35ec5 100644 --- a/R/conjointly.R +++ b/R/conjointly.R @@ -468,7 +468,7 @@ expect_conjointly <- function( conjointly( .list = .list, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -519,7 +519,7 @@ test_conjointly <- function( conjointly( .list = .list, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/draft_validation.R b/R/draft_validation.R index 4a9d5f7ac..37e84cf2d 100644 --- a/R/draft_validation.R +++ b/R/draft_validation.R @@ -348,7 +348,7 @@ draft_validation <- function( tbl = tbl, tbl_name = tbl_name, label = "Validation plan generated by `draft_validation()`.", - actions = action_levels(warn_at = 0.05, stop_at = 0.10), + actions = action_levels(warn = 0.05, error = 0.10), lang = lang ) diff --git a/R/get_agent_report.R b/R/get_agent_report.R index 10621aa99..639a45333 100644 --- a/R/get_agent_report.R +++ b/R/get_agent_report.R @@ -409,8 +409,8 @@ get_agent_report <- function( n_pass = validation_set$n_passed, f_pass = validation_set$f_passed, W = validation_set$warn, - S = validation_set$stop, - N = validation_set$notify, + E = validation_set$stop, + C = validation_set$notify, extract = extract_count ) @@ -418,10 +418,10 @@ get_agent_report <- function( report_tbl %>% dplyr::mutate( eval_pts = ifelse(eval != "OK", 10, 0), - N_pts = ifelse(!is.na(N) & N, 3, 0), - S_pts = ifelse(!is.na(S) & S, 2, 0), + C_pts = ifelse(!is.na(C) & C, 3, 0), + E_pts = ifelse(!is.na(E) & E, 2, 0), W_pts = ifelse(!is.na(W) & W, 1, 0), - total_pts = eval_pts + N_pts + S_pts + W_pts + total_pts = eval_pts + C_pts + E_pts + W_pts ) if (arrange_by == "severity") { @@ -1538,7 +1538,7 @@ get_agent_report <- function( } ) - s_upd <- + e_upd <- validation_set$stop %>% vapply( FUN.VALUE = character(1), @@ -1555,7 +1555,7 @@ get_agent_report <- function( } ) - n_upd <- + c_upd <- validation_set$notify %>% vapply( FUN.VALUE = character(1), @@ -1600,17 +1600,17 @@ get_agent_report <- function( f_pass = f_pass_val, f_fail = f_fail_val, W_val = W, - S_val = S, - N_val = N, + E_val = E, + C_val = C, W = w_upd, - S = s_upd, - N = n_upd, + E = e_upd, + C = c_upd, extract = extract_upd ) %>% dplyr::select( status_color, i, type, columns, values, precon, eval_sym, units, - n_pass, f_pass, n_fail, f_fail, W, S, N, extract, - W_val, S_val, N_val, eval, active + n_pass, f_pass, n_fail, f_fail, W, E, C, extract, + W_val, E_val, C_val, eval, active ) %>% gt::gt(id = "pb_agent", locale = locale) %>% gt::tab_header( @@ -1656,7 +1656,7 @@ get_agent_report <- function( ) %>% gt::cols_align( align = "center", - columns = c("precon", "eval_sym", "W", "S", "N", "extract") + columns = c("precon", "eval_sym", "W", "E", "C", "extract") ) %>% gt::cols_align( align = "center", @@ -1677,12 +1677,12 @@ get_agent_report <- function( gt::fmt_markdown( columns = c( "type", "columns", "values", "precon", - "eval_sym", "W", "S", "N", "extract" + "eval_sym", "W", "E", "C", "extract" ) ) %>% gt::sub_missing(columns = c("columns", "values", "units", "extract")) %>% gt::sub_missing(columns = "status_color", missing_text = "") %>% - gt::cols_hide(columns = c("W_val", "S_val", "N_val", "active", "eval")) %>% + gt::cols_hide(columns = c("W_val", "E_val", "C_val", "active", "eval")) %>% gt::text_transform( locations = gt::cells_body(columns = "units"), fn = function(x) { @@ -1741,7 +1741,7 @@ get_agent_report <- function( style = gt::cell_fill(color = "#CF142B"), locations = gt::cells_body( columns = "status_color", - rows = S_val + rows = E_val ) ) %>% gt::tab_style( @@ -1764,11 +1764,11 @@ get_agent_report <- function( gt::cell_borders(sides = "right", color = "#D3D3D3"), gt::cell_fill(color = "#FCFCFC") ), - locations = gt::cells_body(columns = c("eval_sym", "N")) + locations = gt::cells_body(columns = c("eval_sym", "C")) ) %>% gt::tab_style( style = gt::cell_fill(color = "#FCFCFC"), - locations = gt::cells_body(columns = "S") + locations = gt::cells_body(columns = "E") ) %>% gt::tab_style( style = gt::cell_borders( @@ -1812,7 +1812,7 @@ get_agent_report <- function( locations = gt::cells_body( columns = c( "precon", "eval_sym", "units", "f_pass", "f_fail", - "n_pass", "n_fail", "W", "S", "N", "extract" + "n_pass", "n_fail", "W", "E", "C", "extract" ) ), fn = function(x) { @@ -1831,7 +1831,7 @@ get_agent_report <- function( locations = gt::cells_body( columns = c( "precon", "eval_sym", "units", "f_pass", "f_fail", - "n_pass", "n_fail", "W", "S", "N", "extract" + "n_pass", "n_fail", "W", "E", "C", "extract" ) ) ) %>% @@ -1873,8 +1873,8 @@ get_agent_report <- function( "n_pass" ~ gt::px(50), "n_fail" ~ gt::px(50), "W" ~ gt::px(30), - "S" ~ gt::px(30), - "N" ~ gt::px(30), + "E" ~ gt::px(30), + "C" ~ gt::px(30), gt::everything() ~ gt::px(20) ) %>% gt::tab_style( @@ -1931,8 +1931,8 @@ get_agent_report <- function( "precon" ~ gt::px(50), "eval_sym" ~ gt::px(50), "W" ~ gt::px(30), - "S" ~ gt::px(30), - "N" ~ gt::px(30), + "E" ~ gt::px(30), + "C" ~ gt::px(30), "extract" ~ gt::px(65), gt::everything() ~ gt::px(50) ) %>% @@ -2263,14 +2263,14 @@ make_action_levels_html <- function( pb_fmt_number(actions$warn_count, decimals = 0, locale = locale) ) %||% "—" - stop <- + error <- c( pb_fmt_number(actions$stop_fraction, decimals = 2, locale = locale), pb_fmt_number(actions$stop_count, decimals = 0, locale = locale) ) %||% "—" - notify <- + critical <- c( pb_fmt_number(actions$notify_fraction, decimals = 2, locale = locale), pb_fmt_number(actions$notify_count, decimals = 0, locale = locale) @@ -2308,7 +2308,7 @@ make_action_levels_html <- function( ) ), htmltools::tags$span( - "STOP", + "ERROR", style = htmltools::css( `background-color` = "#D0182F", color = "white", @@ -2323,7 +2323,7 @@ make_action_levels_html <- function( ) ), htmltools::tags$span( - htmltools::HTML(stop), + htmltools::HTML(error), style = htmltools::css( `background-color` = "none", color = "#333333", @@ -2337,7 +2337,7 @@ make_action_levels_html <- function( ) ), htmltools::tags$span( - "NOTIFY", + "CRITICAL", style = htmltools::css( `background-color` = "#499FFE", color = "white", @@ -2352,7 +2352,7 @@ make_action_levels_html <- function( ) ), htmltools::tags$span( - htmltools::HTML(notify), + htmltools::HTML(critical), style = htmltools::css( `background-color` = "none", color = "#333333", diff --git a/R/get_agent_x_list.R b/R/get_agent_x_list.R index 927821d2d..19c346a2e 100644 --- a/R/get_agent_x_list.R +++ b/R/get_agent_x_list.R @@ -68,8 +68,8 @@ #' `n_passed` / `n` (`num [1]`) #' \item `f_failed`: the fraction of failing test units for the validation step, #' `n_failed` / `n` (`num [1]`) -#' \item `warn`, `stop`, `notify`: a logical value indicating whether the level -#' of failing test units caused the corresponding conditions to be entered +#' \item `warn`, `error`, `critical`: a logical value indicating whether the +#' level of failing test units caused the corresponding conditions to be entered #' (`lgl [1]`) #' \item `lang`: the two-letter language code that indicates which #' language should be used for all briefs, the agent report, and the reporting @@ -80,8 +80,8 @@ #' then certain length-one components in the **x-list** will be expanded to the #' total number of validation steps (these are: `i`, `type`, `columns`, #' `values`, `briefs`, `eval_error`, `eval_warning`, `capture_stack`, `n`, -#' `n_passed`, `n_failed`, `f_passed`, `f_failed`, `warn`, `stop`, and -#' `notify`). The **x-list** will also have additional components when `i` is +#' `n_passed`, `n_failed`, `f_passed`, `f_failed`, `warn`, `error`, and +#' `critical`). The **x-list** will also have additional components when `i` is #' `NULL`, which are: #' \itemize{ #' \item `report_object`: a **gt** table object, which is also presented as the @@ -125,14 +125,14 @@ #' ``` #' #' Create an `action_levels()` list with fractional values for the `warn`, -#' `stop`, and `notify` states. +#' `error`, and `critical` states. #' #' ```r #' al <- #' action_levels( -#' warn_at = 0.2, -#' stop_at = 0.8, -#' notify_at = 0.345 +#' warn = 0.2, +#' error = 0.8, +#' critical = 0.345 #' ) #' ``` #' @@ -175,8 +175,8 @@ get_agent_x_list <- function( if (!is.null(i)) { .warn <- agent$validation_set[[i, "warn"]] - .notify <- agent$validation_set[[i, "notify"]] - .stop <- agent$validation_set[[i, "stop"]] + .error <- agent$validation_set[[i, "stop"]] + .critical <- agent$validation_set[[i, "notify"]] .agent_label <- agent$label .time_start <- agent$time_start @@ -232,8 +232,8 @@ get_agent_x_list <- function( f_passed = .f_passed, f_failed = .f_failed, warn = .warn, - stop = .stop, - notify = .notify, + error = .error, + critical = .critical, lang = .lang ) @@ -243,8 +243,8 @@ get_agent_x_list <- function( if (is.null(i)) { .warn <- agent$validation_set$warn - .notify <- agent$validation_set$notify - .stop <- agent$validation_set$stop + .error <- agent$validation_set$stop + .critical <- agent$validation_set$notify .agent_label <- agent$label .time_start <- agent$time_start @@ -343,8 +343,8 @@ get_agent_x_list <- function( f_passed = .f_passed, f_failed = .f_failed, warn = .warn, - stop = .stop, - notify = .notify, + error = .error, + critical = .critical, lang = .lang, validation_set = .validation_set, report_object = .report_object, diff --git a/R/interrogate.R b/R/interrogate.R index 0ff376ee1..9a3b7eb48 100644 --- a/R/interrogate.R +++ b/R/interrogate.R @@ -526,7 +526,7 @@ interrogate <- function( tidy_gsub( "threshold\\s+?=\\s+?[0-9\\.]+?", paste0( - "actions = action_levels(stop_at = ", + "actions = action_levels(error = ", threshold_value, ")" ) ) @@ -550,7 +550,7 @@ interrogate <- function( tidy_gsub( "\\)$", paste0( - ", actions = action_levels(stop_at = ", + ", actions = action_levels(error = ", threshold_value, "))" ) ) @@ -895,7 +895,7 @@ create_post_step_cli_output_a <- function( if (validation_condition == "STOP") { cli::cli_alert_danger( c( - "Step {.field {i}}: {.red STOP} condition met.", + "Step {.field {i}}: {.red ERROR} condition met.", print_time(time_diff_s), step_label ) @@ -913,8 +913,8 @@ create_post_step_cli_output_a <- function( if (validation_condition == "STOP") { cli::cli_alert_danger( c( - "Step {.field {i}}: {.red STOP} and ", - "{.blue NOTIFY} conditions met.", + "Step {.field {i}}: {.red ERROR} and ", + "{.blue CRITICAL} conditions met.", print_time(time_diff_s), step_label ) @@ -923,7 +923,7 @@ create_post_step_cli_output_a <- function( cli::cli_alert_warning( c( "Step {.field {i}}: {.yellow WARNING} and ", - "{.blue NOTIFY} conditions met.", + "{.blue CRITICAL} conditions met.", print_time(time_diff_s), step_label ) @@ -932,7 +932,7 @@ create_post_step_cli_output_a <- function( } else if (validation_condition == "NONE" && notify_condition != "NONE") { cli::cli_alert_warning( c( - "Step {.field {i}}: {.blue NOTIFY} condition met.", + "Step {.field {i}}: {.blue CRITICAL} condition met.", print_time(time_diff_s), step_label ) diff --git a/R/print.R b/R/print.R index a80c82c9e..75889ee8c 100644 --- a/R/print.R +++ b/R/print.R @@ -270,7 +270,7 @@ print.x_list_i <- function(x, ...) { "({.green num [{length_rows}]})" ) cli::cli_text( - "{.cyan $warn $stop $notify} ({.yellow lgl [{length_rows}]})" + "{.cyan $warn $error $critical} ({.yellow lgl [{length_rows}]})" ) cli::cli_text( "{.cyan $lang} ({.red chr [1]})" @@ -321,7 +321,7 @@ knit_print.x_list_i <- function(x, ...) { "$capture_stack (list [{length(x$capture_stack)}])\n", "$n $n_passed $n_failed $f_passed $f_failed ", "(num [{length_rows}])\n", - "$warn $stop $notify (lgl [{length_rows}])\n", + "$warn $error $critical (lgl [{length_rows}])\n", "$lang (chr [1])\n", "{bottom_rule}\n" ) @@ -395,7 +395,7 @@ print.x_list_n <- function(x, ...) { "({.green num [{length_rows}]})" ) cli::cli_text( - "{.cyan $warn $stop $notify} ({.yellow lgl [{length_rows}]})" + "{.cyan $warn $error $critical} ({.yellow lgl [{length_rows}]})" ) cli::cli_text( "{.cyan $validation_set} ", @@ -461,7 +461,7 @@ knit_print.x_list_n <- function(x, ...) { "$capture_stack (list [{length(x$capture_stack)}])\n", "$n $n_passed $n_failed $f_passed $f_failed ", "(num [{length_rows}])\n", - "$warn $stop $notify (lgl [{length_rows}])\n", + "$warn $error $critical (lgl [{length_rows}])\n", "$validation_set (tbl_df [{validation_set_rows}, ", "{validation_set_cols}])\n", "$lang (chr [1])\n", @@ -534,22 +534,22 @@ print.action_levels <- function(x, ...) { if (!is.null(x$stop_fraction)) { cli::cli_text( - "{.red STOP} failure threshold of {x$stop_fraction} of all test units." + "{.red ERROR} failure threshold of {x$stop_fraction} of all test units." ) } if (!is.null(x$stop_count)) { cli::cli_text( - "{.red STOP} failure threshold of ", + "{.red ERROR} failure threshold of ", "{pb_fmt_number(x$stop_count, decimals = 0)} test units." ) } if (has_stop_fns) { if (is.null(x$stop_fraction) && is.null(x$stop_count)) { cli::cli_alert_warning( - "{.red STOP} fns provided without a failure threshold." + "{.red ERROR} fns provided without a failure threshold." ) cli::cli_alert_info( - "Set the {.red STOP} threshold using the `stop_at` argument." + "Set the {.red ERROR} threshold using the `error` argument." ) cli::cli_text() } else { @@ -561,22 +561,22 @@ print.action_levels <- function(x, ...) { if (!is.null(x$notify_fraction)) { cli::cli_text( - "{.blue NOTIFY} failure threshold of {x$notify_fraction} of all test units." + "{.blue CRITICAL} failure threshold of {x$notify_fraction} of all test units." ) } if (!is.null(x$notify_count)) { cli::cli_text( - "{.blue NOTIFY} failure threshold of ", + "{.blue CRITICAL} failure threshold of ", "{pb_fmt_number(x$notify_count, decimals = 0)} test units." ) } if (has_notify_fns) { if (is.null(x$notify_fraction) && is.null(x$notify_count)) { cli::cli_alert_warning( - "{.blue NOTIFY} fns provided without a failure threshold." + "{.blue CRITICAL} fns provided without a failure threshold." ) cli::cli_alert_info( - "Set the {.blue NOTIFY} threshold using the `notify_at` argument." + "Set the {.blue CRITICAL} threshold using the `critical` argument." ) cli::cli_text() } else { @@ -651,7 +651,7 @@ knit_print.action_levels <- function(x, ...) { action_levels_lines <- c(action_levels_lines, paste0( - "STOP failure threshold of ", + "ERROR failure threshold of ", x$stop_fraction, " of all test units." ) @@ -661,7 +661,7 @@ knit_print.action_levels <- function(x, ...) { action_levels_lines <- c(action_levels_lines, paste0( - "STOP failure threshold of ", + "ERROR failure threshold of ", pb_fmt_number(x$stop_count, decimals = 0), "test units." ) @@ -672,8 +672,8 @@ knit_print.action_levels <- function(x, ...) { action_levels_lines <- c(action_levels_lines, paste0( - "STOP fns provided without a failure threshold.\n", - "Set the STOP threshold using the `stop_at` argument.\n" + "ERROR fns provided without a failure threshold.\n", + "Set the ERROR threshold using the `error` argument.\n" ) ) } else { @@ -688,7 +688,7 @@ knit_print.action_levels <- function(x, ...) { action_levels_lines <- c(action_levels_lines, paste0( - "NOTIFY failure threshold of ", + "CRITICAL failure threshold of ", x$notify_fraction, " of all test units." ) @@ -698,7 +698,7 @@ knit_print.action_levels <- function(x, ...) { action_levels_lines <- c(action_levels_lines, paste0( - "NOTIFY failure threshold of ", + "CRITICAL failure threshold of ", pb_fmt_number(x$notify_count, decimals = 0), "test units." ) @@ -709,8 +709,8 @@ knit_print.action_levels <- function(x, ...) { action_levels_lines <- c(action_levels_lines, paste0( - "NOTIFY fns provided without a failure threshold.\n", - "Set the NOTIFY threshold using the `notify_at` argument.\n" + "CRITICAL fns provided without a failure threshold.\n", + "Set the CRITICAL threshold using the `critical` argument.\n" ) ) } else { diff --git a/R/row_count_match.R b/R/row_count_match.R index c382688d4..26e64c360 100644 --- a/R/row_count_match.R +++ b/R/row_count_match.R @@ -444,7 +444,7 @@ expect_row_count_match <- function( row_count_match( count = {{ count }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -514,7 +514,7 @@ test_row_count_match <- function( row_count_match( count = {{ count }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/rows_complete.R b/R/rows_complete.R index 9dce015df..4b12a7ab5 100644 --- a/R/rows_complete.R +++ b/R/rows_complete.R @@ -398,7 +398,7 @@ expect_rows_complete <- function( rows_complete( columns = {{ columns }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -451,7 +451,7 @@ test_rows_complete <- function( rows_complete( columns = {{ columns }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/rows_distinct.R b/R/rows_distinct.R index c7096f5ee..fb9c2a074 100644 --- a/R/rows_distinct.R +++ b/R/rows_distinct.R @@ -399,7 +399,7 @@ expect_rows_distinct <- function( rows_distinct( columns = {{ columns }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -452,7 +452,7 @@ test_rows_distinct <- function( rows_distinct( columns = {{ columns }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/serially.R b/R/serially.R index bda525014..5bec3e072 100644 --- a/R/serially.R +++ b/R/serially.R @@ -708,7 +708,7 @@ expect_serially <- function( serially( .list = .list, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -759,7 +759,7 @@ test_serially <- function( serially( .list = .list, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/specially.R b/R/specially.R index 548f7f161..e37b852fa 100644 --- a/R/specially.R +++ b/R/specially.R @@ -422,7 +422,7 @@ expect_specially <- function( specially( fn = fn, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -470,7 +470,7 @@ test_specially <- function( specially( fn = fn, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/tbl_match.R b/R/tbl_match.R index a270c5dba..3f5679c33 100644 --- a/R/tbl_match.R +++ b/R/tbl_match.R @@ -398,7 +398,7 @@ expect_tbl_match <- function( tbl_match( tbl_compare = {{ tbl_compare }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set @@ -451,7 +451,7 @@ test_tbl_match <- function( tbl_match( tbl_compare = {{ tbl_compare }}, preconditions = {{ preconditions }}, - actions = action_levels(notify_at = threshold) + actions = action_levels(critical = threshold) ) %>% interrogate() %>% .$validation_set diff --git a/R/yaml_read_agent.R b/R/yaml_read_agent.R index 3ae51dc72..c8fbe7359 100644 --- a/R/yaml_read_agent.R +++ b/R/yaml_read_agent.R @@ -478,17 +478,17 @@ make_action_levels_str <- function(al) { if (!is.null(al$warn_fraction) || !is.null(al$warn_count)) { top_args <- - c(top_args, paste0("warn_at = ", c(al$warn_fraction, al$warn_count))) + c(top_args, paste0("warn = ", c(al$warn_fraction, al$warn_count))) } if (!is.null(al$stop_fraction) || !is.null(al$stop_count)) { top_args <- - c(top_args, paste0("stop_at = ", c(al$stop_fraction, al$stop_count))) + c(top_args, paste0("error = ", c(al$stop_fraction, al$stop_count))) } if (!is.null(al$notify_fraction) || !is.null(al$notify_count)) { top_args <- c( top_args, - paste0("notify_at = ", c(al$notify_fraction, al$notify_count)) + paste0("critical = ", c(al$notify_fraction, al$notify_count)) ) } @@ -498,15 +498,15 @@ make_action_levels_str <- function(al) { fns_args <- c(fns_args, paste0("warn = ", al$fns$warn)) } if (!is.null(al$fns$stop)) { - fns_args <- c(fns_args, paste0("stop = ", al$fns$stop)) + fns_args <- c(fns_args, paste0("error = ", al$fns$stop)) } if (!is.null(al$fns$notify)) { - fns_args <- c(fns_args, paste0("notify = ", al$fns$notify)) + fns_args <- c(fns_args, paste0("critical = ", al$fns$notify)) } if (length(fns_args) > 0) { fns_args <- - paste0(" fns = list(\n", paste0(" ", fns_args), "\n )") + paste0(" fns = action_fns(\n", paste0(" ", fns_args), "\n )") } paste0( diff --git a/R/yaml_write.R b/R/yaml_write.R index a18d2af6b..ff2a0b331 100644 --- a/R/yaml_write.R +++ b/R/yaml_write.R @@ -751,8 +751,6 @@ to_list_action_levels <- function(actions) { agent_actions[sapply(agent_actions, is.null)] <- NULL agent_actions$fns[sapply(agent_actions$fns, is.null)] <- NULL - if (length(agent_actions$fns) == 0) agent_actions$fns <- NULL - if (length(agent_actions$fns) == 0) { agent_actions$fns <- NULL } else { diff --git a/man/action_levels.Rd b/man/action_levels.Rd index 09e87e188..ce4840dea 100644 --- a/man/action_levels.Rd +++ b/man/action_levels.Rd @@ -3,36 +3,48 @@ \name{action_levels} \alias{action_levels} \alias{warn_on_fail} +\alias{error_on_fail} \alias{stop_on_fail} \title{Set action levels: failure thresholds and functions to invoke} \usage{ -action_levels(warn_at = NULL, stop_at = NULL, notify_at = NULL, fns = NULL) +action_levels( + warn = NULL, + error = NULL, + critical = NULL, + fns = NULL, + ..., + warn_at = NULL, + stop_at = NULL, + notify_at = NULL +) -warn_on_fail(warn_at = 1) +warn_on_fail(warn = 1, warn_at = NULL) + +error_on_fail(error = 1) stop_on_fail(stop_at = 1) } \arguments{ -\item{warn_at}{\emph{Threshold value for the 'warn' failure state} +\item{warn}{\emph{Threshold value for the 'warn' failure state} \code{scalar(val>=0)} // \emph{default:} \code{NULL} (\code{optional}) Either the threshold number or the threshold fraction of \emph{failing} test units that result in entering the \code{warn} failure state.} -\item{stop_at}{\emph{Threshold value for the 'stop' failure state} +\item{error}{\emph{Threshold value for the 'stop' failure state} \code{scalar(val>=0)} // \emph{default:} \code{NULL} (\code{optional}) Either the threshold number or the threshold fraction of \emph{failing} test -units that result in entering the \code{stop} failure state.} +units that result in entering the \code{error} failure state.} -\item{notify_at}{\emph{Threshold value for the 'notify' failure state} +\item{critical}{\emph{Threshold value for the 'notify' failure state} \code{scalar(val>=0)} // \emph{default:} \code{NULL} (\code{optional}) Either the threshold number or the threshold fraction of \emph{failing} test -units that result in entering the \code{notify} failure state.} +units that result in entering the \code{critical} failure state.} \item{fns}{\emph{Functions to execute when entering failure states} @@ -40,10 +52,18 @@ units that result in entering the \code{notify} failure state.} A named list of functions that is to be paired with the appropriate failure states. The syntax for this list involves using failure state names from -the set of \code{warn}, \code{stop}, and \code{notify}. The functions corresponding to the +the set of \code{warn}, \code{error}, and \code{critical}. The functions corresponding to the failure states are provided as formulas (e.g., \code{list(warn = ~ warning("Too many failures."))}. A series of expressions for each named state can be used by enclosing the set of statements with \code{{ }}.} + +\item{...}{These dots are for future extensions and must be empty.} + +\item{warn_at}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}} + +\item{stop_at}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}} + +\item{notify_at}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}} } \value{ An \code{action_levels} object. @@ -52,8 +72,8 @@ An \code{action_levels} object. The \code{action_levels()} function works with the \code{actions} argument that is present in the \code{\link[=create_agent]{create_agent()}} function and in every validation step function (which also has an \code{actions} argument). With it, we can provide -threshold \emph{failure} values for any combination of \code{warn}, \code{stop}, or \code{notify} -failure states. +threshold \emph{failure} values for any combination of \code{warn}, \code{error}, or +\code{critical} failure states. We can react to any entering of a state by supplying corresponding functions to the \code{fns} argument. They will undergo evaluation at the time when the @@ -67,31 +87,32 @@ of \code{action_levels()} is required to have any useful side effects (i.e., warnings, throwing errors) in the case of validation functions operating directly on data (e.g., \code{mtcars \%>\% col_vals_lt("mpg", 35)}). There are two helper functions that are convenient when using validation functions directly -on data (the \code{agent}-less workflow): \code{warn_on_fail()} and \code{stop_on_fail()}. +on data (the \code{agent}-less workflow): \code{warn_on_fail()} and \code{error_on_fail()}. These helpers either warn or stop (default failure threshold for each is set to \code{1}), and, they do so with informative warning or error messages. The -\code{stop_on_fail()} helper is applied by default when using validation functions -directly on data (more information on this is provided in \emph{Details}). +\code{error_on_fail()} helper is applied by default when using validation +functions directly on data (more information on this is provided in +\emph{Details}). } \details{ The output of the \code{action_levels()} call in \code{actions} will be interpreted slightly differently if using an \emph{agent} or using validation functions directly on a data table. For convenience, when working directly on data, any -values supplied to \code{warn_at} or \code{stop_at} will be automatically given a stock +values supplied to \code{warn} or \code{error} will be automatically given a stock \code{warning()} or \code{stop()} function. For example using \code{small_table \%>\% col_is_integer("date")} will provide a detailed stop message by default, indicating the reason for the failure. If you were to supply the -\code{fns} for \code{stop} or \code{warn} manually then the stock functions would be +\code{fns} for \code{warn} or \code{error} manually then the stock functions would be overridden. Furthermore, if \code{actions} is NULL in this workflow (the default), -\strong{pointblank} will use a \code{stop_at} value of \code{1} (providing a detailed, +\strong{pointblank} will use a \code{error} value of \code{1} (providing a detailed, context-specific error message if there are any \emph{failing} units). We can absolutely suppress this automatic stopping behavior at each validation step by setting \code{active = FALSE}. In this interactive data case, there is no -stock function given for \code{notify_at}. The \code{notify} failure state is less +stock function given for \code{critical}. The \code{critical} failure state is less commonly used in this workflow as it is in the \emph{agent}-based one. When using an \emph{agent}, we often opt to not use any functions in \code{fns} as the -\code{warn}, \code{stop}, and \code{notify} failure states will be reported on when using +\code{warn}, \code{error}, and \code{critical} failure states will be reported on when using \code{create_agent_report()} (and, usually that's sufficient). Instead, using the \code{end_fns} argument is a better choice since that scheme provides useful data on the entire interrogation, allowing for finer control on side effects and @@ -100,12 +121,12 @@ reducing potential for duplicating any side effects. \section{Defining threshold values}{ -Any threshold values supplied for the \code{warn_at}, \code{stop_at}, or \code{notify_at} -arguments correspond to the \code{warn}, \code{stop}, and \code{notify} failure states, -respectively. A threshold value can either relates to an absolute number of -test units or a fraction-of-total test units that are \emph{failing}. Exceeding -the threshold means entering one or more of the \code{warn}, \code{stop}, or \code{notify} -failure states. +Any threshold values supplied for the \code{warn}, \code{error}, or \code{critical} +arguments correspond to the failure states of the same name. +A threshold value can either relates to an absolute number of +test units or a fraction-of-total test units that are \emph{failing}. +Exceeding the threshold means entering one or more of the \code{warn}, \code{error}, +or \code{critical} failure states. If a threshold value is a decimal value between \code{0} and \code{1} then it's a proportional failure threshold (e.g., \code{0.15} indicates that if 15 percent of @@ -140,13 +161,13 @@ For these examples, we will use the included \code{small_table} dataset. }\if{html}{\out{}} Create an \code{action_levels} object with fractional values for the \code{warn}, -\code{stop}, and \code{notify} states. +\code{error}, and \code{critical} states. -\if{html}{\out{
}}\preformatted{al <- +\if{html}{\out{
}}\preformatted{al <- action_levels( - warn_at = 0.2, - stop_at = 0.8, - notify_at = 0.5 + warn = 0.2, + error = 0.8, + critical = 0.5 ) }\if{html}{\out{
}} @@ -193,7 +214,7 @@ another such object to the validation step instead (this time using the ) \%>\% col_vals_gt( columns = a, value = 2, - actions = warn_on_fail(warn_at = 0.5) + actions = warn_on_fail(warn = 0.5) ) \%>\% col_vals_lt( columns = d, value = 20000 @@ -222,26 +243,26 @@ data). \if{html}{\out{
}}\preformatted{small_table \%>\% col_vals_gt( columns = a, value = 2, - actions = warn_on_fail(warn_at = 2) + actions = warn_on_fail(warn = 2) ) }\if{html}{\out{
}} \preformatted{## # A tibble: 13 × 8 -## date_time date a b c d e +## date_time date a b c d e ## -## 1 2016-01-04 11:00:00 2016-01-04 2 1-bcd-… 3 3423. TRUE -## 2 2016-01-04 00:32:00 2016-01-04 3 5-egh-… 8 10000. TRUE -## 3 2016-01-05 13:32:00 2016-01-05 6 8-kdg-… 3 2343. TRUE +## 1 2016-01-04 11:00:00 2016-01-04 2 1-bcd-… 3 3423. TRUE +## 2 2016-01-04 00:32:00 2016-01-04 3 5-egh-… 8 10000. TRUE +## 3 2016-01-05 13:32:00 2016-01-05 6 8-kdg-… 3 2343. TRUE ## 4 2016-01-06 17:23:00 2016-01-06 2 5-jdo-… NA 3892. FALSE -## 5 2016-01-09 12:36:00 2016-01-09 8 3-ldm-… 7 284. TRUE -## 6 2016-01-11 06:15:00 2016-01-11 4 2-dhe-… 4 3291. TRUE -## 7 2016-01-15 18:46:00 2016-01-15 7 1-knw-… 3 843. TRUE +## 5 2016-01-09 12:36:00 2016-01-09 8 3-ldm-… 7 284. TRUE +## 6 2016-01-11 06:15:00 2016-01-11 4 2-dhe-… 4 3291. TRUE +## 7 2016-01-15 18:46:00 2016-01-15 7 1-knw-… 3 843. TRUE ## 8 2016-01-17 11:27:00 2016-01-17 4 5-boe-… 2 1036. FALSE ## 9 2016-01-20 04:30:00 2016-01-20 3 5-bce-… 9 838. FALSE ## 10 2016-01-20 04:30:00 2016-01-20 3 5-bce-… 9 838. FALSE -## 11 2016-01-26 20:07:00 2016-01-26 4 2-dmx-… 7 834. TRUE +## 11 2016-01-26 20:07:00 2016-01-26 4 2-dmx-… 7 834. TRUE ## 12 2016-01-28 02:51:00 2016-01-28 2 7-dmx-… 8 108. FALSE -## 13 2016-01-30 11:23:00 2016-01-30 1 3-dka-… NA 2230. TRUE +## 13 2016-01-30 11:23:00 2016-01-30 1 3-dka-… NA 2230. TRUE ## # … with 1 more variable: f ## Warning message: ## Exceedance of failed test units where values in `a` should have been > @@ -253,7 +274,7 @@ data). With the same pipeline, not supplying anything for \code{actions} (it's \code{NULL} by -default) will have the same effect as using \code{stop_on_fail(stop_at = 1)}. +default) will have the same effect as using \code{error_on_fail(error = 1)}. \if{html}{\out{
}}\preformatted{small_table \%>\% col_vals_gt(columns = a, value = 2) @@ -271,7 +292,7 @@ Here's the equivalent set of statements: \if{html}{\out{
}}\preformatted{small_table \%>\% col_vals_gt( columns = a, value = 2, - actions = stop_on_fail(stop_at = 1) + actions = error_on_fail(error = 1) ) }\if{html}{\out{
}} @@ -282,7 +303,7 @@ Here's the equivalent set of statements: ## * failure level (4) >= failure threshold (1) }\if{html}{\out{
}} -This is because the \code{stop_on_fail()} call is auto-injected in the default +This is because the \code{error_on_fail()} call is auto-injected in the default case (when operating on data) for your convenience. Behind the scenes a 'secret agent' uses 'covert actions': all so you can type less. } diff --git a/man/figures/lifecycle-deprecated.svg b/man/figures/lifecycle-deprecated.svg new file mode 100644 index 000000000..b61c57c3f --- /dev/null +++ b/man/figures/lifecycle-deprecated.svg @@ -0,0 +1,21 @@ + + lifecycle: deprecated + + + + + + + + + + + + + + + lifecycle + + deprecated + + diff --git a/man/figures/lifecycle-experimental.svg b/man/figures/lifecycle-experimental.svg new file mode 100644 index 000000000..5d88fc2c6 --- /dev/null +++ b/man/figures/lifecycle-experimental.svg @@ -0,0 +1,21 @@ + + lifecycle: experimental + + + + + + + + + + + + + + + lifecycle + + experimental + + diff --git a/man/figures/lifecycle-stable.svg b/man/figures/lifecycle-stable.svg new file mode 100644 index 000000000..9bf21e76b --- /dev/null +++ b/man/figures/lifecycle-stable.svg @@ -0,0 +1,29 @@ + + lifecycle: stable + + + + + + + + + + + + + + + + lifecycle + + + + stable + + + diff --git a/man/figures/lifecycle-superseded.svg b/man/figures/lifecycle-superseded.svg new file mode 100644 index 000000000..db8d757f7 --- /dev/null +++ b/man/figures/lifecycle-superseded.svg @@ -0,0 +1,21 @@ + + lifecycle: superseded + + + + + + + + + + + + + + + lifecycle + + superseded + + diff --git a/tests/testthat/_snaps/draft_validation.md b/tests/testthat/_snaps/draft_validation.md index a80d2f82a..8467daa39 100644 --- a/tests/testthat/_snaps/draft_validation.md +++ b/tests/testthat/_snaps/draft_validation.md @@ -3,411 +3,411 @@ Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `latitude` is of type: numeric\n col_is_numeric(\n columns = c(\"latitude\")\n ) %>%\n # Expect that values in `latitude` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"latitude\"),\n left = -90,\n right = 90\n ) %>%\n # Expect that column `month` is of type: factor\n col_is_factor(\n columns = c(\"month\")\n ) %>%\n # Expect that column `tst` is of type: character\n col_is_character(\n columns = c(\"tst\")\n ) %>%\n # Expect that column `sza` is of type: numeric\n col_is_numeric(\n columns = c(\"sza\")\n ) %>%\n # Expect that values in `sza` should be between `1.9` and `89.7`\n col_vals_between(\n columns = c(\"sza\"),\n left = 1.9,\n right = 89.7,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `latitude, month, tst, sza`\n rows_distinct(\n columns = c(\"latitude\", \"month\", \"tst\", \"sza\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n latitude = \"numeric\",\n month = \"factor\",\n tst = \"character\",\n sza = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `latitude` is of type: numeric\n col_is_numeric(\n columns = c(\"latitude\")\n ) %>%\n # Expect that values in `latitude` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"latitude\"),\n left = -90,\n right = 90\n ) %>%\n # Expect that column `month` is of type: factor\n col_is_factor(\n columns = c(\"month\")\n ) %>%\n # Expect that column `tst` is of type: character\n col_is_character(\n columns = c(\"tst\")\n ) %>%\n # Expect that column `sza` is of type: numeric\n col_is_numeric(\n columns = c(\"sza\")\n ) %>%\n # Expect that values in `sza` should be between `1.9` and `89.7`\n col_vals_between(\n columns = c(\"sza\"),\n left = 1.9,\n right = 89.7,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `latitude, month, tst, sza`\n rows_distinct(\n columns = c(\"latitude\", \"month\", \"tst\", \"sza\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n latitude = \"numeric\",\n month = \"factor\",\n tst = \"character\",\n sza = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `mfr` is of type: character\n col_is_character(\n columns = c(\"mfr\")\n ) %>%\n # Expect that column `model` is of type: character\n col_is_character(\n columns = c(\"model\")\n ) %>%\n # Expect that column `year` is of type: numeric\n col_is_numeric(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `2014` and `2017`\n col_vals_between(\n columns = c(\"year\"),\n left = 2014,\n right = 2017\n ) %>%\n # Expect that column `trim` is of type: character\n col_is_character(\n columns = c(\"trim\")\n ) %>%\n # Expect that column `bdy_style` is of type: character\n col_is_character(\n columns = c(\"bdy_style\")\n ) %>%\n # Expect that column `hp` is of type: numeric\n col_is_numeric(\n columns = c(\"hp\")\n ) %>%\n # Expect that values in `hp` should be between `259` and `949`\n col_vals_between(\n columns = c(\"hp\"),\n left = 259,\n right = 949\n ) %>%\n # Expect that column `hp_rpm` is of type: numeric\n col_is_numeric(\n columns = c(\"hp_rpm\")\n ) %>%\n # Expect that values in `hp_rpm` should be between `5000` and `9000`\n col_vals_between(\n columns = c(\"hp_rpm\"),\n left = 5000,\n right = 9000\n ) %>%\n # Expect that column `trq` is of type: numeric\n col_is_numeric(\n columns = c(\"trq\")\n ) %>%\n # Expect that values in `trq` should be between `243` and `664`\n col_vals_between(\n columns = c(\"trq\"),\n left = 243,\n right = 664\n ) %>%\n # Expect that column `trq_rpm` is of type: numeric\n col_is_numeric(\n columns = c(\"trq_rpm\")\n ) %>%\n # Expect that values in `trq_rpm` should be between `1400` and `6750`\n col_vals_between(\n columns = c(\"trq_rpm\"),\n left = 1400,\n right = 6750,\n na_pass = TRUE\n ) %>%\n # Expect that column `mpg_c` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg_c\")\n ) %>%\n # Expect that values in `mpg_c` should be between `11` and `28`\n col_vals_between(\n columns = c(\"mpg_c\"),\n left = 11,\n right = 28,\n na_pass = TRUE\n ) %>%\n # Expect that column `mpg_h` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg_h\")\n ) %>%\n # Expect that values in `mpg_h` should be between `16` and `30`\n col_vals_between(\n columns = c(\"mpg_h\"),\n left = 16,\n right = 30,\n na_pass = TRUE\n ) %>%\n # Expect that column `drivetrain` is of type: character\n col_is_character(\n columns = c(\"drivetrain\")\n ) %>%\n # Expect that column `trsmn` is of type: character\n col_is_character(\n columns = c(\"trsmn\")\n ) %>%\n # Expect that column `ctry_origin` is of type: character\n col_is_character(\n columns = c(\"ctry_origin\")\n ) %>%\n # Expect that values in `ctry_origin` should be in the set of `United States`, `Italy`, `Japan` (and 2 more)\n col_vals_in_set(\n columns = c(\"ctry_origin\"),\n set = c(\"United States\", \"Italy\", \"Japan\", \"United Kingdom\", \"Germany\")\n ) %>%\n # Expect that column `msrp` is of type: numeric\n col_is_numeric(\n columns = c(\"msrp\")\n ) %>%\n # Expect that values in `msrp` should be between `53900` and `1416362`\n col_vals_between(\n columns = c(\"msrp\"),\n left = 53900,\n right = 1416362\n ) %>%\n # Expect entirely distinct rows across `mfr, model, year, trim, bdy_style, hp, hp_rpm, trq, trq_rpm, mpg_c, mpg_h, drivetrain, trsmn, ctry_origin, msrp`\n rows_distinct(\n columns = c(\"mfr\", \"model\", \"year\", \"trim\", \"bdy_style\", \"hp\", \"hp_rpm\", \"trq\", \"trq_rpm\", \"mpg_c\", \"mpg_h\", \"drivetrain\", \"trsmn\", \"ctry_origin\", \"msrp\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n mfr = \"character\",\n model = \"character\",\n year = \"numeric\",\n trim = \"character\",\n bdy_style = \"character\",\n hp = \"numeric\",\n hp_rpm = \"numeric\",\n trq = \"numeric\",\n trq_rpm = \"numeric\",\n mpg_c = \"numeric\",\n mpg_h = \"numeric\",\n drivetrain = \"character\",\n trsmn = \"character\",\n ctry_origin = \"character\",\n msrp = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `mfr` is of type: character\n col_is_character(\n columns = c(\"mfr\")\n ) %>%\n # Expect that column `model` is of type: character\n col_is_character(\n columns = c(\"model\")\n ) %>%\n # Expect that column `year` is of type: numeric\n col_is_numeric(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `2014` and `2017`\n col_vals_between(\n columns = c(\"year\"),\n left = 2014,\n right = 2017\n ) %>%\n # Expect that column `trim` is of type: character\n col_is_character(\n columns = c(\"trim\")\n ) %>%\n # Expect that column `bdy_style` is of type: character\n col_is_character(\n columns = c(\"bdy_style\")\n ) %>%\n # Expect that column `hp` is of type: numeric\n col_is_numeric(\n columns = c(\"hp\")\n ) %>%\n # Expect that values in `hp` should be between `259` and `949`\n col_vals_between(\n columns = c(\"hp\"),\n left = 259,\n right = 949\n ) %>%\n # Expect that column `hp_rpm` is of type: numeric\n col_is_numeric(\n columns = c(\"hp_rpm\")\n ) %>%\n # Expect that values in `hp_rpm` should be between `5000` and `9000`\n col_vals_between(\n columns = c(\"hp_rpm\"),\n left = 5000,\n right = 9000\n ) %>%\n # Expect that column `trq` is of type: numeric\n col_is_numeric(\n columns = c(\"trq\")\n ) %>%\n # Expect that values in `trq` should be between `243` and `664`\n col_vals_between(\n columns = c(\"trq\"),\n left = 243,\n right = 664\n ) %>%\n # Expect that column `trq_rpm` is of type: numeric\n col_is_numeric(\n columns = c(\"trq_rpm\")\n ) %>%\n # Expect that values in `trq_rpm` should be between `1400` and `6750`\n col_vals_between(\n columns = c(\"trq_rpm\"),\n left = 1400,\n right = 6750,\n na_pass = TRUE\n ) %>%\n # Expect that column `mpg_c` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg_c\")\n ) %>%\n # Expect that values in `mpg_c` should be between `11` and `28`\n col_vals_between(\n columns = c(\"mpg_c\"),\n left = 11,\n right = 28,\n na_pass = TRUE\n ) %>%\n # Expect that column `mpg_h` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg_h\")\n ) %>%\n # Expect that values in `mpg_h` should be between `16` and `30`\n col_vals_between(\n columns = c(\"mpg_h\"),\n left = 16,\n right = 30,\n na_pass = TRUE\n ) %>%\n # Expect that column `drivetrain` is of type: character\n col_is_character(\n columns = c(\"drivetrain\")\n ) %>%\n # Expect that column `trsmn` is of type: character\n col_is_character(\n columns = c(\"trsmn\")\n ) %>%\n # Expect that column `ctry_origin` is of type: character\n col_is_character(\n columns = c(\"ctry_origin\")\n ) %>%\n # Expect that values in `ctry_origin` should be in the set of `United States`, `Italy`, `Japan` (and 2 more)\n col_vals_in_set(\n columns = c(\"ctry_origin\"),\n set = c(\"United States\", \"Italy\", \"Japan\", \"United Kingdom\", \"Germany\")\n ) %>%\n # Expect that column `msrp` is of type: numeric\n col_is_numeric(\n columns = c(\"msrp\")\n ) %>%\n # Expect that values in `msrp` should be between `53900` and `1416362`\n col_vals_between(\n columns = c(\"msrp\"),\n left = 53900,\n right = 1416362\n ) %>%\n # Expect entirely distinct rows across `mfr, model, year, trim, bdy_style, hp, hp_rpm, trq, trq_rpm, mpg_c, mpg_h, drivetrain, trsmn, ctry_origin, msrp`\n rows_distinct(\n columns = c(\"mfr\", \"model\", \"year\", \"trim\", \"bdy_style\", \"hp\", \"hp_rpm\", \"trq\", \"trq_rpm\", \"mpg_c\", \"mpg_h\", \"drivetrain\", \"trsmn\", \"ctry_origin\", \"msrp\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n mfr = \"character\",\n model = \"character\",\n year = \"numeric\",\n trim = \"character\",\n bdy_style = \"character\",\n hp = \"numeric\",\n hp_rpm = \"numeric\",\n trq = \"numeric\",\n trq_rpm = \"numeric\",\n mpg_c = \"numeric\",\n mpg_h = \"numeric\",\n drivetrain = \"character\",\n trsmn = \"character\",\n ctry_origin = \"character\",\n msrp = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `open` is of type: numeric\n col_is_numeric(\n columns = c(\"open\")\n ) %>%\n # Expect that values in `open` should be between `16.66` and `2130.3601`\n col_vals_between(\n columns = c(\"open\"),\n left = 16.66,\n right = 2130.3601\n ) %>%\n # Expect that column `high` is of type: numeric\n col_is_numeric(\n columns = c(\"high\")\n ) %>%\n # Expect that values in `high` should be between `16.66` and `2134.72`\n col_vals_between(\n columns = c(\"high\"),\n left = 16.66,\n right = 2134.72\n ) %>%\n # Expect that column `low` is of type: numeric\n col_is_numeric(\n columns = c(\"low\")\n ) %>%\n # Expect that values in `low` should be between `16.66` and `2126.0601`\n col_vals_between(\n columns = c(\"low\"),\n left = 16.66,\n right = 2126.0601\n ) %>%\n # Expect that column `close` is of type: numeric\n col_is_numeric(\n columns = c(\"close\")\n ) %>%\n # Expect that values in `close` should be between `16.66` and `2130.8201`\n col_vals_between(\n columns = c(\"close\"),\n left = 16.66,\n right = 2130.8201\n ) %>%\n # Expect that column `volume` is of type: numeric\n col_is_numeric(\n columns = c(\"volume\")\n ) %>%\n # Expect that values in `volume` should be between `680000` and `11456230400`\n col_vals_between(\n columns = c(\"volume\"),\n left = 680000,\n right = 11456230000\n ) %>%\n # Expect that column `adj_close` is of type: numeric\n col_is_numeric(\n columns = c(\"adj_close\")\n ) %>%\n # Expect that values in `adj_close` should be between `16.66` and `2130.8201`\n col_vals_between(\n columns = c(\"adj_close\"),\n left = 16.66,\n right = 2130.8201\n ) %>%\n # Expect entirely distinct rows across `date, open, high, low, close, volume, adj_close`\n rows_distinct(\n columns = c(\"date\", \"open\", \"high\", \"low\", \"close\", \"volume\", \"adj_close\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date = \"Date\",\n open = \"numeric\",\n high = \"numeric\",\n low = \"numeric\",\n close = \"numeric\",\n volume = \"numeric\",\n adj_close = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `open` is of type: numeric\n col_is_numeric(\n columns = c(\"open\")\n ) %>%\n # Expect that values in `open` should be between `16.66` and `2130.3601`\n col_vals_between(\n columns = c(\"open\"),\n left = 16.66,\n right = 2130.3601\n ) %>%\n # Expect that column `high` is of type: numeric\n col_is_numeric(\n columns = c(\"high\")\n ) %>%\n # Expect that values in `high` should be between `16.66` and `2134.72`\n col_vals_between(\n columns = c(\"high\"),\n left = 16.66,\n right = 2134.72\n ) %>%\n # Expect that column `low` is of type: numeric\n col_is_numeric(\n columns = c(\"low\")\n ) %>%\n # Expect that values in `low` should be between `16.66` and `2126.0601`\n col_vals_between(\n columns = c(\"low\"),\n left = 16.66,\n right = 2126.0601\n ) %>%\n # Expect that column `close` is of type: numeric\n col_is_numeric(\n columns = c(\"close\")\n ) %>%\n # Expect that values in `close` should be between `16.66` and `2130.8201`\n col_vals_between(\n columns = c(\"close\"),\n left = 16.66,\n right = 2130.8201\n ) %>%\n # Expect that column `volume` is of type: numeric\n col_is_numeric(\n columns = c(\"volume\")\n ) %>%\n # Expect that values in `volume` should be between `680000` and `11456230400`\n col_vals_between(\n columns = c(\"volume\"),\n left = 680000,\n right = 11456230000\n ) %>%\n # Expect that column `adj_close` is of type: numeric\n col_is_numeric(\n columns = c(\"adj_close\")\n ) %>%\n # Expect that values in `adj_close` should be between `16.66` and `2130.8201`\n col_vals_between(\n columns = c(\"adj_close\"),\n left = 16.66,\n right = 2130.8201\n ) %>%\n # Expect entirely distinct rows across `date, open, high, low, close, volume, adj_close`\n rows_distinct(\n columns = c(\"date\", \"open\", \"high\", \"low\", \"close\", \"volume\", \"adj_close\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date = \"Date\",\n open = \"numeric\",\n high = \"numeric\",\n low = \"numeric\",\n close = \"numeric\",\n volume = \"numeric\",\n adj_close = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `id` is of type: character\n col_is_character(\n columns = c(\"id\")\n ) %>%\n # Expect that column `date` is of type: character\n col_is_character(\n columns = c(\"date\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `size` is of type: character\n col_is_character(\n columns = c(\"size\")\n ) %>%\n # Expect that column `type` is of type: character\n col_is_character(\n columns = c(\"type\")\n ) %>%\n # Expect that column `price` is of type: numeric\n col_is_numeric(\n columns = c(\"price\")\n ) %>%\n # Expect that values in `price` should be between `9.75` and `35.95`\n col_vals_between(\n columns = c(\"price\"),\n left = 9.75,\n right = 35.95\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n id = \"character\",\n date = \"character\",\n time = \"character\",\n name = \"character\",\n size = \"character\",\n type = \"character\",\n price = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `id` is of type: character\n col_is_character(\n columns = c(\"id\")\n ) %>%\n # Expect that column `date` is of type: character\n col_is_character(\n columns = c(\"date\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `size` is of type: character\n col_is_character(\n columns = c(\"size\")\n ) %>%\n # Expect that column `type` is of type: character\n col_is_character(\n columns = c(\"type\")\n ) %>%\n # Expect that column `price` is of type: numeric\n col_is_numeric(\n columns = c(\"price\")\n ) %>%\n # Expect that values in `price` should be between `9.75` and `35.95`\n col_vals_between(\n columns = c(\"price\"),\n left = 9.75,\n right = 35.95\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n id = \"character\",\n date = \"character\",\n time = \"character\",\n name = \"character\",\n size = \"character\",\n type = \"character\",\n price = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `num` is of type: numeric\n col_is_numeric(\n columns = c(\"num\")\n ) %>%\n # Expect that values in `num` should be between `0.1111` and `8880000`\n col_vals_between(\n columns = c(\"num\"),\n left = 0.1111,\n right = 8880000,\n na_pass = TRUE\n ) %>%\n # Expect that column `char` is of type: character\n col_is_character(\n columns = c(\"char\")\n ) %>%\n # Expect that column `fctr` is of type: factor\n col_is_factor(\n columns = c(\"fctr\")\n ) %>%\n # Expect that column `date` is of type: character\n col_is_character(\n columns = c(\"date\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `datetime` is of type: character\n col_is_character(\n columns = c(\"datetime\")\n ) %>%\n # Expect that column `currency` is of type: numeric\n col_is_numeric(\n columns = c(\"currency\")\n ) %>%\n # Expect that values in `currency` should be between `0.44` and `65100`\n col_vals_between(\n columns = c(\"currency\"),\n left = 0.44,\n right = 65100,\n na_pass = TRUE\n ) %>%\n # Expect that column `row` is of type: character\n col_is_character(\n columns = c(\"row\")\n ) %>%\n # Expect that column `group` is of type: character\n col_is_character(\n columns = c(\"group\")\n ) %>%\n # Expect entirely distinct rows across `num, char, fctr, date, time, datetime, currency, row, group`\n rows_distinct(\n columns = c(\"num\", \"char\", \"fctr\", \"date\", \"time\", \"datetime\", \"currency\", \"row\", \"group\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n num = \"numeric\",\n char = \"character\",\n fctr = \"factor\",\n date = \"character\",\n time = \"character\",\n datetime = \"character\",\n currency = \"numeric\",\n row = \"character\",\n group = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `num` is of type: numeric\n col_is_numeric(\n columns = c(\"num\")\n ) %>%\n # Expect that values in `num` should be between `0.1111` and `8880000`\n col_vals_between(\n columns = c(\"num\"),\n left = 0.1111,\n right = 8880000,\n na_pass = TRUE\n ) %>%\n # Expect that column `char` is of type: character\n col_is_character(\n columns = c(\"char\")\n ) %>%\n # Expect that column `fctr` is of type: factor\n col_is_factor(\n columns = c(\"fctr\")\n ) %>%\n # Expect that column `date` is of type: character\n col_is_character(\n columns = c(\"date\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `datetime` is of type: character\n col_is_character(\n columns = c(\"datetime\")\n ) %>%\n # Expect that column `currency` is of type: numeric\n col_is_numeric(\n columns = c(\"currency\")\n ) %>%\n # Expect that values in `currency` should be between `0.44` and `65100`\n col_vals_between(\n columns = c(\"currency\"),\n left = 0.44,\n right = 65100,\n na_pass = TRUE\n ) %>%\n # Expect that column `row` is of type: character\n col_is_character(\n columns = c(\"row\")\n ) %>%\n # Expect that column `group` is of type: character\n col_is_character(\n columns = c(\"group\")\n ) %>%\n # Expect entirely distinct rows across `num, char, fctr, date, time, datetime, currency, row, group`\n rows_distinct(\n columns = c(\"num\", \"char\", \"fctr\", \"date\", \"time\", \"datetime\", \"currency\", \"row\", \"group\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n num = \"numeric\",\n char = \"character\",\n fctr = \"factor\",\n date = \"character\",\n time = \"character\",\n datetime = \"character\",\n currency = \"numeric\",\n row = \"character\",\n group = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `carat` is of type: numeric\n col_is_numeric(\n columns = c(\"carat\")\n ) %>%\n # Expect that values in `carat` should be between `0.2` and `5.01`\n col_vals_between(\n columns = c(\"carat\"),\n left = 0.2,\n right = 5.01\n ) %>%\n # Expect that column `cut` is of type: factor\n col_is_factor(\n columns = c(\"cut\")\n ) %>%\n # Expect that column `color` is of type: factor\n col_is_factor(\n columns = c(\"color\")\n ) %>%\n # Expect that column `clarity` is of type: factor\n col_is_factor(\n columns = c(\"clarity\")\n ) %>%\n # Expect that column `depth` is of type: numeric\n col_is_numeric(\n columns = c(\"depth\")\n ) %>%\n # Expect that values in `depth` should be between `43` and `79`\n col_vals_between(\n columns = c(\"depth\"),\n left = 43,\n right = 79\n ) %>%\n # Expect that column `table` is of type: numeric\n col_is_numeric(\n columns = c(\"table\")\n ) %>%\n # Expect that values in `table` should be between `43` and `95`\n col_vals_between(\n columns = c(\"table\"),\n left = 43,\n right = 95\n ) %>%\n # Expect that column `price` is of type: integer\n col_is_integer(\n columns = c(\"price\")\n ) %>%\n # Expect that values in `price` should be between `326` and `18823`\n col_vals_between(\n columns = c(\"price\"),\n left = 326,\n right = 18823\n ) %>%\n # Expect that column `x` is of type: numeric\n col_is_numeric(\n columns = c(\"x\")\n ) %>%\n # Expect that values in `x` should be between `0` and `10.74`\n col_vals_between(\n columns = c(\"x\"),\n left = 0,\n right = 10.74\n ) %>%\n # Expect that column `y` is of type: numeric\n col_is_numeric(\n columns = c(\"y\")\n ) %>%\n # Expect that values in `y` should be between `0` and `58.9`\n col_vals_between(\n columns = c(\"y\"),\n left = 0,\n right = 58.9\n ) %>%\n # Expect that column `z` is of type: numeric\n col_is_numeric(\n columns = c(\"z\")\n ) %>%\n # Expect that values in `z` should be between `0` and `31.8`\n col_vals_between(\n columns = c(\"z\"),\n left = 0,\n right = 31.8\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n carat = \"numeric\",\n cut = c(\"ordered\", \"factor\"),\n color = c(\"ordered\", \"factor\"),\n clarity = c(\"ordered\", \"factor\"),\n depth = \"numeric\",\n table = \"numeric\",\n price = \"integer\",\n x = \"numeric\",\n y = \"numeric\",\n z = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `carat` is of type: numeric\n col_is_numeric(\n columns = c(\"carat\")\n ) %>%\n # Expect that values in `carat` should be between `0.2` and `5.01`\n col_vals_between(\n columns = c(\"carat\"),\n left = 0.2,\n right = 5.01\n ) %>%\n # Expect that column `cut` is of type: factor\n col_is_factor(\n columns = c(\"cut\")\n ) %>%\n # Expect that column `color` is of type: factor\n col_is_factor(\n columns = c(\"color\")\n ) %>%\n # Expect that column `clarity` is of type: factor\n col_is_factor(\n columns = c(\"clarity\")\n ) %>%\n # Expect that column `depth` is of type: numeric\n col_is_numeric(\n columns = c(\"depth\")\n ) %>%\n # Expect that values in `depth` should be between `43` and `79`\n col_vals_between(\n columns = c(\"depth\"),\n left = 43,\n right = 79\n ) %>%\n # Expect that column `table` is of type: numeric\n col_is_numeric(\n columns = c(\"table\")\n ) %>%\n # Expect that values in `table` should be between `43` and `95`\n col_vals_between(\n columns = c(\"table\"),\n left = 43,\n right = 95\n ) %>%\n # Expect that column `price` is of type: integer\n col_is_integer(\n columns = c(\"price\")\n ) %>%\n # Expect that values in `price` should be between `326` and `18823`\n col_vals_between(\n columns = c(\"price\"),\n left = 326,\n right = 18823\n ) %>%\n # Expect that column `x` is of type: numeric\n col_is_numeric(\n columns = c(\"x\")\n ) %>%\n # Expect that values in `x` should be between `0` and `10.74`\n col_vals_between(\n columns = c(\"x\"),\n left = 0,\n right = 10.74\n ) %>%\n # Expect that column `y` is of type: numeric\n col_is_numeric(\n columns = c(\"y\")\n ) %>%\n # Expect that values in `y` should be between `0` and `58.9`\n col_vals_between(\n columns = c(\"y\"),\n left = 0,\n right = 58.9\n ) %>%\n # Expect that column `z` is of type: numeric\n col_is_numeric(\n columns = c(\"z\")\n ) %>%\n # Expect that values in `z` should be between `0` and `31.8`\n col_vals_between(\n columns = c(\"z\"),\n left = 0,\n right = 31.8\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n carat = \"numeric\",\n cut = c(\"ordered\", \"factor\"),\n color = c(\"ordered\", \"factor\"),\n clarity = c(\"ordered\", \"factor\"),\n depth = \"numeric\",\n table = \"numeric\",\n price = \"integer\",\n x = \"numeric\",\n y = \"numeric\",\n z = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `variable` is of type: character\n col_is_character(\n columns = c(\"variable\")\n ) %>%\n # Expect that column `value` is of type: numeric\n col_is_numeric(\n columns = c(\"value\")\n ) %>%\n # Expect that values in `value` should be between `2.2` and `320402.295`\n col_vals_between(\n columns = c(\"value\"),\n left = 2.2,\n right = 320402.295\n ) %>%\n # Expect that column `value01` is of type: numeric\n col_is_numeric(\n columns = c(\"value01\")\n ) %>%\n # Expect that values in `value01` should be between `0` and `1`\n col_vals_between(\n columns = c(\"value01\"),\n left = 0,\n right = 1\n ) %>%\n # Expect entirely distinct rows across `date, variable, value, value01`\n rows_distinct(\n columns = c(\"date\", \"variable\", \"value\", \"value01\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date = \"Date\",\n variable = \"character\",\n value = \"numeric\",\n value01 = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `variable` is of type: character\n col_is_character(\n columns = c(\"variable\")\n ) %>%\n # Expect that column `value` is of type: numeric\n col_is_numeric(\n columns = c(\"value\")\n ) %>%\n # Expect that values in `value` should be between `2.2` and `320402.295`\n col_vals_between(\n columns = c(\"value\"),\n left = 2.2,\n right = 320402.295\n ) %>%\n # Expect that column `value01` is of type: numeric\n col_is_numeric(\n columns = c(\"value01\")\n ) %>%\n # Expect that values in `value01` should be between `0` and `1`\n col_vals_between(\n columns = c(\"value01\"),\n left = 0,\n right = 1\n ) %>%\n # Expect entirely distinct rows across `date, variable, value, value01`\n rows_distinct(\n columns = c(\"date\", \"variable\", \"value\", \"value01\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date = \"Date\",\n variable = \"character\",\n value = \"numeric\",\n value01 = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `eruptions` is of type: numeric\n col_is_numeric(\n columns = c(\"eruptions\")\n ) %>%\n # Expect that values in `eruptions` should be between `1.6` and `5.1`\n col_vals_between(\n columns = c(\"eruptions\"),\n left = 1.6,\n right = 5.1\n ) %>%\n # Expect that column `waiting` is of type: numeric\n col_is_numeric(\n columns = c(\"waiting\")\n ) %>%\n # Expect that values in `waiting` should be between `43` and `96`\n col_vals_between(\n columns = c(\"waiting\"),\n left = 43,\n right = 96\n ) %>%\n # Expect that column `density` is of type: numeric\n col_is_numeric(\n columns = c(\"density\")\n ) %>%\n # Expect that values in `density` should be between `1.25924972782687e-24` and `0.0369877986891108`\n col_vals_between(\n columns = c(\"density\"),\n left = 1.2592497e-24,\n right = 0.0369878\n ) %>%\n # Expect entirely distinct rows across `eruptions, waiting, density`\n rows_distinct(\n columns = c(\"eruptions\", \"waiting\", \"density\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n eruptions = \"numeric\",\n waiting = \"numeric\",\n density = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `eruptions` is of type: numeric\n col_is_numeric(\n columns = c(\"eruptions\")\n ) %>%\n # Expect that values in `eruptions` should be between `1.6` and `5.1`\n col_vals_between(\n columns = c(\"eruptions\"),\n left = 1.6,\n right = 5.1\n ) %>%\n # Expect that column `waiting` is of type: numeric\n col_is_numeric(\n columns = c(\"waiting\")\n ) %>%\n # Expect that values in `waiting` should be between `43` and `96`\n col_vals_between(\n columns = c(\"waiting\"),\n left = 43,\n right = 96\n ) %>%\n # Expect that column `density` is of type: numeric\n col_is_numeric(\n columns = c(\"density\")\n ) %>%\n # Expect that values in `density` should be between `1.25924972782687e-24` and `0.0369877986891108`\n col_vals_between(\n columns = c(\"density\"),\n left = 1.2592497e-24,\n right = 0.0369878\n ) %>%\n # Expect entirely distinct rows across `eruptions, waiting, density`\n rows_distinct(\n columns = c(\"eruptions\", \"waiting\", \"density\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n eruptions = \"numeric\",\n waiting = \"numeric\",\n density = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `L` is of type: numeric\n col_is_numeric(\n columns = c(\"L\")\n ) %>%\n # Expect that values in `L` should be between `0` and `9341.57022199546`\n col_vals_between(\n columns = c(\"L\"),\n left = 0,\n right = 9341.570222\n ) %>%\n # Expect that column `u` is of type: numeric\n col_is_numeric(\n columns = c(\"u\")\n ) %>%\n # Expect that values in `u` should be between `-7971.69318804991` and `18325.9445754841`\n col_vals_between(\n columns = c(\"u\"),\n left = -7971.693188,\n right = 18325.9445755\n ) %>%\n # Expect that column `v` is of type: numeric\n col_is_numeric(\n columns = c(\"v\")\n ) %>%\n # Expect that values in `v` should be between `-15649.9250273997` and `10194.4413048169`\n col_vals_between(\n columns = c(\"v\"),\n left = -15649.9250274,\n right = 10194.4413048\n ) %>%\n # Expect that column `col` is of type: character\n col_is_character(\n columns = c(\"col\")\n ) %>%\n # Expect entirely distinct rows across `L, u, v, col`\n rows_distinct(\n columns = c(\"L\", \"u\", \"v\", \"col\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n L = \"numeric\",\n u = \"numeric\",\n v = \"numeric\",\n col = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `L` is of type: numeric\n col_is_numeric(\n columns = c(\"L\")\n ) %>%\n # Expect that values in `L` should be between `0` and `9341.57022199546`\n col_vals_between(\n columns = c(\"L\"),\n left = 0,\n right = 9341.570222\n ) %>%\n # Expect that column `u` is of type: numeric\n col_is_numeric(\n columns = c(\"u\")\n ) %>%\n # Expect that values in `u` should be between `-7971.69318804991` and `18325.9445754841`\n col_vals_between(\n columns = c(\"u\"),\n left = -7971.693188,\n right = 18325.9445755\n ) %>%\n # Expect that column `v` is of type: numeric\n col_is_numeric(\n columns = c(\"v\")\n ) %>%\n # Expect that values in `v` should be between `-15649.9250273997` and `10194.4413048169`\n col_vals_between(\n columns = c(\"v\"),\n left = -15649.9250274,\n right = 10194.4413048\n ) %>%\n # Expect that column `col` is of type: character\n col_is_character(\n columns = c(\"col\")\n ) %>%\n # Expect entirely distinct rows across `L, u, v, col`\n rows_distinct(\n columns = c(\"L\", \"u\", \"v\", \"col\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n L = \"numeric\",\n u = \"numeric\",\n v = \"numeric\",\n col = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `PID` is of type: integer\n col_is_integer(\n columns = c(\"PID\")\n ) %>%\n # Expect that values in `PID` should be between `561` and `3052`\n col_vals_between(\n columns = c(\"PID\"),\n left = 561,\n right = 3052\n ) %>%\n # Expect that column `county` is of type: character\n col_is_character(\n columns = c(\"county\")\n ) %>%\n # Expect that column `state` is of type: character\n col_is_character(\n columns = c(\"state\")\n ) %>%\n # Expect that column `area` is of type: numeric\n col_is_numeric(\n columns = c(\"area\")\n ) %>%\n # Expect that values in `area` should be between `0.005` and `0.11`\n col_vals_between(\n columns = c(\"area\"),\n left = 0.005,\n right = 0.11\n ) %>%\n # Expect that column `poptotal` is of type: integer\n col_is_integer(\n columns = c(\"poptotal\")\n ) %>%\n # Expect that values in `poptotal` should be between `1701` and `5105067`\n col_vals_between(\n columns = c(\"poptotal\"),\n left = 1701,\n right = 5105067\n ) %>%\n # Expect that column `popdensity` is of type: numeric\n col_is_numeric(\n columns = c(\"popdensity\")\n ) %>%\n # Expect that values in `popdensity` should be between `85.05` and `88018.3966`\n col_vals_between(\n columns = c(\"popdensity\"),\n left = 85.05,\n right = 88018.3966\n ) %>%\n # Expect that column `popwhite` is of type: integer\n col_is_integer(\n columns = c(\"popwhite\")\n ) %>%\n # Expect that values in `popwhite` should be between `416` and `3204947`\n col_vals_between(\n columns = c(\"popwhite\"),\n left = 416,\n right = 3204947\n ) %>%\n # Expect that column `popblack` is of type: integer\n col_is_integer(\n columns = c(\"popblack\")\n ) %>%\n # Expect that values in `popblack` should be between `0` and `1317147`\n col_vals_between(\n columns = c(\"popblack\"),\n left = 0,\n right = 1317147\n ) %>%\n # Expect that column `popamerindian` is of type: integer\n col_is_integer(\n columns = c(\"popamerindian\")\n ) %>%\n # Expect that values in `popamerindian` should be between `4` and `10289`\n col_vals_between(\n columns = c(\"popamerindian\"),\n left = 4,\n right = 10289\n ) %>%\n # Expect that column `popasian` is of type: integer\n col_is_integer(\n columns = c(\"popasian\")\n ) %>%\n # Expect that values in `popasian` should be between `0` and `188565`\n col_vals_between(\n columns = c(\"popasian\"),\n left = 0,\n right = 188565\n ) %>%\n # Expect that column `popother` is of type: integer\n col_is_integer(\n columns = c(\"popother\")\n ) %>%\n # Expect that values in `popother` should be between `0` and `384119`\n col_vals_between(\n columns = c(\"popother\"),\n left = 0,\n right = 384119\n ) %>%\n # Expect that column `percwhite` is of type: numeric\n col_is_numeric(\n columns = c(\"percwhite\")\n ) %>%\n # Expect that values in `percwhite` should be between `10.6940874` and `99.8228207`\n col_vals_between(\n columns = c(\"percwhite\"),\n left = 10.6940874,\n right = 99.8228207\n ) %>%\n # Expect that column `percblack` is of type: numeric\n col_is_numeric(\n columns = c(\"percblack\")\n ) %>%\n # Expect that values in `percblack` should be between `0` and `40.2099838`\n col_vals_between(\n columns = c(\"percblack\"),\n left = 0,\n right = 40.2099838\n ) %>%\n # Expect that column `percamerindan` is of type: numeric\n col_is_numeric(\n columns = c(\"percamerindan\")\n ) %>%\n # Expect that values in `percamerindan` should be between `0.05623243` and `89.1773779`\n col_vals_between(\n columns = c(\"percamerindan\"),\n left = 0.0562324,\n right = 89.1773779\n ) %>%\n # Expect that column `percasian` is of type: numeric\n col_is_numeric(\n columns = c(\"percasian\")\n ) %>%\n # Expect that values in `percasian` should be between `0` and `5.07045209`\n col_vals_between(\n columns = c(\"percasian\"),\n left = 0,\n right = 5.0704521\n ) %>%\n # Expect that column `percother` is of type: numeric\n col_is_numeric(\n columns = c(\"percother\")\n ) %>%\n # Expect that values in `percother` should be between `0` and `7.52426951`\n col_vals_between(\n columns = c(\"percother\"),\n left = 0,\n right = 7.5242695\n ) %>%\n # Expect that column `popadults` is of type: integer\n col_is_integer(\n columns = c(\"popadults\")\n ) %>%\n # Expect that values in `popadults` should be between `1287` and `3291995`\n col_vals_between(\n columns = c(\"popadults\"),\n left = 1287,\n right = 3291995\n ) %>%\n # Expect that column `perchsd` is of type: numeric\n col_is_numeric(\n columns = c(\"perchsd\")\n ) %>%\n # Expect that values in `perchsd` should be between `46.912261` and `88.8986737`\n col_vals_between(\n columns = c(\"perchsd\"),\n left = 46.912261,\n right = 88.8986737\n ) %>%\n # Expect that column `percollege` is of type: numeric\n col_is_numeric(\n columns = c(\"percollege\")\n ) %>%\n # Expect that values in `percollege` should be between `7.33610822` and `48.0785102`\n col_vals_between(\n columns = c(\"percollege\"),\n left = 7.3361082,\n right = 48.0785102\n ) %>%\n # Expect that column `percprof` is of type: numeric\n col_is_numeric(\n columns = c(\"percprof\")\n ) %>%\n # Expect that values in `percprof` should be between `0.52029136` and `20.7913213`\n col_vals_between(\n columns = c(\"percprof\"),\n left = 0.5202914,\n right = 20.7913213\n ) %>%\n # Expect that column `poppovertyknown` is of type: integer\n col_is_integer(\n columns = c(\"poppovertyknown\")\n ) %>%\n # Expect that values in `poppovertyknown` should be between `1696` and `5023523`\n col_vals_between(\n columns = c(\"poppovertyknown\"),\n left = 1696,\n right = 5023523\n ) %>%\n # Expect that column `percpovertyknown` is of type: numeric\n col_is_numeric(\n columns = c(\"percpovertyknown\")\n ) %>%\n # Expect that values in `percpovertyknown` should be between `80.9024412` and `99.8603839`\n col_vals_between(\n columns = c(\"percpovertyknown\"),\n left = 80.9024412,\n right = 99.8603839\n ) %>%\n # Expect that column `percbelowpoverty` is of type: numeric\n col_is_numeric(\n columns = c(\"percbelowpoverty\")\n ) %>%\n # Expect that values in `percbelowpoverty` should be between `2.1801676` and `48.6910995`\n col_vals_between(\n columns = c(\"percbelowpoverty\"),\n left = 2.1801676,\n right = 48.6910995\n ) %>%\n # Expect that column `percchildbelowpovert` is of type: numeric\n col_is_numeric(\n columns = c(\"percchildbelowpovert\")\n ) %>%\n # Expect that values in `percchildbelowpovert` should be between `1.91895478` and `64.3084767`\n col_vals_between(\n columns = c(\"percchildbelowpovert\"),\n left = 1.9189548,\n right = 64.3084767\n ) %>%\n # Expect that column `percadultpoverty` is of type: numeric\n col_is_numeric(\n columns = c(\"percadultpoverty\")\n ) %>%\n # Expect that values in `percadultpoverty` should be between `1.9385043` and `43.3124644`\n col_vals_between(\n columns = c(\"percadultpoverty\"),\n left = 1.9385043,\n right = 43.3124644\n ) %>%\n # Expect that column `percelderlypoverty` is of type: numeric\n col_is_numeric(\n columns = c(\"percelderlypoverty\")\n ) %>%\n # Expect that values in `percelderlypoverty` should be between `3.54706685` and `31.1619718`\n col_vals_between(\n columns = c(\"percelderlypoverty\"),\n left = 3.5470669,\n right = 31.1619718\n ) %>%\n # Expect that column `inmetro` is of type: integer\n col_is_integer(\n columns = c(\"inmetro\")\n ) %>%\n # Expect that values in `inmetro` should be between `0` and `1`\n col_vals_between(\n columns = c(\"inmetro\"),\n left = 0,\n right = 1\n ) %>%\n # Expect that column `category` is of type: character\n col_is_character(\n columns = c(\"category\")\n ) %>%\n # Expect entirely distinct rows across `PID, county, state, area, poptotal, popdensity, popwhite, popblack, popamerindian, popasian, popother, percwhite, percblack, percamerindan, percasian, percother, popadults, perchsd, percollege, percprof, poppovertyknown, percpovertyknown, percbelowpoverty, percchildbelowpovert, percadultpoverty, percelderlypoverty, inmetro, category`\n rows_distinct(\n columns = c(\"PID\", \"county\", \"state\", \"area\", \"poptotal\", \"popdensity\", \"popwhite\", \"popblack\", \"popamerindian\", \"popasian\", \"popother\", \"percwhite\", \"percblack\", \"percamerindan\", \"percasian\", \"percother\", \"popadults\", \"perchsd\", \"percollege\", \"percprof\", \"poppovertyknown\", \"percpovertyknown\", \"percbelowpoverty\", \"percchildbelowpovert\", \"percadultpoverty\", \"percelderlypoverty\", \"inmetro\", \"category\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n PID = \"integer\",\n county = \"character\",\n state = \"character\",\n area = \"numeric\",\n poptotal = \"integer\",\n popdensity = \"numeric\",\n popwhite = \"integer\",\n popblack = \"integer\",\n popamerindian = \"integer\",\n popasian = \"integer\",\n popother = \"integer\",\n percwhite = \"numeric\",\n percblack = \"numeric\",\n percamerindan = \"numeric\",\n percasian = \"numeric\",\n percother = \"numeric\",\n popadults = \"integer\",\n perchsd = \"numeric\",\n percollege = \"numeric\",\n percprof = \"numeric\",\n poppovertyknown = \"integer\",\n percpovertyknown = \"numeric\",\n percbelowpoverty = \"numeric\",\n percchildbelowpovert = \"numeric\",\n percadultpoverty = \"numeric\",\n percelderlypoverty = \"numeric\",\n inmetro = \"integer\",\n category = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `PID` is of type: integer\n col_is_integer(\n columns = c(\"PID\")\n ) %>%\n # Expect that values in `PID` should be between `561` and `3052`\n col_vals_between(\n columns = c(\"PID\"),\n left = 561,\n right = 3052\n ) %>%\n # Expect that column `county` is of type: character\n col_is_character(\n columns = c(\"county\")\n ) %>%\n # Expect that column `state` is of type: character\n col_is_character(\n columns = c(\"state\")\n ) %>%\n # Expect that column `area` is of type: numeric\n col_is_numeric(\n columns = c(\"area\")\n ) %>%\n # Expect that values in `area` should be between `0.005` and `0.11`\n col_vals_between(\n columns = c(\"area\"),\n left = 0.005,\n right = 0.11\n ) %>%\n # Expect that column `poptotal` is of type: integer\n col_is_integer(\n columns = c(\"poptotal\")\n ) %>%\n # Expect that values in `poptotal` should be between `1701` and `5105067`\n col_vals_between(\n columns = c(\"poptotal\"),\n left = 1701,\n right = 5105067\n ) %>%\n # Expect that column `popdensity` is of type: numeric\n col_is_numeric(\n columns = c(\"popdensity\")\n ) %>%\n # Expect that values in `popdensity` should be between `85.05` and `88018.3966`\n col_vals_between(\n columns = c(\"popdensity\"),\n left = 85.05,\n right = 88018.3966\n ) %>%\n # Expect that column `popwhite` is of type: integer\n col_is_integer(\n columns = c(\"popwhite\")\n ) %>%\n # Expect that values in `popwhite` should be between `416` and `3204947`\n col_vals_between(\n columns = c(\"popwhite\"),\n left = 416,\n right = 3204947\n ) %>%\n # Expect that column `popblack` is of type: integer\n col_is_integer(\n columns = c(\"popblack\")\n ) %>%\n # Expect that values in `popblack` should be between `0` and `1317147`\n col_vals_between(\n columns = c(\"popblack\"),\n left = 0,\n right = 1317147\n ) %>%\n # Expect that column `popamerindian` is of type: integer\n col_is_integer(\n columns = c(\"popamerindian\")\n ) %>%\n # Expect that values in `popamerindian` should be between `4` and `10289`\n col_vals_between(\n columns = c(\"popamerindian\"),\n left = 4,\n right = 10289\n ) %>%\n # Expect that column `popasian` is of type: integer\n col_is_integer(\n columns = c(\"popasian\")\n ) %>%\n # Expect that values in `popasian` should be between `0` and `188565`\n col_vals_between(\n columns = c(\"popasian\"),\n left = 0,\n right = 188565\n ) %>%\n # Expect that column `popother` is of type: integer\n col_is_integer(\n columns = c(\"popother\")\n ) %>%\n # Expect that values in `popother` should be between `0` and `384119`\n col_vals_between(\n columns = c(\"popother\"),\n left = 0,\n right = 384119\n ) %>%\n # Expect that column `percwhite` is of type: numeric\n col_is_numeric(\n columns = c(\"percwhite\")\n ) %>%\n # Expect that values in `percwhite` should be between `10.6940874` and `99.8228207`\n col_vals_between(\n columns = c(\"percwhite\"),\n left = 10.6940874,\n right = 99.8228207\n ) %>%\n # Expect that column `percblack` is of type: numeric\n col_is_numeric(\n columns = c(\"percblack\")\n ) %>%\n # Expect that values in `percblack` should be between `0` and `40.2099838`\n col_vals_between(\n columns = c(\"percblack\"),\n left = 0,\n right = 40.2099838\n ) %>%\n # Expect that column `percamerindan` is of type: numeric\n col_is_numeric(\n columns = c(\"percamerindan\")\n ) %>%\n # Expect that values in `percamerindan` should be between `0.05623243` and `89.1773779`\n col_vals_between(\n columns = c(\"percamerindan\"),\n left = 0.0562324,\n right = 89.1773779\n ) %>%\n # Expect that column `percasian` is of type: numeric\n col_is_numeric(\n columns = c(\"percasian\")\n ) %>%\n # Expect that values in `percasian` should be between `0` and `5.07045209`\n col_vals_between(\n columns = c(\"percasian\"),\n left = 0,\n right = 5.0704521\n ) %>%\n # Expect that column `percother` is of type: numeric\n col_is_numeric(\n columns = c(\"percother\")\n ) %>%\n # Expect that values in `percother` should be between `0` and `7.52426951`\n col_vals_between(\n columns = c(\"percother\"),\n left = 0,\n right = 7.5242695\n ) %>%\n # Expect that column `popadults` is of type: integer\n col_is_integer(\n columns = c(\"popadults\")\n ) %>%\n # Expect that values in `popadults` should be between `1287` and `3291995`\n col_vals_between(\n columns = c(\"popadults\"),\n left = 1287,\n right = 3291995\n ) %>%\n # Expect that column `perchsd` is of type: numeric\n col_is_numeric(\n columns = c(\"perchsd\")\n ) %>%\n # Expect that values in `perchsd` should be between `46.912261` and `88.8986737`\n col_vals_between(\n columns = c(\"perchsd\"),\n left = 46.912261,\n right = 88.8986737\n ) %>%\n # Expect that column `percollege` is of type: numeric\n col_is_numeric(\n columns = c(\"percollege\")\n ) %>%\n # Expect that values in `percollege` should be between `7.33610822` and `48.0785102`\n col_vals_between(\n columns = c(\"percollege\"),\n left = 7.3361082,\n right = 48.0785102\n ) %>%\n # Expect that column `percprof` is of type: numeric\n col_is_numeric(\n columns = c(\"percprof\")\n ) %>%\n # Expect that values in `percprof` should be between `0.52029136` and `20.7913213`\n col_vals_between(\n columns = c(\"percprof\"),\n left = 0.5202914,\n right = 20.7913213\n ) %>%\n # Expect that column `poppovertyknown` is of type: integer\n col_is_integer(\n columns = c(\"poppovertyknown\")\n ) %>%\n # Expect that values in `poppovertyknown` should be between `1696` and `5023523`\n col_vals_between(\n columns = c(\"poppovertyknown\"),\n left = 1696,\n right = 5023523\n ) %>%\n # Expect that column `percpovertyknown` is of type: numeric\n col_is_numeric(\n columns = c(\"percpovertyknown\")\n ) %>%\n # Expect that values in `percpovertyknown` should be between `80.9024412` and `99.8603839`\n col_vals_between(\n columns = c(\"percpovertyknown\"),\n left = 80.9024412,\n right = 99.8603839\n ) %>%\n # Expect that column `percbelowpoverty` is of type: numeric\n col_is_numeric(\n columns = c(\"percbelowpoverty\")\n ) %>%\n # Expect that values in `percbelowpoverty` should be between `2.1801676` and `48.6910995`\n col_vals_between(\n columns = c(\"percbelowpoverty\"),\n left = 2.1801676,\n right = 48.6910995\n ) %>%\n # Expect that column `percchildbelowpovert` is of type: numeric\n col_is_numeric(\n columns = c(\"percchildbelowpovert\")\n ) %>%\n # Expect that values in `percchildbelowpovert` should be between `1.91895478` and `64.3084767`\n col_vals_between(\n columns = c(\"percchildbelowpovert\"),\n left = 1.9189548,\n right = 64.3084767\n ) %>%\n # Expect that column `percadultpoverty` is of type: numeric\n col_is_numeric(\n columns = c(\"percadultpoverty\")\n ) %>%\n # Expect that values in `percadultpoverty` should be between `1.9385043` and `43.3124644`\n col_vals_between(\n columns = c(\"percadultpoverty\"),\n left = 1.9385043,\n right = 43.3124644\n ) %>%\n # Expect that column `percelderlypoverty` is of type: numeric\n col_is_numeric(\n columns = c(\"percelderlypoverty\")\n ) %>%\n # Expect that values in `percelderlypoverty` should be between `3.54706685` and `31.1619718`\n col_vals_between(\n columns = c(\"percelderlypoverty\"),\n left = 3.5470669,\n right = 31.1619718\n ) %>%\n # Expect that column `inmetro` is of type: integer\n col_is_integer(\n columns = c(\"inmetro\")\n ) %>%\n # Expect that values in `inmetro` should be between `0` and `1`\n col_vals_between(\n columns = c(\"inmetro\"),\n left = 0,\n right = 1\n ) %>%\n # Expect that column `category` is of type: character\n col_is_character(\n columns = c(\"category\")\n ) %>%\n # Expect entirely distinct rows across `PID, county, state, area, poptotal, popdensity, popwhite, popblack, popamerindian, popasian, popother, percwhite, percblack, percamerindan, percasian, percother, popadults, perchsd, percollege, percprof, poppovertyknown, percpovertyknown, percbelowpoverty, percchildbelowpovert, percadultpoverty, percelderlypoverty, inmetro, category`\n rows_distinct(\n columns = c(\"PID\", \"county\", \"state\", \"area\", \"poptotal\", \"popdensity\", \"popwhite\", \"popblack\", \"popamerindian\", \"popasian\", \"popother\", \"percwhite\", \"percblack\", \"percamerindan\", \"percasian\", \"percother\", \"popadults\", \"perchsd\", \"percollege\", \"percprof\", \"poppovertyknown\", \"percpovertyknown\", \"percbelowpoverty\", \"percchildbelowpovert\", \"percadultpoverty\", \"percelderlypoverty\", \"inmetro\", \"category\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n PID = \"integer\",\n county = \"character\",\n state = \"character\",\n area = \"numeric\",\n poptotal = \"integer\",\n popdensity = \"numeric\",\n popwhite = \"integer\",\n popblack = \"integer\",\n popamerindian = \"integer\",\n popasian = \"integer\",\n popother = \"integer\",\n percwhite = \"numeric\",\n percblack = \"numeric\",\n percamerindan = \"numeric\",\n percasian = \"numeric\",\n percother = \"numeric\",\n popadults = \"integer\",\n perchsd = \"numeric\",\n percollege = \"numeric\",\n percprof = \"numeric\",\n poppovertyknown = \"integer\",\n percpovertyknown = \"numeric\",\n percbelowpoverty = \"numeric\",\n percchildbelowpovert = \"numeric\",\n percadultpoverty = \"numeric\",\n percelderlypoverty = \"numeric\",\n inmetro = \"integer\",\n category = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `manufacturer` is of type: character\n col_is_character(\n columns = c(\"manufacturer\")\n ) %>%\n # Expect that column `model` is of type: character\n col_is_character(\n columns = c(\"model\")\n ) %>%\n # Expect that column `displ` is of type: numeric\n col_is_numeric(\n columns = c(\"displ\")\n ) %>%\n # Expect that values in `displ` should be between `1.6` and `7`\n col_vals_between(\n columns = c(\"displ\"),\n left = 1.6,\n right = 7\n ) %>%\n # Expect that column `year` is of type: integer\n col_is_integer(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `1999` and `2008`\n col_vals_between(\n columns = c(\"year\"),\n left = 1999,\n right = 2008\n ) %>%\n # Expect that column `cyl` is of type: integer\n col_is_integer(\n columns = c(\"cyl\")\n ) %>%\n # Expect that values in `cyl` should be between `4` and `8`\n col_vals_between(\n columns = c(\"cyl\"),\n left = 4,\n right = 8\n ) %>%\n # Expect that column `trans` is of type: character\n col_is_character(\n columns = c(\"trans\")\n ) %>%\n # Expect that column `drv` is of type: character\n col_is_character(\n columns = c(\"drv\")\n ) %>%\n # Expect that column `cty` is of type: integer\n col_is_integer(\n columns = c(\"cty\")\n ) %>%\n # Expect that values in `cty` should be between `9` and `35`\n col_vals_between(\n columns = c(\"cty\"),\n left = 9,\n right = 35\n ) %>%\n # Expect that column `hwy` is of type: integer\n col_is_integer(\n columns = c(\"hwy\")\n ) %>%\n # Expect that values in `hwy` should be between `12` and `44`\n col_vals_between(\n columns = c(\"hwy\"),\n left = 12,\n right = 44\n ) %>%\n # Expect that column `fl` is of type: character\n col_is_character(\n columns = c(\"fl\")\n ) %>%\n # Expect that column `class` is of type: character\n col_is_character(\n columns = c(\"class\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n manufacturer = \"character\",\n model = \"character\",\n displ = \"numeric\",\n year = \"integer\",\n cyl = \"integer\",\n trans = \"character\",\n drv = \"character\",\n cty = \"integer\",\n hwy = \"integer\",\n fl = \"character\",\n class = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `manufacturer` is of type: character\n col_is_character(\n columns = c(\"manufacturer\")\n ) %>%\n # Expect that column `model` is of type: character\n col_is_character(\n columns = c(\"model\")\n ) %>%\n # Expect that column `displ` is of type: numeric\n col_is_numeric(\n columns = c(\"displ\")\n ) %>%\n # Expect that values in `displ` should be between `1.6` and `7`\n col_vals_between(\n columns = c(\"displ\"),\n left = 1.6,\n right = 7\n ) %>%\n # Expect that column `year` is of type: integer\n col_is_integer(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `1999` and `2008`\n col_vals_between(\n columns = c(\"year\"),\n left = 1999,\n right = 2008\n ) %>%\n # Expect that column `cyl` is of type: integer\n col_is_integer(\n columns = c(\"cyl\")\n ) %>%\n # Expect that values in `cyl` should be between `4` and `8`\n col_vals_between(\n columns = c(\"cyl\"),\n left = 4,\n right = 8\n ) %>%\n # Expect that column `trans` is of type: character\n col_is_character(\n columns = c(\"trans\")\n ) %>%\n # Expect that column `drv` is of type: character\n col_is_character(\n columns = c(\"drv\")\n ) %>%\n # Expect that column `cty` is of type: integer\n col_is_integer(\n columns = c(\"cty\")\n ) %>%\n # Expect that values in `cty` should be between `9` and `35`\n col_vals_between(\n columns = c(\"cty\"),\n left = 9,\n right = 35\n ) %>%\n # Expect that column `hwy` is of type: integer\n col_is_integer(\n columns = c(\"hwy\")\n ) %>%\n # Expect that values in `hwy` should be between `12` and `44`\n col_vals_between(\n columns = c(\"hwy\"),\n left = 12,\n right = 44\n ) %>%\n # Expect that column `fl` is of type: character\n col_is_character(\n columns = c(\"fl\")\n ) %>%\n # Expect that column `class` is of type: character\n col_is_character(\n columns = c(\"class\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n manufacturer = \"character\",\n model = \"character\",\n displ = \"numeric\",\n year = \"integer\",\n cyl = \"integer\",\n trans = \"character\",\n drv = \"character\",\n cty = \"integer\",\n hwy = \"integer\",\n fl = \"character\",\n class = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `genus` is of type: character\n col_is_character(\n columns = c(\"genus\")\n ) %>%\n # Expect that column `vore` is of type: character\n col_is_character(\n columns = c(\"vore\")\n ) %>%\n # Expect that column `order` is of type: character\n col_is_character(\n columns = c(\"order\")\n ) %>%\n # Expect that column `conservation` is of type: character\n col_is_character(\n columns = c(\"conservation\")\n ) %>%\n # Expect that column `sleep_total` is of type: numeric\n col_is_numeric(\n columns = c(\"sleep_total\")\n ) %>%\n # Expect that values in `sleep_total` should be between `1.9` and `19.9`\n col_vals_between(\n columns = c(\"sleep_total\"),\n left = 1.9,\n right = 19.9\n ) %>%\n # Expect that column `sleep_rem` is of type: numeric\n col_is_numeric(\n columns = c(\"sleep_rem\")\n ) %>%\n # Expect that values in `sleep_rem` should be between `0.1` and `6.6`\n col_vals_between(\n columns = c(\"sleep_rem\"),\n left = 0.1,\n right = 6.6,\n na_pass = TRUE\n ) %>%\n # Expect that column `sleep_cycle` is of type: numeric\n col_is_numeric(\n columns = c(\"sleep_cycle\")\n ) %>%\n # Expect that values in `sleep_cycle` should be between `0.116666667` and `1.5`\n col_vals_between(\n columns = c(\"sleep_cycle\"),\n left = 0.1166667,\n right = 1.5,\n na_pass = TRUE\n ) %>%\n # Expect that column `awake` is of type: numeric\n col_is_numeric(\n columns = c(\"awake\")\n ) %>%\n # Expect that values in `awake` should be between `4.1` and `22.1`\n col_vals_between(\n columns = c(\"awake\"),\n left = 4.1,\n right = 22.1\n ) %>%\n # Expect that column `brainwt` is of type: numeric\n col_is_numeric(\n columns = c(\"brainwt\")\n ) %>%\n # Expect that values in `brainwt` should be between `0.00014` and `5.712`\n col_vals_between(\n columns = c(\"brainwt\"),\n left = 0.00014,\n right = 5.712,\n na_pass = TRUE\n ) %>%\n # Expect that column `bodywt` is of type: numeric\n col_is_numeric(\n columns = c(\"bodywt\")\n ) %>%\n # Expect that values in `bodywt` should be between `0.005` and `6654`\n col_vals_between(\n columns = c(\"bodywt\"),\n left = 0.005,\n right = 6654\n ) %>%\n # Expect entirely distinct rows across `name, genus, vore, order, conservation, sleep_total, sleep_rem, sleep_cycle, awake, brainwt, bodywt`\n rows_distinct(\n columns = c(\"name\", \"genus\", \"vore\", \"order\", \"conservation\", \"sleep_total\", \"sleep_rem\", \"sleep_cycle\", \"awake\", \"brainwt\", \"bodywt\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n genus = \"character\",\n vore = \"character\",\n order = \"character\",\n conservation = \"character\",\n sleep_total = \"numeric\",\n sleep_rem = \"numeric\",\n sleep_cycle = \"numeric\",\n awake = \"numeric\",\n brainwt = \"numeric\",\n bodywt = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `genus` is of type: character\n col_is_character(\n columns = c(\"genus\")\n ) %>%\n # Expect that column `vore` is of type: character\n col_is_character(\n columns = c(\"vore\")\n ) %>%\n # Expect that column `order` is of type: character\n col_is_character(\n columns = c(\"order\")\n ) %>%\n # Expect that column `conservation` is of type: character\n col_is_character(\n columns = c(\"conservation\")\n ) %>%\n # Expect that column `sleep_total` is of type: numeric\n col_is_numeric(\n columns = c(\"sleep_total\")\n ) %>%\n # Expect that values in `sleep_total` should be between `1.9` and `19.9`\n col_vals_between(\n columns = c(\"sleep_total\"),\n left = 1.9,\n right = 19.9\n ) %>%\n # Expect that column `sleep_rem` is of type: numeric\n col_is_numeric(\n columns = c(\"sleep_rem\")\n ) %>%\n # Expect that values in `sleep_rem` should be between `0.1` and `6.6`\n col_vals_between(\n columns = c(\"sleep_rem\"),\n left = 0.1,\n right = 6.6,\n na_pass = TRUE\n ) %>%\n # Expect that column `sleep_cycle` is of type: numeric\n col_is_numeric(\n columns = c(\"sleep_cycle\")\n ) %>%\n # Expect that values in `sleep_cycle` should be between `0.116666667` and `1.5`\n col_vals_between(\n columns = c(\"sleep_cycle\"),\n left = 0.1166667,\n right = 1.5,\n na_pass = TRUE\n ) %>%\n # Expect that column `awake` is of type: numeric\n col_is_numeric(\n columns = c(\"awake\")\n ) %>%\n # Expect that values in `awake` should be between `4.1` and `22.1`\n col_vals_between(\n columns = c(\"awake\"),\n left = 4.1,\n right = 22.1\n ) %>%\n # Expect that column `brainwt` is of type: numeric\n col_is_numeric(\n columns = c(\"brainwt\")\n ) %>%\n # Expect that values in `brainwt` should be between `0.00014` and `5.712`\n col_vals_between(\n columns = c(\"brainwt\"),\n left = 0.00014,\n right = 5.712,\n na_pass = TRUE\n ) %>%\n # Expect that column `bodywt` is of type: numeric\n col_is_numeric(\n columns = c(\"bodywt\")\n ) %>%\n # Expect that values in `bodywt` should be between `0.005` and `6654`\n col_vals_between(\n columns = c(\"bodywt\"),\n left = 0.005,\n right = 6654\n ) %>%\n # Expect entirely distinct rows across `name, genus, vore, order, conservation, sleep_total, sleep_rem, sleep_cycle, awake, brainwt, bodywt`\n rows_distinct(\n columns = c(\"name\", \"genus\", \"vore\", \"order\", \"conservation\", \"sleep_total\", \"sleep_rem\", \"sleep_cycle\", \"awake\", \"brainwt\", \"bodywt\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n genus = \"character\",\n vore = \"character\",\n order = \"character\",\n conservation = \"character\",\n sleep_total = \"numeric\",\n sleep_rem = \"numeric\",\n sleep_cycle = \"numeric\",\n awake = \"numeric\",\n brainwt = \"numeric\",\n bodywt = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `party` is of type: character\n col_is_character(\n columns = c(\"party\")\n ) %>%\n # Expect entirely distinct rows across `name, start, end, party`\n rows_distinct(\n columns = c(\"name\", \"start\", \"end\", \"party\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n start = \"Date\",\n end = \"Date\",\n party = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `party` is of type: character\n col_is_character(\n columns = c(\"party\")\n ) %>%\n # Expect entirely distinct rows across `name, start, end, party`\n rows_distinct(\n columns = c(\"name\", \"start\", \"end\", \"party\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n start = \"Date\",\n end = \"Date\",\n party = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `lat` is of type: numeric\n col_is_numeric(\n columns = c(\"lat\")\n ) %>%\n # Expect that values in `lat` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"lat\"),\n left = -90,\n right = 90\n ) %>%\n # Expect that column `long` is of type: numeric\n col_is_numeric(\n columns = c(\"long\")\n ) %>%\n # Expect that values in `long` should be between `-180` and `180`\n col_vals_between(\n columns = c(\"long\"),\n left = -180,\n right = 180\n ) %>%\n # Expect that column `delta_long` is of type: numeric\n col_is_numeric(\n columns = c(\"delta_long\")\n ) %>%\n # Expect that values in `delta_long` should be between `-180` and `180`\n col_vals_between(\n columns = c(\"delta_long\"),\n left = -180,\n right = 180\n ) %>%\n # Expect that column `delta_lat` is of type: numeric\n col_is_numeric(\n columns = c(\"delta_lat\")\n ) %>%\n # Expect that values in `delta_lat` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"delta_lat\"),\n left = -90,\n right = 90\n ) %>%\n # Expect entirely distinct rows across `lat, long, delta_long, delta_lat`\n rows_distinct(\n columns = c(\"lat\", \"long\", \"delta_long\", \"delta_lat\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n lat = \"numeric\",\n long = \"numeric\",\n delta_long = \"numeric\",\n delta_lat = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `lat` is of type: numeric\n col_is_numeric(\n columns = c(\"lat\")\n ) %>%\n # Expect that values in `lat` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"lat\"),\n left = -90,\n right = 90\n ) %>%\n # Expect that column `long` is of type: numeric\n col_is_numeric(\n columns = c(\"long\")\n ) %>%\n # Expect that values in `long` should be between `-180` and `180`\n col_vals_between(\n columns = c(\"long\"),\n left = -180,\n right = 180\n ) %>%\n # Expect that column `delta_long` is of type: numeric\n col_is_numeric(\n columns = c(\"delta_long\")\n ) %>%\n # Expect that values in `delta_long` should be between `-180` and `180`\n col_vals_between(\n columns = c(\"delta_long\"),\n left = -180,\n right = 180\n ) %>%\n # Expect that column `delta_lat` is of type: numeric\n col_is_numeric(\n columns = c(\"delta_lat\")\n ) %>%\n # Expect that values in `delta_lat` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"delta_lat\"),\n left = -90,\n right = 90\n ) %>%\n # Expect entirely distinct rows across `lat, long, delta_long, delta_lat`\n rows_distinct(\n columns = c(\"lat\", \"long\", \"delta_long\", \"delta_lat\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n lat = \"numeric\",\n long = \"numeric\",\n delta_long = \"numeric\",\n delta_lat = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `city` is of type: character\n col_is_character(\n columns = c(\"city\")\n ) %>%\n # Expect that column `year` is of type: integer\n col_is_integer(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `2000` and `2015`\n col_vals_between(\n columns = c(\"year\"),\n left = 2000,\n right = 2015\n ) %>%\n # Expect that column `month` is of type: integer\n col_is_integer(\n columns = c(\"month\")\n ) %>%\n # Expect that values in `month` should be between `1` and `12`\n col_vals_between(\n columns = c(\"month\"),\n left = 1,\n right = 12\n ) %>%\n # Expect that column `sales` is of type: numeric\n col_is_numeric(\n columns = c(\"sales\")\n ) %>%\n # Expect that values in `sales` should be between `6` and `8945`\n col_vals_between(\n columns = c(\"sales\"),\n left = 6,\n right = 8945,\n na_pass = TRUE\n ) %>%\n # Expect that column `volume` is of type: numeric\n col_is_numeric(\n columns = c(\"volume\")\n ) %>%\n # Expect that values in `volume` should be between `835000` and `2568156780`\n col_vals_between(\n columns = c(\"volume\"),\n left = 835000,\n right = 2568156800,\n na_pass = TRUE\n ) %>%\n # Expect that column `median` is of type: numeric\n col_is_numeric(\n columns = c(\"median\")\n ) %>%\n # Expect that values in `median` should be between `50000` and `304200`\n col_vals_between(\n columns = c(\"median\"),\n left = 50000,\n right = 304200,\n na_pass = TRUE\n ) %>%\n # Expect that column `listings` is of type: numeric\n col_is_numeric(\n columns = c(\"listings\")\n ) %>%\n # Expect that values in `listings` should be between `0` and `43107`\n col_vals_between(\n columns = c(\"listings\"),\n left = 0,\n right = 43107,\n na_pass = TRUE\n ) %>%\n # Expect that column `inventory` is of type: numeric\n col_is_numeric(\n columns = c(\"inventory\")\n ) %>%\n # Expect that values in `inventory` should be between `0` and `55.9`\n col_vals_between(\n columns = c(\"inventory\"),\n left = 0,\n right = 55.9,\n na_pass = TRUE\n ) %>%\n # Expect that column `date` is of type: numeric\n col_is_numeric(\n columns = c(\"date\")\n ) %>%\n # Expect that values in `date` should be between `2000` and `2015.5`\n col_vals_between(\n columns = c(\"date\"),\n left = 2000,\n right = 2015.5\n ) %>%\n # Expect entirely distinct rows across `city, year, month, sales, volume, median, listings, inventory, date`\n rows_distinct(\n columns = c(\"city\", \"year\", \"month\", \"sales\", \"volume\", \"median\", \"listings\", \"inventory\", \"date\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n city = \"character\",\n year = \"integer\",\n month = \"integer\",\n sales = \"numeric\",\n volume = \"numeric\",\n median = \"numeric\",\n listings = \"numeric\",\n inventory = \"numeric\",\n date = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `city` is of type: character\n col_is_character(\n columns = c(\"city\")\n ) %>%\n # Expect that column `year` is of type: integer\n col_is_integer(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `2000` and `2015`\n col_vals_between(\n columns = c(\"year\"),\n left = 2000,\n right = 2015\n ) %>%\n # Expect that column `month` is of type: integer\n col_is_integer(\n columns = c(\"month\")\n ) %>%\n # Expect that values in `month` should be between `1` and `12`\n col_vals_between(\n columns = c(\"month\"),\n left = 1,\n right = 12\n ) %>%\n # Expect that column `sales` is of type: numeric\n col_is_numeric(\n columns = c(\"sales\")\n ) %>%\n # Expect that values in `sales` should be between `6` and `8945`\n col_vals_between(\n columns = c(\"sales\"),\n left = 6,\n right = 8945,\n na_pass = TRUE\n ) %>%\n # Expect that column `volume` is of type: numeric\n col_is_numeric(\n columns = c(\"volume\")\n ) %>%\n # Expect that values in `volume` should be between `835000` and `2568156780`\n col_vals_between(\n columns = c(\"volume\"),\n left = 835000,\n right = 2568156800,\n na_pass = TRUE\n ) %>%\n # Expect that column `median` is of type: numeric\n col_is_numeric(\n columns = c(\"median\")\n ) %>%\n # Expect that values in `median` should be between `50000` and `304200`\n col_vals_between(\n columns = c(\"median\"),\n left = 50000,\n right = 304200,\n na_pass = TRUE\n ) %>%\n # Expect that column `listings` is of type: numeric\n col_is_numeric(\n columns = c(\"listings\")\n ) %>%\n # Expect that values in `listings` should be between `0` and `43107`\n col_vals_between(\n columns = c(\"listings\"),\n left = 0,\n right = 43107,\n na_pass = TRUE\n ) %>%\n # Expect that column `inventory` is of type: numeric\n col_is_numeric(\n columns = c(\"inventory\")\n ) %>%\n # Expect that values in `inventory` should be between `0` and `55.9`\n col_vals_between(\n columns = c(\"inventory\"),\n left = 0,\n right = 55.9,\n na_pass = TRUE\n ) %>%\n # Expect that column `date` is of type: numeric\n col_is_numeric(\n columns = c(\"date\")\n ) %>%\n # Expect that values in `date` should be between `2000` and `2015.5`\n col_vals_between(\n columns = c(\"date\"),\n left = 2000,\n right = 2015.5\n ) %>%\n # Expect entirely distinct rows across `city, year, month, sales, volume, median, listings, inventory, date`\n rows_distinct(\n columns = c(\"city\", \"year\", \"month\", \"sales\", \"volume\", \"median\", \"listings\", \"inventory\", \"date\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n city = \"character\",\n year = \"integer\",\n month = \"integer\",\n sales = \"numeric\",\n volume = \"numeric\",\n median = \"numeric\",\n listings = \"numeric\",\n inventory = \"numeric\",\n date = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `plays` is of type: character\n col_is_character(\n columns = c(\"plays\")\n ) %>%\n # Expect entirely distinct rows across `name, plays`\n rows_distinct(\n columns = c(\"name\", \"plays\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n plays = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `plays` is of type: character\n col_is_character(\n columns = c(\"plays\")\n ) %>%\n # Expect entirely distinct rows across `name, plays`\n rows_distinct(\n columns = c(\"name\", \"plays\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n plays = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `band` is of type: character\n col_is_character(\n columns = c(\"band\")\n ) %>%\n # Expect entirely distinct rows across `name, band`\n rows_distinct(\n columns = c(\"name\", \"band\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n band = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `band` is of type: character\n col_is_character(\n columns = c(\"band\")\n ) %>%\n # Expect entirely distinct rows across `name, band`\n rows_distinct(\n columns = c(\"name\", \"band\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n band = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `height` is of type: integer\n col_is_integer(\n columns = c(\"height\")\n ) %>%\n # Expect that values in `height` should be between `66` and `264`\n col_vals_between(\n columns = c(\"height\"),\n left = 66,\n right = 264,\n na_pass = TRUE\n ) %>%\n # Expect that column `mass` is of type: numeric\n col_is_numeric(\n columns = c(\"mass\")\n ) %>%\n # Expect that values in `mass` should be between `15` and `1358`\n col_vals_between(\n columns = c(\"mass\"),\n left = 15,\n right = 1358,\n na_pass = TRUE\n ) %>%\n # Expect that column `hair_color` is of type: character\n col_is_character(\n columns = c(\"hair_color\")\n ) %>%\n # Expect that column `skin_color` is of type: character\n col_is_character(\n columns = c(\"skin_color\")\n ) %>%\n # Expect that column `eye_color` is of type: character\n col_is_character(\n columns = c(\"eye_color\")\n ) %>%\n # Expect that column `birth_year` is of type: numeric\n col_is_numeric(\n columns = c(\"birth_year\")\n ) %>%\n # Expect that values in `birth_year` should be between `8` and `896`\n col_vals_between(\n columns = c(\"birth_year\"),\n left = 8,\n right = 896,\n na_pass = TRUE\n ) %>%\n # Expect that column `sex` is of type: character\n col_is_character(\n columns = c(\"sex\")\n ) %>%\n # Expect that column `gender` is of type: character\n col_is_character(\n columns = c(\"gender\")\n ) %>%\n # Expect that column `homeworld` is of type: character\n col_is_character(\n columns = c(\"homeworld\")\n ) %>%\n # Expect that column `species` is of type: character\n col_is_character(\n columns = c(\"species\")\n ) %>%\n # Expect entirely distinct rows across `name, height, mass, hair_color, skin_color, eye_color, birth_year, sex, gender, homeworld, species, films, vehicles, starships`\n rows_distinct(\n columns = c(\"name\", \"height\", \"mass\", \"hair_color\", \"skin_color\", \"eye_color\", \"birth_year\", \"sex\", \"gender\", \"homeworld\", \"species\", \"films\", \"vehicles\", \"starships\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n height = \"integer\",\n mass = \"numeric\",\n hair_color = \"character\",\n skin_color = \"character\",\n eye_color = \"character\",\n birth_year = \"numeric\",\n sex = \"character\",\n gender = \"character\",\n homeworld = \"character\",\n species = \"character\",\n films = \"list\",\n vehicles = \"list\",\n starships = \"list\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `height` is of type: integer\n col_is_integer(\n columns = c(\"height\")\n ) %>%\n # Expect that values in `height` should be between `66` and `264`\n col_vals_between(\n columns = c(\"height\"),\n left = 66,\n right = 264,\n na_pass = TRUE\n ) %>%\n # Expect that column `mass` is of type: numeric\n col_is_numeric(\n columns = c(\"mass\")\n ) %>%\n # Expect that values in `mass` should be between `15` and `1358`\n col_vals_between(\n columns = c(\"mass\"),\n left = 15,\n right = 1358,\n na_pass = TRUE\n ) %>%\n # Expect that column `hair_color` is of type: character\n col_is_character(\n columns = c(\"hair_color\")\n ) %>%\n # Expect that column `skin_color` is of type: character\n col_is_character(\n columns = c(\"skin_color\")\n ) %>%\n # Expect that column `eye_color` is of type: character\n col_is_character(\n columns = c(\"eye_color\")\n ) %>%\n # Expect that column `birth_year` is of type: numeric\n col_is_numeric(\n columns = c(\"birth_year\")\n ) %>%\n # Expect that values in `birth_year` should be between `8` and `896`\n col_vals_between(\n columns = c(\"birth_year\"),\n left = 8,\n right = 896,\n na_pass = TRUE\n ) %>%\n # Expect that column `sex` is of type: character\n col_is_character(\n columns = c(\"sex\")\n ) %>%\n # Expect that column `gender` is of type: character\n col_is_character(\n columns = c(\"gender\")\n ) %>%\n # Expect that column `homeworld` is of type: character\n col_is_character(\n columns = c(\"homeworld\")\n ) %>%\n # Expect that column `species` is of type: character\n col_is_character(\n columns = c(\"species\")\n ) %>%\n # Expect entirely distinct rows across `name, height, mass, hair_color, skin_color, eye_color, birth_year, sex, gender, homeworld, species, films, vehicles, starships`\n rows_distinct(\n columns = c(\"name\", \"height\", \"mass\", \"hair_color\", \"skin_color\", \"eye_color\", \"birth_year\", \"sex\", \"gender\", \"homeworld\", \"species\", \"films\", \"vehicles\", \"starships\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n name = \"character\",\n height = \"integer\",\n mass = \"numeric\",\n hair_color = \"character\",\n skin_color = \"character\",\n eye_color = \"character\",\n birth_year = \"numeric\",\n sex = \"character\",\n gender = \"character\",\n homeworld = \"character\",\n species = \"character\",\n films = \"list\",\n vehicles = \"list\",\n starships = \"list\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `artist` is of type: character\n col_is_character(\n columns = c(\"artist\")\n ) %>%\n # Expect that column `track` is of type: character\n col_is_character(\n columns = c(\"track\")\n ) %>%\n # Expect that column `wk1` is of type: numeric\n col_is_numeric(\n columns = c(\"wk1\")\n ) %>%\n # Expect that values in `wk1` should be between `15` and `100`\n col_vals_between(\n columns = c(\"wk1\"),\n left = 15,\n right = 100\n ) %>%\n # Expect that column `wk2` is of type: numeric\n col_is_numeric(\n columns = c(\"wk2\")\n ) %>%\n # Expect that values in `wk2` should be between `8` and `100`\n col_vals_between(\n columns = c(\"wk2\"),\n left = 8,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk3` is of type: numeric\n col_is_numeric(\n columns = c(\"wk3\")\n ) %>%\n # Expect that values in `wk3` should be between `6` and `100`\n col_vals_between(\n columns = c(\"wk3\"),\n left = 6,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk4` is of type: numeric\n col_is_numeric(\n columns = c(\"wk4\")\n ) %>%\n # Expect that values in `wk4` should be between `5` and `100`\n col_vals_between(\n columns = c(\"wk4\"),\n left = 5,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk5` is of type: numeric\n col_is_numeric(\n columns = c(\"wk5\")\n ) %>%\n # Expect that values in `wk5` should be between `2` and `100`\n col_vals_between(\n columns = c(\"wk5\"),\n left = 2,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk6` is of type: numeric\n col_is_numeric(\n columns = c(\"wk6\")\n ) %>%\n # Expect that values in `wk6` should be between `1` and `99`\n col_vals_between(\n columns = c(\"wk6\"),\n left = 1,\n right = 99,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk7` is of type: numeric\n col_is_numeric(\n columns = c(\"wk7\")\n ) %>%\n # Expect that values in `wk7` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk7\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk8` is of type: numeric\n col_is_numeric(\n columns = c(\"wk8\")\n ) %>%\n # Expect that values in `wk8` should be between `1` and `99`\n col_vals_between(\n columns = c(\"wk8\"),\n left = 1,\n right = 99,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk9` is of type: numeric\n col_is_numeric(\n columns = c(\"wk9\")\n ) %>%\n # Expect that values in `wk9` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk9\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk10` is of type: numeric\n col_is_numeric(\n columns = c(\"wk10\")\n ) %>%\n # Expect that values in `wk10` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk10\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk11` is of type: numeric\n col_is_numeric(\n columns = c(\"wk11\")\n ) %>%\n # Expect that values in `wk11` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk11\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk12` is of type: numeric\n col_is_numeric(\n columns = c(\"wk12\")\n ) %>%\n # Expect that values in `wk12` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk12\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk13` is of type: numeric\n col_is_numeric(\n columns = c(\"wk13\")\n ) %>%\n # Expect that values in `wk13` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk13\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk14` is of type: numeric\n col_is_numeric(\n columns = c(\"wk14\")\n ) %>%\n # Expect that values in `wk14` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk14\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk15` is of type: numeric\n col_is_numeric(\n columns = c(\"wk15\")\n ) %>%\n # Expect that values in `wk15` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk15\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk16` is of type: numeric\n col_is_numeric(\n columns = c(\"wk16\")\n ) %>%\n # Expect that values in `wk16` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk16\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk17` is of type: numeric\n col_is_numeric(\n columns = c(\"wk17\")\n ) %>%\n # Expect that values in `wk17` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk17\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk18` is of type: numeric\n col_is_numeric(\n columns = c(\"wk18\")\n ) %>%\n # Expect that values in `wk18` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk18\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk19` is of type: numeric\n col_is_numeric(\n columns = c(\"wk19\")\n ) %>%\n # Expect that values in `wk19` should be between `1` and `99`\n col_vals_between(\n columns = c(\"wk19\"),\n left = 1,\n right = 99,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk20` is of type: numeric\n col_is_numeric(\n columns = c(\"wk20\")\n ) %>%\n # Expect that values in `wk20` should be between `2` and `100`\n col_vals_between(\n columns = c(\"wk20\"),\n left = 2,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk21` is of type: numeric\n col_is_numeric(\n columns = c(\"wk21\")\n ) %>%\n # Expect that values in `wk21` should be between `3` and `97`\n col_vals_between(\n columns = c(\"wk21\"),\n left = 3,\n right = 97,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk22` is of type: numeric\n col_is_numeric(\n columns = c(\"wk22\")\n ) %>%\n # Expect that values in `wk22` should be between `3` and `100`\n col_vals_between(\n columns = c(\"wk22\"),\n left = 3,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk23` is of type: numeric\n col_is_numeric(\n columns = c(\"wk23\")\n ) %>%\n # Expect that values in `wk23` should be between `3` and `91`\n col_vals_between(\n columns = c(\"wk23\"),\n left = 3,\n right = 91,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk24` is of type: numeric\n col_is_numeric(\n columns = c(\"wk24\")\n ) %>%\n # Expect that values in `wk24` should be between `3` and `91`\n col_vals_between(\n columns = c(\"wk24\"),\n left = 3,\n right = 91,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk25` is of type: numeric\n col_is_numeric(\n columns = c(\"wk25\")\n ) %>%\n # Expect that values in `wk25` should be between `2` and `90`\n col_vals_between(\n columns = c(\"wk25\"),\n left = 2,\n right = 90,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk26` is of type: numeric\n col_is_numeric(\n columns = c(\"wk26\")\n ) %>%\n # Expect that values in `wk26` should be between `1` and `89`\n col_vals_between(\n columns = c(\"wk26\"),\n left = 1,\n right = 89,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk27` is of type: numeric\n col_is_numeric(\n columns = c(\"wk27\")\n ) %>%\n # Expect that values in `wk27` should be between `1` and `86`\n col_vals_between(\n columns = c(\"wk27\"),\n left = 1,\n right = 86,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk28` is of type: numeric\n col_is_numeric(\n columns = c(\"wk28\")\n ) %>%\n # Expect that values in `wk28` should be between `2` and `58`\n col_vals_between(\n columns = c(\"wk28\"),\n left = 2,\n right = 58,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk29` is of type: numeric\n col_is_numeric(\n columns = c(\"wk29\")\n ) %>%\n # Expect that values in `wk29` should be between `2` and `49`\n col_vals_between(\n columns = c(\"wk29\"),\n left = 2,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk30` is of type: numeric\n col_is_numeric(\n columns = c(\"wk30\")\n ) %>%\n # Expect that values in `wk30` should be between `2` and `45`\n col_vals_between(\n columns = c(\"wk30\"),\n left = 2,\n right = 45,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk31` is of type: numeric\n col_is_numeric(\n columns = c(\"wk31\")\n ) %>%\n # Expect that values in `wk31` should be between `3` and `49`\n col_vals_between(\n columns = c(\"wk31\"),\n left = 3,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk32` is of type: numeric\n col_is_numeric(\n columns = c(\"wk32\")\n ) %>%\n # Expect that values in `wk32` should be between `3` and `47`\n col_vals_between(\n columns = c(\"wk32\"),\n left = 3,\n right = 47,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk33` is of type: numeric\n col_is_numeric(\n columns = c(\"wk33\")\n ) %>%\n # Expect that values in `wk33` should be between `2` and `50`\n col_vals_between(\n columns = c(\"wk33\"),\n left = 2,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk34` is of type: numeric\n col_is_numeric(\n columns = c(\"wk34\")\n ) %>%\n # Expect that values in `wk34` should be between `3` and `49`\n col_vals_between(\n columns = c(\"wk34\"),\n left = 3,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk35` is of type: numeric\n col_is_numeric(\n columns = c(\"wk35\")\n ) %>%\n # Expect that values in `wk35` should be between `4` and `34`\n col_vals_between(\n columns = c(\"wk35\"),\n left = 4,\n right = 34,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk36` is of type: numeric\n col_is_numeric(\n columns = c(\"wk36\")\n ) %>%\n # Expect that values in `wk36` should be between `5` and `41`\n col_vals_between(\n columns = c(\"wk36\"),\n left = 5,\n right = 41,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk37` is of type: numeric\n col_is_numeric(\n columns = c(\"wk37\")\n ) %>%\n # Expect that values in `wk37` should be between `5` and `48`\n col_vals_between(\n columns = c(\"wk37\"),\n left = 5,\n right = 48,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk38` is of type: numeric\n col_is_numeric(\n columns = c(\"wk38\")\n ) %>%\n # Expect that values in `wk38` should be between `9` and `40`\n col_vals_between(\n columns = c(\"wk38\"),\n left = 9,\n right = 40,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk39` is of type: numeric\n col_is_numeric(\n columns = c(\"wk39\")\n ) %>%\n # Expect that values in `wk39` should be between `3` and `50`\n col_vals_between(\n columns = c(\"wk39\"),\n left = 3,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk40` is of type: numeric\n col_is_numeric(\n columns = c(\"wk40\")\n ) %>%\n # Expect that values in `wk40` should be between `1` and `47`\n col_vals_between(\n columns = c(\"wk40\"),\n left = 1,\n right = 47,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk41` is of type: numeric\n col_is_numeric(\n columns = c(\"wk41\")\n ) %>%\n # Expect that values in `wk41` should be between `1` and `50`\n col_vals_between(\n columns = c(\"wk41\"),\n left = 1,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk42` is of type: numeric\n col_is_numeric(\n columns = c(\"wk42\")\n ) %>%\n # Expect that values in `wk42` should be between `2` and `22`\n col_vals_between(\n columns = c(\"wk42\"),\n left = 2,\n right = 22,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk43` is of type: numeric\n col_is_numeric(\n columns = c(\"wk43\")\n ) %>%\n # Expect that values in `wk43` should be between `3` and `32`\n col_vals_between(\n columns = c(\"wk43\"),\n left = 3,\n right = 32,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk44` is of type: numeric\n col_is_numeric(\n columns = c(\"wk44\")\n ) %>%\n # Expect that values in `wk44` should be between `4` and `45`\n col_vals_between(\n columns = c(\"wk44\"),\n left = 4,\n right = 45,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk45` is of type: numeric\n col_is_numeric(\n columns = c(\"wk45\")\n ) %>%\n # Expect that values in `wk45` should be between `4` and `31`\n col_vals_between(\n columns = c(\"wk45\"),\n left = 4,\n right = 31,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk46` is of type: numeric\n col_is_numeric(\n columns = c(\"wk46\")\n ) %>%\n # Expect that values in `wk46` should be between `5` and `37`\n col_vals_between(\n columns = c(\"wk46\"),\n left = 5,\n right = 37,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk47` is of type: numeric\n col_is_numeric(\n columns = c(\"wk47\")\n ) %>%\n # Expect that values in `wk47` should be between `6` and `41`\n col_vals_between(\n columns = c(\"wk47\"),\n left = 6,\n right = 41,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk48` is of type: numeric\n col_is_numeric(\n columns = c(\"wk48\")\n ) %>%\n # Expect that values in `wk48` should be between `8` and `39`\n col_vals_between(\n columns = c(\"wk48\"),\n left = 8,\n right = 39,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk49` is of type: numeric\n col_is_numeric(\n columns = c(\"wk49\")\n ) %>%\n # Expect that values in `wk49` should be between `9` and `42`\n col_vals_between(\n columns = c(\"wk49\"),\n left = 9,\n right = 42,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk50` is of type: numeric\n col_is_numeric(\n columns = c(\"wk50\")\n ) %>%\n # Expect that values in `wk50` should be between `10` and `49`\n col_vals_between(\n columns = c(\"wk50\"),\n left = 10,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk51` is of type: numeric\n col_is_numeric(\n columns = c(\"wk51\")\n ) %>%\n # Expect that values in `wk51` should be between `12` and `49`\n col_vals_between(\n columns = c(\"wk51\"),\n left = 12,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk52` is of type: numeric\n col_is_numeric(\n columns = c(\"wk52\")\n ) %>%\n # Expect that values in `wk52` should be between `15` and `48`\n col_vals_between(\n columns = c(\"wk52\"),\n left = 15,\n right = 48,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk53` is of type: numeric\n col_is_numeric(\n columns = c(\"wk53\")\n ) %>%\n # Expect that values in `wk53` should be between `17` and `49`\n col_vals_between(\n columns = c(\"wk53\"),\n left = 17,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk54` is of type: numeric\n col_is_numeric(\n columns = c(\"wk54\")\n ) %>%\n # Expect that values in `wk54` should be between `17` and `22`\n col_vals_between(\n columns = c(\"wk54\"),\n left = 17,\n right = 22,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk55` is of type: numeric\n col_is_numeric(\n columns = c(\"wk55\")\n ) %>%\n # Expect that values in `wk55` should be between `21` and `22`\n col_vals_between(\n columns = c(\"wk55\"),\n left = 21,\n right = 22,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk56` is of type: numeric\n col_is_numeric(\n columns = c(\"wk56\")\n ) %>%\n # Expect that values in `wk56` should be between `25` and `26`\n col_vals_between(\n columns = c(\"wk56\"),\n left = 25,\n right = 26,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk57` is of type: numeric\n col_is_numeric(\n columns = c(\"wk57\")\n ) %>%\n # Expect that values in `wk57` should be between `26` and `29`\n col_vals_between(\n columns = c(\"wk57\"),\n left = 26,\n right = 29,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk58` is of type: numeric\n col_is_numeric(\n columns = c(\"wk58\")\n ) %>%\n # Expect that values in `wk58` should be between `31` and `32`\n col_vals_between(\n columns = c(\"wk58\"),\n left = 31,\n right = 32,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk59` is of type: numeric\n col_is_numeric(\n columns = c(\"wk59\")\n ) %>%\n # Expect that values in `wk59` should be between `32` and `39`\n col_vals_between(\n columns = c(\"wk59\"),\n left = 32,\n right = 39,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk60` is of type: numeric\n col_is_numeric(\n columns = c(\"wk60\")\n ) %>%\n # Expect that values in `wk60` should be between `37` and `39`\n col_vals_between(\n columns = c(\"wk60\"),\n left = 37,\n right = 39,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk61` is of type: numeric\n col_is_numeric(\n columns = c(\"wk61\")\n ) %>%\n # Expect that values in `wk61` should be between `42` and `43`\n col_vals_between(\n columns = c(\"wk61\"),\n left = 42,\n right = 43,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk62` is of type: numeric\n col_is_numeric(\n columns = c(\"wk62\")\n ) %>%\n # Expect that values in `wk62` should be between `42` and `47`\n col_vals_between(\n columns = c(\"wk62\"),\n left = 42,\n right = 47,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk63` is of type: numeric\n col_is_numeric(\n columns = c(\"wk63\")\n ) %>%\n # Expect that values in `wk63` should be between `45` and `50`\n col_vals_between(\n columns = c(\"wk63\"),\n left = 45,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk64` is of type: numeric\n col_is_numeric(\n columns = c(\"wk64\")\n ) %>%\n # Expect that values in `wk64` should be between `50` and `50`\n col_vals_between(\n columns = c(\"wk64\"),\n left = 50,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk65` is of type: numeric\n col_is_numeric(\n columns = c(\"wk65\")\n ) %>%\n # Expect that values in `wk65` should be between `49` and `49`\n col_vals_between(\n columns = c(\"wk65\"),\n left = 49,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk66` is of type: logical\n col_is_logical(\n columns = c(\"wk66\")\n ) %>%\n # Expect that column `wk67` is of type: logical\n col_is_logical(\n columns = c(\"wk67\")\n ) %>%\n # Expect that column `wk68` is of type: logical\n col_is_logical(\n columns = c(\"wk68\")\n ) %>%\n # Expect that column `wk69` is of type: logical\n col_is_logical(\n columns = c(\"wk69\")\n ) %>%\n # Expect that column `wk70` is of type: logical\n col_is_logical(\n columns = c(\"wk70\")\n ) %>%\n # Expect that column `wk71` is of type: logical\n col_is_logical(\n columns = c(\"wk71\")\n ) %>%\n # Expect that column `wk72` is of type: logical\n col_is_logical(\n columns = c(\"wk72\")\n ) %>%\n # Expect that column `wk73` is of type: logical\n col_is_logical(\n columns = c(\"wk73\")\n ) %>%\n # Expect that column `wk74` is of type: logical\n col_is_logical(\n columns = c(\"wk74\")\n ) %>%\n # Expect that column `wk75` is of type: logical\n col_is_logical(\n columns = c(\"wk75\")\n ) %>%\n # Expect that column `wk76` is of type: logical\n col_is_logical(\n columns = c(\"wk76\")\n ) %>%\n # Expect entirely distinct rows across `artist, track, date.entered, wk1, wk2, wk3, wk4, wk5, wk6, wk7, wk8, wk9, wk10, wk11, wk12, wk13, wk14, wk15, wk16, wk17, wk18, wk19, wk20, wk21, wk22, wk23, wk24, wk25, wk26, wk27, wk28, wk29, wk30, wk31, wk32, wk33, wk34, wk35, wk36, wk37, wk38, wk39, wk40, wk41, wk42, wk43, wk44, wk45, wk46, wk47, wk48, wk49, wk50, wk51, wk52, wk53, wk54, wk55, wk56, wk57, wk58, wk59, wk60, wk61, wk62, wk63, wk64, wk65, wk66, wk67, wk68, wk69, wk70, wk71, wk72, wk73, wk74, wk75, wk76`\n rows_distinct(\n columns = c(\"artist\", \"track\", \"date.entered\", \"wk1\", \"wk2\", \"wk3\", \"wk4\", \"wk5\", \"wk6\", \"wk7\", \"wk8\", \"wk9\", \"wk10\", \"wk11\", \"wk12\", \"wk13\", \"wk14\", \"wk15\", \"wk16\", \"wk17\", \"wk18\", \"wk19\", \"wk20\", \"wk21\", \"wk22\", \"wk23\", \"wk24\", \"wk25\", \"wk26\", \"wk27\", \"wk28\", \"wk29\", \"wk30\", \"wk31\", \"wk32\", \"wk33\", \"wk34\", \"wk35\", \"wk36\", \"wk37\", \"wk38\", \"wk39\", \"wk40\", \"wk41\", \"wk42\", \"wk43\", \"wk44\", \"wk45\", \"wk46\", \"wk47\", \"wk48\", \"wk49\", \"wk50\", \"wk51\", \"wk52\", \"wk53\", \"wk54\", \"wk55\", \"wk56\", \"wk57\", \"wk58\", \"wk59\", \"wk60\", \"wk61\", \"wk62\", \"wk63\", \"wk64\", \"wk65\", \"wk66\", \"wk67\", \"wk68\", \"wk69\", \"wk70\", \"wk71\", \"wk72\", \"wk73\", \"wk74\", \"wk75\", \"wk76\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n artist = \"character\",\n track = \"character\",\n date.entered = \"Date\",\n wk1 = \"numeric\",\n wk2 = \"numeric\",\n wk3 = \"numeric\",\n wk4 = \"numeric\",\n wk5 = \"numeric\",\n wk6 = \"numeric\",\n wk7 = \"numeric\",\n wk8 = \"numeric\",\n wk9 = \"numeric\",\n wk10 = \"numeric\",\n wk11 = \"numeric\",\n wk12 = \"numeric\",\n wk13 = \"numeric\",\n wk14 = \"numeric\",\n wk15 = \"numeric\",\n wk16 = \"numeric\",\n wk17 = \"numeric\",\n wk18 = \"numeric\",\n wk19 = \"numeric\",\n wk20 = \"numeric\",\n wk21 = \"numeric\",\n wk22 = \"numeric\",\n wk23 = \"numeric\",\n wk24 = \"numeric\",\n wk25 = \"numeric\",\n wk26 = \"numeric\",\n wk27 = \"numeric\",\n wk28 = \"numeric\",\n wk29 = \"numeric\",\n wk30 = \"numeric\",\n wk31 = \"numeric\",\n wk32 = \"numeric\",\n wk33 = \"numeric\",\n wk34 = \"numeric\",\n wk35 = \"numeric\",\n wk36 = \"numeric\",\n wk37 = \"numeric\",\n wk38 = \"numeric\",\n wk39 = \"numeric\",\n wk40 = \"numeric\",\n wk41 = \"numeric\",\n wk42 = \"numeric\",\n wk43 = \"numeric\",\n wk44 = \"numeric\",\n wk45 = \"numeric\",\n wk46 = \"numeric\",\n wk47 = \"numeric\",\n wk48 = \"numeric\",\n wk49 = \"numeric\",\n wk50 = \"numeric\",\n wk51 = \"numeric\",\n wk52 = \"numeric\",\n wk53 = \"numeric\",\n wk54 = \"numeric\",\n wk55 = \"numeric\",\n wk56 = \"numeric\",\n wk57 = \"numeric\",\n wk58 = \"numeric\",\n wk59 = \"numeric\",\n wk60 = \"numeric\",\n wk61 = \"numeric\",\n wk62 = \"numeric\",\n wk63 = \"numeric\",\n wk64 = \"numeric\",\n wk65 = \"numeric\",\n wk66 = \"logical\",\n wk67 = \"logical\",\n wk68 = \"logical\",\n wk69 = \"logical\",\n wk70 = \"logical\",\n wk71 = \"logical\",\n wk72 = \"logical\",\n wk73 = \"logical\",\n wk74 = \"logical\",\n wk75 = \"logical\",\n wk76 = \"logical\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `artist` is of type: character\n col_is_character(\n columns = c(\"artist\")\n ) %>%\n # Expect that column `track` is of type: character\n col_is_character(\n columns = c(\"track\")\n ) %>%\n # Expect that column `wk1` is of type: numeric\n col_is_numeric(\n columns = c(\"wk1\")\n ) %>%\n # Expect that values in `wk1` should be between `15` and `100`\n col_vals_between(\n columns = c(\"wk1\"),\n left = 15,\n right = 100\n ) %>%\n # Expect that column `wk2` is of type: numeric\n col_is_numeric(\n columns = c(\"wk2\")\n ) %>%\n # Expect that values in `wk2` should be between `8` and `100`\n col_vals_between(\n columns = c(\"wk2\"),\n left = 8,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk3` is of type: numeric\n col_is_numeric(\n columns = c(\"wk3\")\n ) %>%\n # Expect that values in `wk3` should be between `6` and `100`\n col_vals_between(\n columns = c(\"wk3\"),\n left = 6,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk4` is of type: numeric\n col_is_numeric(\n columns = c(\"wk4\")\n ) %>%\n # Expect that values in `wk4` should be between `5` and `100`\n col_vals_between(\n columns = c(\"wk4\"),\n left = 5,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk5` is of type: numeric\n col_is_numeric(\n columns = c(\"wk5\")\n ) %>%\n # Expect that values in `wk5` should be between `2` and `100`\n col_vals_between(\n columns = c(\"wk5\"),\n left = 2,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk6` is of type: numeric\n col_is_numeric(\n columns = c(\"wk6\")\n ) %>%\n # Expect that values in `wk6` should be between `1` and `99`\n col_vals_between(\n columns = c(\"wk6\"),\n left = 1,\n right = 99,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk7` is of type: numeric\n col_is_numeric(\n columns = c(\"wk7\")\n ) %>%\n # Expect that values in `wk7` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk7\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk8` is of type: numeric\n col_is_numeric(\n columns = c(\"wk8\")\n ) %>%\n # Expect that values in `wk8` should be between `1` and `99`\n col_vals_between(\n columns = c(\"wk8\"),\n left = 1,\n right = 99,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk9` is of type: numeric\n col_is_numeric(\n columns = c(\"wk9\")\n ) %>%\n # Expect that values in `wk9` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk9\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk10` is of type: numeric\n col_is_numeric(\n columns = c(\"wk10\")\n ) %>%\n # Expect that values in `wk10` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk10\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk11` is of type: numeric\n col_is_numeric(\n columns = c(\"wk11\")\n ) %>%\n # Expect that values in `wk11` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk11\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk12` is of type: numeric\n col_is_numeric(\n columns = c(\"wk12\")\n ) %>%\n # Expect that values in `wk12` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk12\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk13` is of type: numeric\n col_is_numeric(\n columns = c(\"wk13\")\n ) %>%\n # Expect that values in `wk13` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk13\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk14` is of type: numeric\n col_is_numeric(\n columns = c(\"wk14\")\n ) %>%\n # Expect that values in `wk14` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk14\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk15` is of type: numeric\n col_is_numeric(\n columns = c(\"wk15\")\n ) %>%\n # Expect that values in `wk15` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk15\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk16` is of type: numeric\n col_is_numeric(\n columns = c(\"wk16\")\n ) %>%\n # Expect that values in `wk16` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk16\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk17` is of type: numeric\n col_is_numeric(\n columns = c(\"wk17\")\n ) %>%\n # Expect that values in `wk17` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk17\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk18` is of type: numeric\n col_is_numeric(\n columns = c(\"wk18\")\n ) %>%\n # Expect that values in `wk18` should be between `1` and `100`\n col_vals_between(\n columns = c(\"wk18\"),\n left = 1,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk19` is of type: numeric\n col_is_numeric(\n columns = c(\"wk19\")\n ) %>%\n # Expect that values in `wk19` should be between `1` and `99`\n col_vals_between(\n columns = c(\"wk19\"),\n left = 1,\n right = 99,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk20` is of type: numeric\n col_is_numeric(\n columns = c(\"wk20\")\n ) %>%\n # Expect that values in `wk20` should be between `2` and `100`\n col_vals_between(\n columns = c(\"wk20\"),\n left = 2,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk21` is of type: numeric\n col_is_numeric(\n columns = c(\"wk21\")\n ) %>%\n # Expect that values in `wk21` should be between `3` and `97`\n col_vals_between(\n columns = c(\"wk21\"),\n left = 3,\n right = 97,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk22` is of type: numeric\n col_is_numeric(\n columns = c(\"wk22\")\n ) %>%\n # Expect that values in `wk22` should be between `3` and `100`\n col_vals_between(\n columns = c(\"wk22\"),\n left = 3,\n right = 100,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk23` is of type: numeric\n col_is_numeric(\n columns = c(\"wk23\")\n ) %>%\n # Expect that values in `wk23` should be between `3` and `91`\n col_vals_between(\n columns = c(\"wk23\"),\n left = 3,\n right = 91,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk24` is of type: numeric\n col_is_numeric(\n columns = c(\"wk24\")\n ) %>%\n # Expect that values in `wk24` should be between `3` and `91`\n col_vals_between(\n columns = c(\"wk24\"),\n left = 3,\n right = 91,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk25` is of type: numeric\n col_is_numeric(\n columns = c(\"wk25\")\n ) %>%\n # Expect that values in `wk25` should be between `2` and `90`\n col_vals_between(\n columns = c(\"wk25\"),\n left = 2,\n right = 90,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk26` is of type: numeric\n col_is_numeric(\n columns = c(\"wk26\")\n ) %>%\n # Expect that values in `wk26` should be between `1` and `89`\n col_vals_between(\n columns = c(\"wk26\"),\n left = 1,\n right = 89,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk27` is of type: numeric\n col_is_numeric(\n columns = c(\"wk27\")\n ) %>%\n # Expect that values in `wk27` should be between `1` and `86`\n col_vals_between(\n columns = c(\"wk27\"),\n left = 1,\n right = 86,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk28` is of type: numeric\n col_is_numeric(\n columns = c(\"wk28\")\n ) %>%\n # Expect that values in `wk28` should be between `2` and `58`\n col_vals_between(\n columns = c(\"wk28\"),\n left = 2,\n right = 58,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk29` is of type: numeric\n col_is_numeric(\n columns = c(\"wk29\")\n ) %>%\n # Expect that values in `wk29` should be between `2` and `49`\n col_vals_between(\n columns = c(\"wk29\"),\n left = 2,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk30` is of type: numeric\n col_is_numeric(\n columns = c(\"wk30\")\n ) %>%\n # Expect that values in `wk30` should be between `2` and `45`\n col_vals_between(\n columns = c(\"wk30\"),\n left = 2,\n right = 45,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk31` is of type: numeric\n col_is_numeric(\n columns = c(\"wk31\")\n ) %>%\n # Expect that values in `wk31` should be between `3` and `49`\n col_vals_between(\n columns = c(\"wk31\"),\n left = 3,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk32` is of type: numeric\n col_is_numeric(\n columns = c(\"wk32\")\n ) %>%\n # Expect that values in `wk32` should be between `3` and `47`\n col_vals_between(\n columns = c(\"wk32\"),\n left = 3,\n right = 47,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk33` is of type: numeric\n col_is_numeric(\n columns = c(\"wk33\")\n ) %>%\n # Expect that values in `wk33` should be between `2` and `50`\n col_vals_between(\n columns = c(\"wk33\"),\n left = 2,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk34` is of type: numeric\n col_is_numeric(\n columns = c(\"wk34\")\n ) %>%\n # Expect that values in `wk34` should be between `3` and `49`\n col_vals_between(\n columns = c(\"wk34\"),\n left = 3,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk35` is of type: numeric\n col_is_numeric(\n columns = c(\"wk35\")\n ) %>%\n # Expect that values in `wk35` should be between `4` and `34`\n col_vals_between(\n columns = c(\"wk35\"),\n left = 4,\n right = 34,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk36` is of type: numeric\n col_is_numeric(\n columns = c(\"wk36\")\n ) %>%\n # Expect that values in `wk36` should be between `5` and `41`\n col_vals_between(\n columns = c(\"wk36\"),\n left = 5,\n right = 41,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk37` is of type: numeric\n col_is_numeric(\n columns = c(\"wk37\")\n ) %>%\n # Expect that values in `wk37` should be between `5` and `48`\n col_vals_between(\n columns = c(\"wk37\"),\n left = 5,\n right = 48,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk38` is of type: numeric\n col_is_numeric(\n columns = c(\"wk38\")\n ) %>%\n # Expect that values in `wk38` should be between `9` and `40`\n col_vals_between(\n columns = c(\"wk38\"),\n left = 9,\n right = 40,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk39` is of type: numeric\n col_is_numeric(\n columns = c(\"wk39\")\n ) %>%\n # Expect that values in `wk39` should be between `3` and `50`\n col_vals_between(\n columns = c(\"wk39\"),\n left = 3,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk40` is of type: numeric\n col_is_numeric(\n columns = c(\"wk40\")\n ) %>%\n # Expect that values in `wk40` should be between `1` and `47`\n col_vals_between(\n columns = c(\"wk40\"),\n left = 1,\n right = 47,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk41` is of type: numeric\n col_is_numeric(\n columns = c(\"wk41\")\n ) %>%\n # Expect that values in `wk41` should be between `1` and `50`\n col_vals_between(\n columns = c(\"wk41\"),\n left = 1,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk42` is of type: numeric\n col_is_numeric(\n columns = c(\"wk42\")\n ) %>%\n # Expect that values in `wk42` should be between `2` and `22`\n col_vals_between(\n columns = c(\"wk42\"),\n left = 2,\n right = 22,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk43` is of type: numeric\n col_is_numeric(\n columns = c(\"wk43\")\n ) %>%\n # Expect that values in `wk43` should be between `3` and `32`\n col_vals_between(\n columns = c(\"wk43\"),\n left = 3,\n right = 32,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk44` is of type: numeric\n col_is_numeric(\n columns = c(\"wk44\")\n ) %>%\n # Expect that values in `wk44` should be between `4` and `45`\n col_vals_between(\n columns = c(\"wk44\"),\n left = 4,\n right = 45,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk45` is of type: numeric\n col_is_numeric(\n columns = c(\"wk45\")\n ) %>%\n # Expect that values in `wk45` should be between `4` and `31`\n col_vals_between(\n columns = c(\"wk45\"),\n left = 4,\n right = 31,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk46` is of type: numeric\n col_is_numeric(\n columns = c(\"wk46\")\n ) %>%\n # Expect that values in `wk46` should be between `5` and `37`\n col_vals_between(\n columns = c(\"wk46\"),\n left = 5,\n right = 37,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk47` is of type: numeric\n col_is_numeric(\n columns = c(\"wk47\")\n ) %>%\n # Expect that values in `wk47` should be between `6` and `41`\n col_vals_between(\n columns = c(\"wk47\"),\n left = 6,\n right = 41,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk48` is of type: numeric\n col_is_numeric(\n columns = c(\"wk48\")\n ) %>%\n # Expect that values in `wk48` should be between `8` and `39`\n col_vals_between(\n columns = c(\"wk48\"),\n left = 8,\n right = 39,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk49` is of type: numeric\n col_is_numeric(\n columns = c(\"wk49\")\n ) %>%\n # Expect that values in `wk49` should be between `9` and `42`\n col_vals_between(\n columns = c(\"wk49\"),\n left = 9,\n right = 42,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk50` is of type: numeric\n col_is_numeric(\n columns = c(\"wk50\")\n ) %>%\n # Expect that values in `wk50` should be between `10` and `49`\n col_vals_between(\n columns = c(\"wk50\"),\n left = 10,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk51` is of type: numeric\n col_is_numeric(\n columns = c(\"wk51\")\n ) %>%\n # Expect that values in `wk51` should be between `12` and `49`\n col_vals_between(\n columns = c(\"wk51\"),\n left = 12,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk52` is of type: numeric\n col_is_numeric(\n columns = c(\"wk52\")\n ) %>%\n # Expect that values in `wk52` should be between `15` and `48`\n col_vals_between(\n columns = c(\"wk52\"),\n left = 15,\n right = 48,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk53` is of type: numeric\n col_is_numeric(\n columns = c(\"wk53\")\n ) %>%\n # Expect that values in `wk53` should be between `17` and `49`\n col_vals_between(\n columns = c(\"wk53\"),\n left = 17,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk54` is of type: numeric\n col_is_numeric(\n columns = c(\"wk54\")\n ) %>%\n # Expect that values in `wk54` should be between `17` and `22`\n col_vals_between(\n columns = c(\"wk54\"),\n left = 17,\n right = 22,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk55` is of type: numeric\n col_is_numeric(\n columns = c(\"wk55\")\n ) %>%\n # Expect that values in `wk55` should be between `21` and `22`\n col_vals_between(\n columns = c(\"wk55\"),\n left = 21,\n right = 22,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk56` is of type: numeric\n col_is_numeric(\n columns = c(\"wk56\")\n ) %>%\n # Expect that values in `wk56` should be between `25` and `26`\n col_vals_between(\n columns = c(\"wk56\"),\n left = 25,\n right = 26,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk57` is of type: numeric\n col_is_numeric(\n columns = c(\"wk57\")\n ) %>%\n # Expect that values in `wk57` should be between `26` and `29`\n col_vals_between(\n columns = c(\"wk57\"),\n left = 26,\n right = 29,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk58` is of type: numeric\n col_is_numeric(\n columns = c(\"wk58\")\n ) %>%\n # Expect that values in `wk58` should be between `31` and `32`\n col_vals_between(\n columns = c(\"wk58\"),\n left = 31,\n right = 32,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk59` is of type: numeric\n col_is_numeric(\n columns = c(\"wk59\")\n ) %>%\n # Expect that values in `wk59` should be between `32` and `39`\n col_vals_between(\n columns = c(\"wk59\"),\n left = 32,\n right = 39,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk60` is of type: numeric\n col_is_numeric(\n columns = c(\"wk60\")\n ) %>%\n # Expect that values in `wk60` should be between `37` and `39`\n col_vals_between(\n columns = c(\"wk60\"),\n left = 37,\n right = 39,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk61` is of type: numeric\n col_is_numeric(\n columns = c(\"wk61\")\n ) %>%\n # Expect that values in `wk61` should be between `42` and `43`\n col_vals_between(\n columns = c(\"wk61\"),\n left = 42,\n right = 43,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk62` is of type: numeric\n col_is_numeric(\n columns = c(\"wk62\")\n ) %>%\n # Expect that values in `wk62` should be between `42` and `47`\n col_vals_between(\n columns = c(\"wk62\"),\n left = 42,\n right = 47,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk63` is of type: numeric\n col_is_numeric(\n columns = c(\"wk63\")\n ) %>%\n # Expect that values in `wk63` should be between `45` and `50`\n col_vals_between(\n columns = c(\"wk63\"),\n left = 45,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk64` is of type: numeric\n col_is_numeric(\n columns = c(\"wk64\")\n ) %>%\n # Expect that values in `wk64` should be between `50` and `50`\n col_vals_between(\n columns = c(\"wk64\"),\n left = 50,\n right = 50,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk65` is of type: numeric\n col_is_numeric(\n columns = c(\"wk65\")\n ) %>%\n # Expect that values in `wk65` should be between `49` and `49`\n col_vals_between(\n columns = c(\"wk65\"),\n left = 49,\n right = 49,\n na_pass = TRUE\n ) %>%\n # Expect that column `wk66` is of type: logical\n col_is_logical(\n columns = c(\"wk66\")\n ) %>%\n # Expect that column `wk67` is of type: logical\n col_is_logical(\n columns = c(\"wk67\")\n ) %>%\n # Expect that column `wk68` is of type: logical\n col_is_logical(\n columns = c(\"wk68\")\n ) %>%\n # Expect that column `wk69` is of type: logical\n col_is_logical(\n columns = c(\"wk69\")\n ) %>%\n # Expect that column `wk70` is of type: logical\n col_is_logical(\n columns = c(\"wk70\")\n ) %>%\n # Expect that column `wk71` is of type: logical\n col_is_logical(\n columns = c(\"wk71\")\n ) %>%\n # Expect that column `wk72` is of type: logical\n col_is_logical(\n columns = c(\"wk72\")\n ) %>%\n # Expect that column `wk73` is of type: logical\n col_is_logical(\n columns = c(\"wk73\")\n ) %>%\n # Expect that column `wk74` is of type: logical\n col_is_logical(\n columns = c(\"wk74\")\n ) %>%\n # Expect that column `wk75` is of type: logical\n col_is_logical(\n columns = c(\"wk75\")\n ) %>%\n # Expect that column `wk76` is of type: logical\n col_is_logical(\n columns = c(\"wk76\")\n ) %>%\n # Expect entirely distinct rows across `artist, track, date.entered, wk1, wk2, wk3, wk4, wk5, wk6, wk7, wk8, wk9, wk10, wk11, wk12, wk13, wk14, wk15, wk16, wk17, wk18, wk19, wk20, wk21, wk22, wk23, wk24, wk25, wk26, wk27, wk28, wk29, wk30, wk31, wk32, wk33, wk34, wk35, wk36, wk37, wk38, wk39, wk40, wk41, wk42, wk43, wk44, wk45, wk46, wk47, wk48, wk49, wk50, wk51, wk52, wk53, wk54, wk55, wk56, wk57, wk58, wk59, wk60, wk61, wk62, wk63, wk64, wk65, wk66, wk67, wk68, wk69, wk70, wk71, wk72, wk73, wk74, wk75, wk76`\n rows_distinct(\n columns = c(\"artist\", \"track\", \"date.entered\", \"wk1\", \"wk2\", \"wk3\", \"wk4\", \"wk5\", \"wk6\", \"wk7\", \"wk8\", \"wk9\", \"wk10\", \"wk11\", \"wk12\", \"wk13\", \"wk14\", \"wk15\", \"wk16\", \"wk17\", \"wk18\", \"wk19\", \"wk20\", \"wk21\", \"wk22\", \"wk23\", \"wk24\", \"wk25\", \"wk26\", \"wk27\", \"wk28\", \"wk29\", \"wk30\", \"wk31\", \"wk32\", \"wk33\", \"wk34\", \"wk35\", \"wk36\", \"wk37\", \"wk38\", \"wk39\", \"wk40\", \"wk41\", \"wk42\", \"wk43\", \"wk44\", \"wk45\", \"wk46\", \"wk47\", \"wk48\", \"wk49\", \"wk50\", \"wk51\", \"wk52\", \"wk53\", \"wk54\", \"wk55\", \"wk56\", \"wk57\", \"wk58\", \"wk59\", \"wk60\", \"wk61\", \"wk62\", \"wk63\", \"wk64\", \"wk65\", \"wk66\", \"wk67\", \"wk68\", \"wk69\", \"wk70\", \"wk71\", \"wk72\", \"wk73\", \"wk74\", \"wk75\", \"wk76\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n artist = \"character\",\n track = \"character\",\n date.entered = \"Date\",\n wk1 = \"numeric\",\n wk2 = \"numeric\",\n wk3 = \"numeric\",\n wk4 = \"numeric\",\n wk5 = \"numeric\",\n wk6 = \"numeric\",\n wk7 = \"numeric\",\n wk8 = \"numeric\",\n wk9 = \"numeric\",\n wk10 = \"numeric\",\n wk11 = \"numeric\",\n wk12 = \"numeric\",\n wk13 = \"numeric\",\n wk14 = \"numeric\",\n wk15 = \"numeric\",\n wk16 = \"numeric\",\n wk17 = \"numeric\",\n wk18 = \"numeric\",\n wk19 = \"numeric\",\n wk20 = \"numeric\",\n wk21 = \"numeric\",\n wk22 = \"numeric\",\n wk23 = \"numeric\",\n wk24 = \"numeric\",\n wk25 = \"numeric\",\n wk26 = \"numeric\",\n wk27 = \"numeric\",\n wk28 = \"numeric\",\n wk29 = \"numeric\",\n wk30 = \"numeric\",\n wk31 = \"numeric\",\n wk32 = \"numeric\",\n wk33 = \"numeric\",\n wk34 = \"numeric\",\n wk35 = \"numeric\",\n wk36 = \"numeric\",\n wk37 = \"numeric\",\n wk38 = \"numeric\",\n wk39 = \"numeric\",\n wk40 = \"numeric\",\n wk41 = \"numeric\",\n wk42 = \"numeric\",\n wk43 = \"numeric\",\n wk44 = \"numeric\",\n wk45 = \"numeric\",\n wk46 = \"numeric\",\n wk47 = \"numeric\",\n wk48 = \"numeric\",\n wk49 = \"numeric\",\n wk50 = \"numeric\",\n wk51 = \"numeric\",\n wk52 = \"numeric\",\n wk53 = \"numeric\",\n wk54 = \"numeric\",\n wk55 = \"numeric\",\n wk56 = \"numeric\",\n wk57 = \"numeric\",\n wk58 = \"numeric\",\n wk59 = \"numeric\",\n wk60 = \"numeric\",\n wk61 = \"numeric\",\n wk62 = \"numeric\",\n wk63 = \"numeric\",\n wk64 = \"numeric\",\n wk65 = \"numeric\",\n wk66 = \"logical\",\n wk67 = \"logical\",\n wk68 = \"logical\",\n wk69 = \"logical\",\n wk70 = \"logical\",\n wk71 = \"logical\",\n wk72 = \"logical\",\n wk73 = \"logical\",\n wk74 = \"logical\",\n wk75 = \"logical\",\n wk76 = \"logical\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Year` is of type: numeric\n col_is_numeric(\n columns = c(\"Year\")\n ) %>%\n # Expect that values in `Year` should be between `2018` and `2018`\n col_vals_between(\n columns = c(\"Year\"),\n left = 2018,\n right = 2018\n ) %>%\n # Expect that column `Month` is of type: character\n col_is_character(\n columns = c(\"Month\")\n ) %>%\n # Expect that column `1 unit` is of type: numeric\n col_is_numeric(\n columns = c(\"1 unit\")\n ) %>%\n # Expect that values in `1 unit` should be between `797` and `939`\n col_vals_between(\n columns = c(\"1 unit\"),\n left = 797,\n right = 939\n ) %>%\n # Expect that column `2 to 4 units` is of type: logical\n col_is_logical(\n columns = c(\"2 to 4 units\")\n ) %>%\n # Expect that column `5 units or more` is of type: numeric\n col_is_numeric(\n columns = c(\"5 units or more\")\n ) %>%\n # Expect that values in `5 units or more` should be between `286` and `447`\n col_vals_between(\n columns = c(\"5 units or more\"),\n left = 286,\n right = 447\n ) %>%\n # Expect that column `Northeast` is of type: numeric\n col_is_numeric(\n columns = c(\"Northeast\")\n ) %>%\n # Expect that values in `Northeast` should be between `76` and `150`\n col_vals_between(\n columns = c(\"Northeast\"),\n left = 76,\n right = 150\n ) %>%\n # Expect that column `Midwest` is of type: numeric\n col_is_numeric(\n columns = c(\"Midwest\")\n ) %>%\n # Expect that values in `Midwest` should be between `154` and `205`\n col_vals_between(\n columns = c(\"Midwest\"),\n left = 154,\n right = 205\n ) %>%\n # Expect that column `South` is of type: numeric\n col_is_numeric(\n columns = c(\"South\")\n ) %>%\n # Expect that values in `South` should be between `560` and `673`\n col_vals_between(\n columns = c(\"South\"),\n left = 560,\n right = 673\n ) %>%\n # Expect that column `West` is of type: numeric\n col_is_numeric(\n columns = c(\"West\")\n ) %>%\n # Expect that values in `West` should be between `286` and `360`\n col_vals_between(\n columns = c(\"West\"),\n left = 286,\n right = 360\n ) %>%\n # Expect entirely distinct rows across `Year, Month, 1 unit, 2 to 4 units, 5 units or more, Northeast, Midwest, South, West`\n rows_distinct(\n columns = c(\"Year\", \"Month\", \"1 unit\", \"2 to 4 units\", \"5 units or more\", \"Northeast\", \"Midwest\", \"South\", \"West\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Year = \"numeric\",\n Month = \"character\",\n 1 unit = \"numeric\",\n 2 to 4 units = \"logical\",\n 5 units or more = \"numeric\",\n Northeast = \"numeric\",\n Midwest = \"numeric\",\n South = \"numeric\",\n West = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Year` is of type: numeric\n col_is_numeric(\n columns = c(\"Year\")\n ) %>%\n # Expect that values in `Year` should be between `2018` and `2018`\n col_vals_between(\n columns = c(\"Year\"),\n left = 2018,\n right = 2018\n ) %>%\n # Expect that column `Month` is of type: character\n col_is_character(\n columns = c(\"Month\")\n ) %>%\n # Expect that column `1 unit` is of type: numeric\n col_is_numeric(\n columns = c(\"1 unit\")\n ) %>%\n # Expect that values in `1 unit` should be between `797` and `939`\n col_vals_between(\n columns = c(\"1 unit\"),\n left = 797,\n right = 939\n ) %>%\n # Expect that column `2 to 4 units` is of type: logical\n col_is_logical(\n columns = c(\"2 to 4 units\")\n ) %>%\n # Expect that column `5 units or more` is of type: numeric\n col_is_numeric(\n columns = c(\"5 units or more\")\n ) %>%\n # Expect that values in `5 units or more` should be between `286` and `447`\n col_vals_between(\n columns = c(\"5 units or more\"),\n left = 286,\n right = 447\n ) %>%\n # Expect that column `Northeast` is of type: numeric\n col_is_numeric(\n columns = c(\"Northeast\")\n ) %>%\n # Expect that values in `Northeast` should be between `76` and `150`\n col_vals_between(\n columns = c(\"Northeast\"),\n left = 76,\n right = 150\n ) %>%\n # Expect that column `Midwest` is of type: numeric\n col_is_numeric(\n columns = c(\"Midwest\")\n ) %>%\n # Expect that values in `Midwest` should be between `154` and `205`\n col_vals_between(\n columns = c(\"Midwest\"),\n left = 154,\n right = 205\n ) %>%\n # Expect that column `South` is of type: numeric\n col_is_numeric(\n columns = c(\"South\")\n ) %>%\n # Expect that values in `South` should be between `560` and `673`\n col_vals_between(\n columns = c(\"South\"),\n left = 560,\n right = 673\n ) %>%\n # Expect that column `West` is of type: numeric\n col_is_numeric(\n columns = c(\"West\")\n ) %>%\n # Expect that values in `West` should be between `286` and `360`\n col_vals_between(\n columns = c(\"West\"),\n left = 286,\n right = 360\n ) %>%\n # Expect entirely distinct rows across `Year, Month, 1 unit, 2 to 4 units, 5 units or more, Northeast, Midwest, South, West`\n rows_distinct(\n columns = c(\"Year\", \"Month\", \"1 unit\", \"2 to 4 units\", \"5 units or more\", \"Northeast\", \"Midwest\", \"South\", \"West\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Year = \"numeric\",\n Month = \"character\",\n 1 unit = \"numeric\",\n 2 to 4 units = \"logical\",\n 5 units or more = \"numeric\",\n Northeast = \"numeric\",\n Midwest = \"numeric\",\n South = \"numeric\",\n West = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `fish` is of type: factor\n col_is_factor(\n columns = c(\"fish\")\n ) %>%\n # Expect that column `station` is of type: factor\n col_is_factor(\n columns = c(\"station\")\n ) %>%\n # Expect that column `seen` is of type: integer\n col_is_integer(\n columns = c(\"seen\")\n ) %>%\n # Expect that values in `seen` should be between `1` and `1`\n col_vals_between(\n columns = c(\"seen\"),\n left = 1,\n right = 1\n ) %>%\n # Expect entirely distinct rows across `fish, station, seen`\n rows_distinct(\n columns = c(\"fish\", \"station\", \"seen\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n fish = \"factor\",\n station = \"factor\",\n seen = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `fish` is of type: factor\n col_is_factor(\n columns = c(\"fish\")\n ) %>%\n # Expect that column `station` is of type: factor\n col_is_factor(\n columns = c(\"station\")\n ) %>%\n # Expect that column `seen` is of type: integer\n col_is_integer(\n columns = c(\"seen\")\n ) %>%\n # Expect that values in `seen` should be between `1` and `1`\n col_vals_between(\n columns = c(\"seen\"),\n left = 1,\n right = 1\n ) %>%\n # Expect entirely distinct rows across `fish, station, seen`\n rows_distinct(\n columns = c(\"fish\", \"station\", \"seen\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n fish = \"factor\",\n station = \"factor\",\n seen = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `religion` is of type: character\n col_is_character(\n columns = c(\"religion\")\n ) %>%\n # Expect that column `<$10k` is of type: numeric\n col_is_numeric(\n columns = c(\"<$10k\")\n ) %>%\n # Expect that values in `<$10k` should be between `1` and `575`\n col_vals_between(\n columns = c(\"<$10k\"),\n left = 1,\n right = 575\n ) %>%\n # Expect that column `$10-20k` is of type: numeric\n col_is_numeric(\n columns = c(\"$10-20k\")\n ) %>%\n # Expect that values in `$10-20k` should be between `2` and `869`\n col_vals_between(\n columns = c(\"$10-20k\"),\n left = 2,\n right = 869\n ) %>%\n # Expect that column `$20-30k` is of type: numeric\n col_is_numeric(\n columns = c(\"$20-30k\")\n ) %>%\n # Expect that values in `$20-30k` should be between `3` and `1064`\n col_vals_between(\n columns = c(\"$20-30k\"),\n left = 3,\n right = 1064\n ) %>%\n # Expect that column `$30-40k` is of type: numeric\n col_is_numeric(\n columns = c(\"$30-40k\")\n ) %>%\n # Expect that values in `$30-40k` should be between `4` and `982`\n col_vals_between(\n columns = c(\"$30-40k\"),\n left = 4,\n right = 982\n ) %>%\n # Expect that column `$40-50k` is of type: numeric\n col_is_numeric(\n columns = c(\"$40-50k\")\n ) %>%\n # Expect that values in `$40-50k` should be between `2` and `881`\n col_vals_between(\n columns = c(\"$40-50k\"),\n left = 2,\n right = 881\n ) %>%\n # Expect that column `$50-75k` is of type: numeric\n col_is_numeric(\n columns = c(\"$50-75k\")\n ) %>%\n # Expect that values in `$50-75k` should be between `7` and `1486`\n col_vals_between(\n columns = c(\"$50-75k\"),\n left = 7,\n right = 1486\n ) %>%\n # Expect that column `$75-100k` is of type: numeric\n col_is_numeric(\n columns = c(\"$75-100k\")\n ) %>%\n # Expect that values in `$75-100k` should be between `3` and `949`\n col_vals_between(\n columns = c(\"$75-100k\"),\n left = 3,\n right = 949\n ) %>%\n # Expect that column `$100-150k` is of type: numeric\n col_is_numeric(\n columns = c(\"$100-150k\")\n ) %>%\n # Expect that values in `$100-150k` should be between `4` and `792`\n col_vals_between(\n columns = c(\"$100-150k\"),\n left = 4,\n right = 792\n ) %>%\n # Expect that column `>150k` is of type: numeric\n col_is_numeric(\n columns = c(\">150k\")\n ) %>%\n # Expect that values in `>150k` should be between `4` and `634`\n col_vals_between(\n columns = c(\">150k\"),\n left = 4,\n right = 634\n ) %>%\n # Expect that column `Don't know/refused` is of type: numeric\n col_is_numeric(\n columns = c(\"Don't know/refused\")\n ) %>%\n # Expect that values in `Don't know/refused` should be between `8` and `1529`\n col_vals_between(\n columns = c(\"Don't know/refused\"),\n left = 8,\n right = 1529\n ) %>%\n # Expect entirely distinct rows across `religion, <$10k, $10-20k, $20-30k, $30-40k, $40-50k, $50-75k, $75-100k, $100-150k, >150k, Don't know/refused`\n rows_distinct(\n columns = c(\"religion\", \"<$10k\", \"$10-20k\", \"$20-30k\", \"$30-40k\", \"$40-50k\", \"$50-75k\", \"$75-100k\", \"$100-150k\", \">150k\", \"Don't know/refused\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n religion = \"character\",\n <$10k = \"numeric\",\n $10-20k = \"numeric\",\n $20-30k = \"numeric\",\n $30-40k = \"numeric\",\n $40-50k = \"numeric\",\n $50-75k = \"numeric\",\n $75-100k = \"numeric\",\n $100-150k = \"numeric\",\n >150k = \"numeric\",\n Don't know/refused = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `religion` is of type: character\n col_is_character(\n columns = c(\"religion\")\n ) %>%\n # Expect that column `<$10k` is of type: numeric\n col_is_numeric(\n columns = c(\"<$10k\")\n ) %>%\n # Expect that values in `<$10k` should be between `1` and `575`\n col_vals_between(\n columns = c(\"<$10k\"),\n left = 1,\n right = 575\n ) %>%\n # Expect that column `$10-20k` is of type: numeric\n col_is_numeric(\n columns = c(\"$10-20k\")\n ) %>%\n # Expect that values in `$10-20k` should be between `2` and `869`\n col_vals_between(\n columns = c(\"$10-20k\"),\n left = 2,\n right = 869\n ) %>%\n # Expect that column `$20-30k` is of type: numeric\n col_is_numeric(\n columns = c(\"$20-30k\")\n ) %>%\n # Expect that values in `$20-30k` should be between `3` and `1064`\n col_vals_between(\n columns = c(\"$20-30k\"),\n left = 3,\n right = 1064\n ) %>%\n # Expect that column `$30-40k` is of type: numeric\n col_is_numeric(\n columns = c(\"$30-40k\")\n ) %>%\n # Expect that values in `$30-40k` should be between `4` and `982`\n col_vals_between(\n columns = c(\"$30-40k\"),\n left = 4,\n right = 982\n ) %>%\n # Expect that column `$40-50k` is of type: numeric\n col_is_numeric(\n columns = c(\"$40-50k\")\n ) %>%\n # Expect that values in `$40-50k` should be between `2` and `881`\n col_vals_between(\n columns = c(\"$40-50k\"),\n left = 2,\n right = 881\n ) %>%\n # Expect that column `$50-75k` is of type: numeric\n col_is_numeric(\n columns = c(\"$50-75k\")\n ) %>%\n # Expect that values in `$50-75k` should be between `7` and `1486`\n col_vals_between(\n columns = c(\"$50-75k\"),\n left = 7,\n right = 1486\n ) %>%\n # Expect that column `$75-100k` is of type: numeric\n col_is_numeric(\n columns = c(\"$75-100k\")\n ) %>%\n # Expect that values in `$75-100k` should be between `3` and `949`\n col_vals_between(\n columns = c(\"$75-100k\"),\n left = 3,\n right = 949\n ) %>%\n # Expect that column `$100-150k` is of type: numeric\n col_is_numeric(\n columns = c(\"$100-150k\")\n ) %>%\n # Expect that values in `$100-150k` should be between `4` and `792`\n col_vals_between(\n columns = c(\"$100-150k\"),\n left = 4,\n right = 792\n ) %>%\n # Expect that column `>150k` is of type: numeric\n col_is_numeric(\n columns = c(\">150k\")\n ) %>%\n # Expect that values in `>150k` should be between `4` and `634`\n col_vals_between(\n columns = c(\">150k\"),\n left = 4,\n right = 634\n ) %>%\n # Expect that column `Don't know/refused` is of type: numeric\n col_is_numeric(\n columns = c(\"Don't know/refused\")\n ) %>%\n # Expect that values in `Don't know/refused` should be between `8` and `1529`\n col_vals_between(\n columns = c(\"Don't know/refused\"),\n left = 8,\n right = 1529\n ) %>%\n # Expect entirely distinct rows across `religion, <$10k, $10-20k, $20-30k, $30-40k, $40-50k, $50-75k, $75-100k, $100-150k, >150k, Don't know/refused`\n rows_distinct(\n columns = c(\"religion\", \"<$10k\", \"$10-20k\", \"$20-30k\", \"$30-40k\", \"$40-50k\", \"$50-75k\", \"$75-100k\", \"$100-150k\", \">150k\", \"Don't know/refused\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n religion = \"character\",\n <$10k = \"numeric\",\n $10-20k = \"numeric\",\n $20-30k = \"numeric\",\n $30-40k = \"numeric\",\n $40-50k = \"numeric\",\n $50-75k = \"numeric\",\n $75-100k = \"numeric\",\n $100-150k = \"numeric\",\n >150k = \"numeric\",\n Don't know/refused = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `subject` is of type: character\n col_is_character(\n columns = c(\"subject\")\n ) %>%\n # Expect that column `time` is of type: numeric\n col_is_numeric(\n columns = c(\"time\")\n ) %>%\n # Expect that values in `time` should be between `1` and `1`\n col_vals_between(\n columns = c(\"time\"),\n left = 1,\n right = 1\n ) %>%\n # Expect that column `age` is of type: numeric\n col_is_numeric(\n columns = c(\"age\")\n ) %>%\n # Expect that values in `age` should be between `33` and `33`\n col_vals_between(\n columns = c(\"age\"),\n left = 33,\n right = 33,\n na_pass = TRUE\n ) %>%\n # Expect that column `weight` is of type: numeric\n col_is_numeric(\n columns = c(\"weight\")\n ) %>%\n # Expect that values in `weight` should be between `90` and `90`\n col_vals_between(\n columns = c(\"weight\"),\n left = 90,\n right = 90,\n na_pass = TRUE\n ) %>%\n # Expect that column `height` is of type: numeric\n col_is_numeric(\n columns = c(\"height\")\n ) %>%\n # Expect that values in `height` should be between `1.54` and `1.87`\n col_vals_between(\n columns = c(\"height\"),\n left = 1.54,\n right = 1.87\n ) %>%\n # Expect entirely distinct rows across `subject, time, age, weight, height`\n rows_distinct(\n columns = c(\"subject\", \"time\", \"age\", \"weight\", \"height\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n subject = \"character\",\n time = \"numeric\",\n age = \"numeric\",\n weight = \"numeric\",\n height = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `subject` is of type: character\n col_is_character(\n columns = c(\"subject\")\n ) %>%\n # Expect that column `time` is of type: numeric\n col_is_numeric(\n columns = c(\"time\")\n ) %>%\n # Expect that values in `time` should be between `1` and `1`\n col_vals_between(\n columns = c(\"time\"),\n left = 1,\n right = 1\n ) %>%\n # Expect that column `age` is of type: numeric\n col_is_numeric(\n columns = c(\"age\")\n ) %>%\n # Expect that values in `age` should be between `33` and `33`\n col_vals_between(\n columns = c(\"age\"),\n left = 33,\n right = 33,\n na_pass = TRUE\n ) %>%\n # Expect that column `weight` is of type: numeric\n col_is_numeric(\n columns = c(\"weight\")\n ) %>%\n # Expect that values in `weight` should be between `90` and `90`\n col_vals_between(\n columns = c(\"weight\"),\n left = 90,\n right = 90,\n na_pass = TRUE\n ) %>%\n # Expect that column `height` is of type: numeric\n col_is_numeric(\n columns = c(\"height\")\n ) %>%\n # Expect that values in `height` should be between `1.54` and `1.87`\n col_vals_between(\n columns = c(\"height\"),\n left = 1.54,\n right = 1.87\n ) %>%\n # Expect entirely distinct rows across `subject, time, age, weight, height`\n rows_distinct(\n columns = c(\"subject\", \"time\", \"age\", \"weight\", \"height\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n subject = \"character\",\n time = \"numeric\",\n age = \"numeric\",\n weight = \"numeric\",\n height = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `GEOID` is of type: character\n col_is_character(\n columns = c(\"GEOID\")\n ) %>%\n # Expect that column `NAME` is of type: character\n col_is_character(\n columns = c(\"NAME\")\n ) %>%\n # Expect that column `variable` is of type: character\n col_is_character(\n columns = c(\"variable\")\n ) %>%\n # Expect that column `estimate` is of type: numeric\n col_is_numeric(\n columns = c(\"estimate\")\n ) %>%\n # Expect that values in `estimate` should be between `464` and `43198`\n col_vals_between(\n columns = c(\"estimate\"),\n left = 464,\n right = 43198,\n na_pass = TRUE\n ) %>%\n # Expect that column `moe` is of type: numeric\n col_is_numeric(\n columns = c(\"moe\")\n ) %>%\n # Expect that values in `moe` should be between `2` and `681`\n col_vals_between(\n columns = c(\"moe\"),\n left = 2,\n right = 681,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `GEOID, NAME, variable, estimate, moe`\n rows_distinct(\n columns = c(\"GEOID\", \"NAME\", \"variable\", \"estimate\", \"moe\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n GEOID = \"character\",\n NAME = \"character\",\n variable = \"character\",\n estimate = \"numeric\",\n moe = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `GEOID` is of type: character\n col_is_character(\n columns = c(\"GEOID\")\n ) %>%\n # Expect that column `NAME` is of type: character\n col_is_character(\n columns = c(\"NAME\")\n ) %>%\n # Expect that column `variable` is of type: character\n col_is_character(\n columns = c(\"variable\")\n ) %>%\n # Expect that column `estimate` is of type: numeric\n col_is_numeric(\n columns = c(\"estimate\")\n ) %>%\n # Expect that values in `estimate` should be between `464` and `43198`\n col_vals_between(\n columns = c(\"estimate\"),\n left = 464,\n right = 43198,\n na_pass = TRUE\n ) %>%\n # Expect that column `moe` is of type: numeric\n col_is_numeric(\n columns = c(\"moe\")\n ) %>%\n # Expect that values in `moe` should be between `2` and `681`\n col_vals_between(\n columns = c(\"moe\"),\n left = 2,\n right = 681,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `GEOID, NAME, variable, estimate, moe`\n rows_distinct(\n columns = c(\"GEOID\", \"NAME\", \"variable\", \"estimate\", \"moe\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n GEOID = \"character\",\n NAME = \"character\",\n variable = \"character\",\n estimate = \"numeric\",\n moe = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `country` is of type: character\n col_is_character(\n columns = c(\"country\")\n ) %>%\n # Expect that column `indicator` is of type: character\n col_is_character(\n columns = c(\"indicator\")\n ) %>%\n # Expect that column `2000` is of type: numeric\n col_is_numeric(\n columns = c(\"2000\")\n ) %>%\n # Expect that values in `2000` should be between `-4.07538613162288` and `6144322697`\n col_vals_between(\n columns = c(\"2000\"),\n left = -4.0753861,\n right = 6144322700,\n na_pass = TRUE\n ) %>%\n # Expect that column `2001` is of type: numeric\n col_is_numeric(\n columns = c(\"2001\")\n ) %>%\n # Expect that values in `2001` should be between `-3.8476707266781` and `6226339538`\n col_vals_between(\n columns = c(\"2001\"),\n left = -3.8476707,\n right = 6226339500,\n na_pass = TRUE\n ) %>%\n # Expect that column `2002` is of type: numeric\n col_is_numeric(\n columns = c(\"2002\")\n ) %>%\n # Expect that values in `2002` should be between `-3.5058941109977` and `6308092739`\n col_vals_between(\n columns = c(\"2002\"),\n left = -3.5058941,\n right = 6308092700,\n na_pass = TRUE\n ) %>%\n # Expect that column `2003` is of type: numeric\n col_is_numeric(\n columns = c(\"2003\")\n ) %>%\n # Expect that values in `2003` should be between `-3.55055571718435` and `6389383352`\n col_vals_between(\n columns = c(\"2003\"),\n left = -3.5505557,\n right = 6389383400,\n na_pass = TRUE\n ) %>%\n # Expect that column `2004` is of type: numeric\n col_is_numeric(\n columns = c(\"2004\")\n ) %>%\n # Expect that values in `2004` should be between `-3.72003227551706` and `6470821068`\n col_vals_between(\n columns = c(\"2004\"),\n left = -3.7200323,\n right = 6470821100,\n na_pass = TRUE\n ) %>%\n # Expect that column `2005` is of type: numeric\n col_is_numeric(\n columns = c(\"2005\")\n ) %>%\n # Expect that values in `2005` should be between `-4.07796901122163` and `6552571570`\n col_vals_between(\n columns = c(\"2005\"),\n left = -4.077969,\n right = 6552571600,\n na_pass = TRUE\n ) %>%\n # Expect that column `2006` is of type: numeric\n col_is_numeric(\n columns = c(\"2006\")\n ) %>%\n # Expect that values in `2006` should be between `-4.39053378535746` and `6634935638`\n col_vals_between(\n columns = c(\"2006\"),\n left = -4.3905338,\n right = 6634935600,\n na_pass = TRUE\n ) %>%\n # Expect that column `2007` is of type: numeric\n col_is_numeric(\n columns = c(\"2007\")\n ) %>%\n # Expect that values in `2007` should be between `-4.66353575517151` and `6717641730`\n col_vals_between(\n columns = c(\"2007\"),\n left = -4.6635358,\n right = 6717641700,\n na_pass = TRUE\n ) %>%\n # Expect that column `2008` is of type: numeric\n col_is_numeric(\n columns = c(\"2008\")\n ) %>%\n # Expect that values in `2008` should be between `-4.90503090271691` and `6801408360`\n col_vals_between(\n columns = c(\"2008\"),\n left = -4.9050309,\n right = 6801408400,\n na_pass = TRUE\n ) %>%\n # Expect that column `2009` is of type: numeric\n col_is_numeric(\n columns = c(\"2009\")\n ) %>%\n # Expect that values in `2009` should be between `-5.08445117030295` and `6885490816`\n col_vals_between(\n columns = c(\"2009\"),\n left = -5.0844512,\n right = 6885490800,\n na_pass = TRUE\n ) %>%\n # Expect that column `2010` is of type: numeric\n col_is_numeric(\n columns = c(\"2010\")\n ) %>%\n # Expect that values in `2010` should be between `-5.34393804525569` and `6969631901`\n col_vals_between(\n columns = c(\"2010\"),\n left = -5.343938,\n right = 6969631900,\n na_pass = TRUE\n ) %>%\n # Expect that column `2011` is of type: numeric\n col_is_numeric(\n columns = c(\"2011\")\n ) %>%\n # Expect that values in `2011` should be between `-4.79355371289299` and `7053533350`\n col_vals_between(\n columns = c(\"2011\"),\n left = -4.7935537,\n right = 7053533400,\n na_pass = TRUE\n ) %>%\n # Expect that column `2012` is of type: numeric\n col_is_numeric(\n columns = c(\"2012\")\n ) %>%\n # Expect that values in `2012` should be between `-5.28007770057696` and `7140895722`\n col_vals_between(\n columns = c(\"2012\"),\n left = -5.2800777,\n right = 7140895700,\n na_pass = TRUE\n ) %>%\n # Expect that column `2013` is of type: numeric\n col_is_numeric(\n columns = c(\"2013\")\n ) %>%\n # Expect that values in `2013` should be between `-6.96818698489862` and `7229184551`\n col_vals_between(\n columns = c(\"2013\"),\n left = -6.968187,\n right = 7229184600,\n na_pass = TRUE\n ) %>%\n # Expect that column `2014` is of type: numeric\n col_is_numeric(\n columns = c(\"2014\")\n ) %>%\n # Expect that values in `2014` should be between `-8.83048301221807` and `7317508753`\n col_vals_between(\n columns = c(\"2014\"),\n left = -8.830483,\n right = 7317508800,\n na_pass = TRUE\n ) %>%\n # Expect that column `2015` is of type: numeric\n col_is_numeric(\n columns = c(\"2015\")\n ) %>%\n # Expect that values in `2015` should be between `-4.41574372125213` and `7404910892`\n col_vals_between(\n columns = c(\"2015\"),\n left = -4.4157437,\n right = 7404910900,\n na_pass = TRUE\n ) %>%\n # Expect that column `2016` is of type: numeric\n col_is_numeric(\n columns = c(\"2016\")\n ) %>%\n # Expect that values in `2016` should be between `-2.2172797902348` and `7491934113`\n col_vals_between(\n columns = c(\"2016\"),\n left = -2.2172798,\n right = 7491934100,\n na_pass = TRUE\n ) %>%\n # Expect that column `2017` is of type: numeric\n col_is_numeric(\n columns = c(\"2017\")\n ) %>%\n # Expect that values in `2017` should be between `-3.75548445756917` and `7578157615`\n col_vals_between(\n columns = c(\"2017\"),\n left = -3.7554845,\n right = 7578157600,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `country, indicator, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017`\n rows_distinct(\n columns = c(\"country\", \"indicator\", \"2000\", \"2001\", \"2002\", \"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\", \"2010\", \"2011\", \"2012\", \"2013\", \"2014\", \"2015\", \"2016\", \"2017\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n country = \"character\",\n indicator = \"character\",\n 2000 = \"numeric\",\n 2001 = \"numeric\",\n 2002 = \"numeric\",\n 2003 = \"numeric\",\n 2004 = \"numeric\",\n 2005 = \"numeric\",\n 2006 = \"numeric\",\n 2007 = \"numeric\",\n 2008 = \"numeric\",\n 2009 = \"numeric\",\n 2010 = \"numeric\",\n 2011 = \"numeric\",\n 2012 = \"numeric\",\n 2013 = \"numeric\",\n 2014 = \"numeric\",\n 2015 = \"numeric\",\n 2016 = \"numeric\",\n 2017 = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `country` is of type: character\n col_is_character(\n columns = c(\"country\")\n ) %>%\n # Expect that column `indicator` is of type: character\n col_is_character(\n columns = c(\"indicator\")\n ) %>%\n # Expect that column `2000` is of type: numeric\n col_is_numeric(\n columns = c(\"2000\")\n ) %>%\n # Expect that values in `2000` should be between `-4.07538613162288` and `6144322697`\n col_vals_between(\n columns = c(\"2000\"),\n left = -4.0753861,\n right = 6144322700,\n na_pass = TRUE\n ) %>%\n # Expect that column `2001` is of type: numeric\n col_is_numeric(\n columns = c(\"2001\")\n ) %>%\n # Expect that values in `2001` should be between `-3.8476707266781` and `6226339538`\n col_vals_between(\n columns = c(\"2001\"),\n left = -3.8476707,\n right = 6226339500,\n na_pass = TRUE\n ) %>%\n # Expect that column `2002` is of type: numeric\n col_is_numeric(\n columns = c(\"2002\")\n ) %>%\n # Expect that values in `2002` should be between `-3.5058941109977` and `6308092739`\n col_vals_between(\n columns = c(\"2002\"),\n left = -3.5058941,\n right = 6308092700,\n na_pass = TRUE\n ) %>%\n # Expect that column `2003` is of type: numeric\n col_is_numeric(\n columns = c(\"2003\")\n ) %>%\n # Expect that values in `2003` should be between `-3.55055571718435` and `6389383352`\n col_vals_between(\n columns = c(\"2003\"),\n left = -3.5505557,\n right = 6389383400,\n na_pass = TRUE\n ) %>%\n # Expect that column `2004` is of type: numeric\n col_is_numeric(\n columns = c(\"2004\")\n ) %>%\n # Expect that values in `2004` should be between `-3.72003227551706` and `6470821068`\n col_vals_between(\n columns = c(\"2004\"),\n left = -3.7200323,\n right = 6470821100,\n na_pass = TRUE\n ) %>%\n # Expect that column `2005` is of type: numeric\n col_is_numeric(\n columns = c(\"2005\")\n ) %>%\n # Expect that values in `2005` should be between `-4.07796901122163` and `6552571570`\n col_vals_between(\n columns = c(\"2005\"),\n left = -4.077969,\n right = 6552571600,\n na_pass = TRUE\n ) %>%\n # Expect that column `2006` is of type: numeric\n col_is_numeric(\n columns = c(\"2006\")\n ) %>%\n # Expect that values in `2006` should be between `-4.39053378535746` and `6634935638`\n col_vals_between(\n columns = c(\"2006\"),\n left = -4.3905338,\n right = 6634935600,\n na_pass = TRUE\n ) %>%\n # Expect that column `2007` is of type: numeric\n col_is_numeric(\n columns = c(\"2007\")\n ) %>%\n # Expect that values in `2007` should be between `-4.66353575517151` and `6717641730`\n col_vals_between(\n columns = c(\"2007\"),\n left = -4.6635358,\n right = 6717641700,\n na_pass = TRUE\n ) %>%\n # Expect that column `2008` is of type: numeric\n col_is_numeric(\n columns = c(\"2008\")\n ) %>%\n # Expect that values in `2008` should be between `-4.90503090271691` and `6801408360`\n col_vals_between(\n columns = c(\"2008\"),\n left = -4.9050309,\n right = 6801408400,\n na_pass = TRUE\n ) %>%\n # Expect that column `2009` is of type: numeric\n col_is_numeric(\n columns = c(\"2009\")\n ) %>%\n # Expect that values in `2009` should be between `-5.08445117030295` and `6885490816`\n col_vals_between(\n columns = c(\"2009\"),\n left = -5.0844512,\n right = 6885490800,\n na_pass = TRUE\n ) %>%\n # Expect that column `2010` is of type: numeric\n col_is_numeric(\n columns = c(\"2010\")\n ) %>%\n # Expect that values in `2010` should be between `-5.34393804525569` and `6969631901`\n col_vals_between(\n columns = c(\"2010\"),\n left = -5.343938,\n right = 6969631900,\n na_pass = TRUE\n ) %>%\n # Expect that column `2011` is of type: numeric\n col_is_numeric(\n columns = c(\"2011\")\n ) %>%\n # Expect that values in `2011` should be between `-4.79355371289299` and `7053533350`\n col_vals_between(\n columns = c(\"2011\"),\n left = -4.7935537,\n right = 7053533400,\n na_pass = TRUE\n ) %>%\n # Expect that column `2012` is of type: numeric\n col_is_numeric(\n columns = c(\"2012\")\n ) %>%\n # Expect that values in `2012` should be between `-5.28007770057696` and `7140895722`\n col_vals_between(\n columns = c(\"2012\"),\n left = -5.2800777,\n right = 7140895700,\n na_pass = TRUE\n ) %>%\n # Expect that column `2013` is of type: numeric\n col_is_numeric(\n columns = c(\"2013\")\n ) %>%\n # Expect that values in `2013` should be between `-6.96818698489862` and `7229184551`\n col_vals_between(\n columns = c(\"2013\"),\n left = -6.968187,\n right = 7229184600,\n na_pass = TRUE\n ) %>%\n # Expect that column `2014` is of type: numeric\n col_is_numeric(\n columns = c(\"2014\")\n ) %>%\n # Expect that values in `2014` should be between `-8.83048301221807` and `7317508753`\n col_vals_between(\n columns = c(\"2014\"),\n left = -8.830483,\n right = 7317508800,\n na_pass = TRUE\n ) %>%\n # Expect that column `2015` is of type: numeric\n col_is_numeric(\n columns = c(\"2015\")\n ) %>%\n # Expect that values in `2015` should be between `-4.41574372125213` and `7404910892`\n col_vals_between(\n columns = c(\"2015\"),\n left = -4.4157437,\n right = 7404910900,\n na_pass = TRUE\n ) %>%\n # Expect that column `2016` is of type: numeric\n col_is_numeric(\n columns = c(\"2016\")\n ) %>%\n # Expect that values in `2016` should be between `-2.2172797902348` and `7491934113`\n col_vals_between(\n columns = c(\"2016\"),\n left = -2.2172798,\n right = 7491934100,\n na_pass = TRUE\n ) %>%\n # Expect that column `2017` is of type: numeric\n col_is_numeric(\n columns = c(\"2017\")\n ) %>%\n # Expect that values in `2017` should be between `-3.75548445756917` and `7578157615`\n col_vals_between(\n columns = c(\"2017\"),\n left = -3.7554845,\n right = 7578157600,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `country, indicator, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017`\n rows_distinct(\n columns = c(\"country\", \"indicator\", \"2000\", \"2001\", \"2002\", \"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\", \"2010\", \"2011\", \"2012\", \"2013\", \"2014\", \"2015\", \"2016\", \"2017\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n country = \"character\",\n indicator = \"character\",\n 2000 = \"numeric\",\n 2001 = \"numeric\",\n 2002 = \"numeric\",\n 2003 = \"numeric\",\n 2004 = \"numeric\",\n 2005 = \"numeric\",\n 2006 = \"numeric\",\n 2007 = \"numeric\",\n 2008 = \"numeric\",\n 2009 = \"numeric\",\n 2010 = \"numeric\",\n 2011 = \"numeric\",\n 2012 = \"numeric\",\n 2013 = \"numeric\",\n 2014 = \"numeric\",\n 2015 = \"numeric\",\n 2016 = \"numeric\",\n 2017 = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `date` is of type: integer\n col_is_integer(\n columns = c(\"date\")\n ) %>%\n # Expect that values in `date` should be between `20081028` and `20090414`\n col_vals_between(\n columns = c(\"date\"),\n left = 20081028,\n right = 20090414\n ) %>%\n # Expect that column `opponent` is of type: character\n col_is_character(\n columns = c(\"opponent\")\n ) %>%\n # Expect that column `game_type` is of type: character\n col_is_character(\n columns = c(\"game_type\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `period` is of type: integer\n col_is_integer(\n columns = c(\"period\")\n ) %>%\n # Expect that values in `period` should be between `1` and `5`\n col_vals_between(\n columns = c(\"period\"),\n left = 1,\n right = 5\n ) %>%\n # Expect that column `etype` is of type: character\n col_is_character(\n columns = c(\"etype\")\n ) %>%\n # Expect that column `team` is of type: character\n col_is_character(\n columns = c(\"team\")\n ) %>%\n # Expect that column `player` is of type: character\n col_is_character(\n columns = c(\"player\")\n ) %>%\n # Expect that column `result` is of type: character\n col_is_character(\n columns = c(\"result\")\n ) %>%\n # Expect that column `points` is of type: integer\n col_is_integer(\n columns = c(\"points\")\n ) %>%\n # Expect that values in `points` should be between `0` and `3`\n col_vals_between(\n columns = c(\"points\"),\n left = 0,\n right = 3\n ) %>%\n # Expect that column `type` is of type: character\n col_is_character(\n columns = c(\"type\")\n ) %>%\n # Expect that column `x` is of type: integer\n col_is_integer(\n columns = c(\"x\")\n ) %>%\n # Expect that values in `x` should be between `0` and `51`\n col_vals_between(\n columns = c(\"x\"),\n left = 0,\n right = 51,\n na_pass = TRUE\n ) %>%\n # Expect that column `y` is of type: integer\n col_is_integer(\n columns = c(\"y\")\n ) %>%\n # Expect that values in `y` should be between `3` and `90`\n col_vals_between(\n columns = c(\"y\"),\n left = 3,\n right = 90,\n na_pass = TRUE\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date = \"integer\",\n opponent = \"character\",\n game_type = \"character\",\n time = \"character\",\n period = \"integer\",\n etype = \"character\",\n team = \"character\",\n player = \"character\",\n result = \"character\",\n points = \"integer\",\n type = \"character\",\n x = \"integer\",\n y = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `date` is of type: integer\n col_is_integer(\n columns = c(\"date\")\n ) %>%\n # Expect that values in `date` should be between `20081028` and `20090414`\n col_vals_between(\n columns = c(\"date\"),\n left = 20081028,\n right = 20090414\n ) %>%\n # Expect that column `opponent` is of type: character\n col_is_character(\n columns = c(\"opponent\")\n ) %>%\n # Expect that column `game_type` is of type: character\n col_is_character(\n columns = c(\"game_type\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `period` is of type: integer\n col_is_integer(\n columns = c(\"period\")\n ) %>%\n # Expect that values in `period` should be between `1` and `5`\n col_vals_between(\n columns = c(\"period\"),\n left = 1,\n right = 5\n ) %>%\n # Expect that column `etype` is of type: character\n col_is_character(\n columns = c(\"etype\")\n ) %>%\n # Expect that column `team` is of type: character\n col_is_character(\n columns = c(\"team\")\n ) %>%\n # Expect that column `player` is of type: character\n col_is_character(\n columns = c(\"player\")\n ) %>%\n # Expect that column `result` is of type: character\n col_is_character(\n columns = c(\"result\")\n ) %>%\n # Expect that column `points` is of type: integer\n col_is_integer(\n columns = c(\"points\")\n ) %>%\n # Expect that values in `points` should be between `0` and `3`\n col_vals_between(\n columns = c(\"points\"),\n left = 0,\n right = 3\n ) %>%\n # Expect that column `type` is of type: character\n col_is_character(\n columns = c(\"type\")\n ) %>%\n # Expect that column `x` is of type: integer\n col_is_integer(\n columns = c(\"x\")\n ) %>%\n # Expect that values in `x` should be between `0` and `51`\n col_vals_between(\n columns = c(\"x\"),\n left = 0,\n right = 51,\n na_pass = TRUE\n ) %>%\n # Expect that column `y` is of type: integer\n col_is_integer(\n columns = c(\"y\")\n ) %>%\n # Expect that values in `y` should be between `3` and `90`\n col_vals_between(\n columns = c(\"y\"),\n left = 3,\n right = 90,\n na_pass = TRUE\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date = \"integer\",\n opponent = \"character\",\n game_type = \"character\",\n time = \"character\",\n period = \"integer\",\n etype = \"character\",\n team = \"character\",\n player = \"character\",\n result = \"character\",\n points = \"integer\",\n type = \"character\",\n x = \"integer\",\n y = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Ozone` is of type: integer\n col_is_integer(\n columns = c(\"Ozone\")\n ) %>%\n # Expect that values in `Ozone` should be between `1` and `168`\n col_vals_between(\n columns = c(\"Ozone\"),\n left = 1,\n right = 168,\n na_pass = TRUE\n ) %>%\n # Expect that column `Solar.R` is of type: integer\n col_is_integer(\n columns = c(\"Solar.R\")\n ) %>%\n # Expect that values in `Solar.R` should be between `7` and `334`\n col_vals_between(\n columns = c(\"Solar.R\"),\n left = 7,\n right = 334,\n na_pass = TRUE\n ) %>%\n # Expect that column `Wind` is of type: numeric\n col_is_numeric(\n columns = c(\"Wind\")\n ) %>%\n # Expect that values in `Wind` should be between `1.7` and `20.7`\n col_vals_between(\n columns = c(\"Wind\"),\n left = 1.7,\n right = 20.7\n ) %>%\n # Expect that column `Temp` is of type: integer\n col_is_integer(\n columns = c(\"Temp\")\n ) %>%\n # Expect that values in `Temp` should be between `56` and `97`\n col_vals_between(\n columns = c(\"Temp\"),\n left = 56,\n right = 97\n ) %>%\n # Expect that column `Month` is of type: integer\n col_is_integer(\n columns = c(\"Month\")\n ) %>%\n # Expect that values in `Month` should be between `5` and `9`\n col_vals_between(\n columns = c(\"Month\"),\n left = 5,\n right = 9\n ) %>%\n # Expect that column `Day` is of type: integer\n col_is_integer(\n columns = c(\"Day\")\n ) %>%\n # Expect that values in `Day` should be between `1` and `31`\n col_vals_between(\n columns = c(\"Day\"),\n left = 1,\n right = 31\n ) %>%\n # Expect entirely distinct rows across `Ozone, Solar.R, Wind, Temp, Month, Day`\n rows_distinct(\n columns = c(\"Ozone\", \"Solar.R\", \"Wind\", \"Temp\", \"Month\", \"Day\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Ozone = \"integer\",\n Solar.R = \"integer\",\n Wind = \"numeric\",\n Temp = \"integer\",\n Month = \"integer\",\n Day = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Ozone` is of type: integer\n col_is_integer(\n columns = c(\"Ozone\")\n ) %>%\n # Expect that values in `Ozone` should be between `1` and `168`\n col_vals_between(\n columns = c(\"Ozone\"),\n left = 1,\n right = 168,\n na_pass = TRUE\n ) %>%\n # Expect that column `Solar.R` is of type: integer\n col_is_integer(\n columns = c(\"Solar.R\")\n ) %>%\n # Expect that values in `Solar.R` should be between `7` and `334`\n col_vals_between(\n columns = c(\"Solar.R\"),\n left = 7,\n right = 334,\n na_pass = TRUE\n ) %>%\n # Expect that column `Wind` is of type: numeric\n col_is_numeric(\n columns = c(\"Wind\")\n ) %>%\n # Expect that values in `Wind` should be between `1.7` and `20.7`\n col_vals_between(\n columns = c(\"Wind\"),\n left = 1.7,\n right = 20.7\n ) %>%\n # Expect that column `Temp` is of type: integer\n col_is_integer(\n columns = c(\"Temp\")\n ) %>%\n # Expect that values in `Temp` should be between `56` and `97`\n col_vals_between(\n columns = c(\"Temp\"),\n left = 56,\n right = 97\n ) %>%\n # Expect that column `Month` is of type: integer\n col_is_integer(\n columns = c(\"Month\")\n ) %>%\n # Expect that values in `Month` should be between `5` and `9`\n col_vals_between(\n columns = c(\"Month\"),\n left = 5,\n right = 9\n ) %>%\n # Expect that column `Day` is of type: integer\n col_is_integer(\n columns = c(\"Day\")\n ) %>%\n # Expect that values in `Day` should be between `1` and `31`\n col_vals_between(\n columns = c(\"Day\"),\n left = 1,\n right = 31\n ) %>%\n # Expect entirely distinct rows across `Ozone, Solar.R, Wind, Temp, Month, Day`\n rows_distinct(\n columns = c(\"Ozone\", \"Solar.R\", \"Wind\", \"Temp\", \"Month\", \"Day\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Ozone = \"integer\",\n Solar.R = \"integer\",\n Wind = \"numeric\",\n Temp = \"integer\",\n Month = \"integer\",\n Day = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `weight` is of type: numeric\n col_is_numeric(\n columns = c(\"weight\")\n ) %>%\n # Expect that values in `weight` should be between `108` and `423`\n col_vals_between(\n columns = c(\"weight\"),\n left = 108,\n right = 423\n ) %>%\n # Expect that column `feed` is of type: factor\n col_is_factor(\n columns = c(\"feed\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n weight = \"numeric\",\n feed = \"factor\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `weight` is of type: numeric\n col_is_numeric(\n columns = c(\"weight\")\n ) %>%\n # Expect that values in `weight` should be between `108` and `423`\n col_vals_between(\n columns = c(\"weight\"),\n left = 108,\n right = 423\n ) %>%\n # Expect that column `feed` is of type: factor\n col_is_factor(\n columns = c(\"feed\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n weight = \"numeric\",\n feed = \"factor\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Sepal.Length` is of type: numeric\n col_is_numeric(\n columns = c(\"Sepal.Length\")\n ) %>%\n # Expect that values in `Sepal.Length` should be between `4.3` and `7.9`\n col_vals_between(\n columns = c(\"Sepal.Length\"),\n left = 4.3,\n right = 7.9\n ) %>%\n # Expect that column `Sepal.Width` is of type: numeric\n col_is_numeric(\n columns = c(\"Sepal.Width\")\n ) %>%\n # Expect that values in `Sepal.Width` should be between `2` and `4.4`\n col_vals_between(\n columns = c(\"Sepal.Width\"),\n left = 2,\n right = 4.4\n ) %>%\n # Expect that column `Petal.Length` is of type: numeric\n col_is_numeric(\n columns = c(\"Petal.Length\")\n ) %>%\n # Expect that values in `Petal.Length` should be between `1` and `6.9`\n col_vals_between(\n columns = c(\"Petal.Length\"),\n left = 1,\n right = 6.9\n ) %>%\n # Expect that column `Petal.Width` is of type: numeric\n col_is_numeric(\n columns = c(\"Petal.Width\")\n ) %>%\n # Expect that values in `Petal.Width` should be between `0.1` and `2.5`\n col_vals_between(\n columns = c(\"Petal.Width\"),\n left = 0.1,\n right = 2.5\n ) %>%\n # Expect that column `Species` is of type: factor\n col_is_factor(\n columns = c(\"Species\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Sepal.Length = \"numeric\",\n Sepal.Width = \"numeric\",\n Petal.Length = \"numeric\",\n Petal.Width = \"numeric\",\n Species = \"factor\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Sepal.Length` is of type: numeric\n col_is_numeric(\n columns = c(\"Sepal.Length\")\n ) %>%\n # Expect that values in `Sepal.Length` should be between `4.3` and `7.9`\n col_vals_between(\n columns = c(\"Sepal.Length\"),\n left = 4.3,\n right = 7.9\n ) %>%\n # Expect that column `Sepal.Width` is of type: numeric\n col_is_numeric(\n columns = c(\"Sepal.Width\")\n ) %>%\n # Expect that values in `Sepal.Width` should be between `2` and `4.4`\n col_vals_between(\n columns = c(\"Sepal.Width\"),\n left = 2,\n right = 4.4\n ) %>%\n # Expect that column `Petal.Length` is of type: numeric\n col_is_numeric(\n columns = c(\"Petal.Length\")\n ) %>%\n # Expect that values in `Petal.Length` should be between `1` and `6.9`\n col_vals_between(\n columns = c(\"Petal.Length\"),\n left = 1,\n right = 6.9\n ) %>%\n # Expect that column `Petal.Width` is of type: numeric\n col_is_numeric(\n columns = c(\"Petal.Width\")\n ) %>%\n # Expect that values in `Petal.Width` should be between `0.1` and `2.5`\n col_vals_between(\n columns = c(\"Petal.Width\"),\n left = 0.1,\n right = 2.5\n ) %>%\n # Expect that column `Species` is of type: factor\n col_is_factor(\n columns = c(\"Species\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Sepal.Length = \"numeric\",\n Sepal.Width = \"numeric\",\n Petal.Length = \"numeric\",\n Petal.Width = \"numeric\",\n Species = \"factor\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `sr` is of type: numeric\n col_is_numeric(\n columns = c(\"sr\")\n ) %>%\n # Expect that values in `sr` should be between `0.6` and `21.1`\n col_vals_between(\n columns = c(\"sr\"),\n left = 0.6,\n right = 21.1\n ) %>%\n # Expect that column `pop15` is of type: numeric\n col_is_numeric(\n columns = c(\"pop15\")\n ) %>%\n # Expect that values in `pop15` should be between `21.44` and `47.64`\n col_vals_between(\n columns = c(\"pop15\"),\n left = 21.44,\n right = 47.64\n ) %>%\n # Expect that column `pop75` is of type: numeric\n col_is_numeric(\n columns = c(\"pop75\")\n ) %>%\n # Expect that values in `pop75` should be between `0.56` and `4.7`\n col_vals_between(\n columns = c(\"pop75\"),\n left = 0.56,\n right = 4.7\n ) %>%\n # Expect that column `dpi` is of type: numeric\n col_is_numeric(\n columns = c(\"dpi\")\n ) %>%\n # Expect that values in `dpi` should be between `88.94` and `4001.89`\n col_vals_between(\n columns = c(\"dpi\"),\n left = 88.94,\n right = 4001.89\n ) %>%\n # Expect that column `ddpi` is of type: numeric\n col_is_numeric(\n columns = c(\"ddpi\")\n ) %>%\n # Expect that values in `ddpi` should be between `0.22` and `16.71`\n col_vals_between(\n columns = c(\"ddpi\"),\n left = 0.22,\n right = 16.71\n ) %>%\n # Expect entirely distinct rows across `sr, pop15, pop75, dpi, ddpi`\n rows_distinct(\n columns = c(\"sr\", \"pop15\", \"pop75\", \"dpi\", \"ddpi\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n sr = \"numeric\",\n pop15 = \"numeric\",\n pop75 = \"numeric\",\n dpi = \"numeric\",\n ddpi = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `sr` is of type: numeric\n col_is_numeric(\n columns = c(\"sr\")\n ) %>%\n # Expect that values in `sr` should be between `0.6` and `21.1`\n col_vals_between(\n columns = c(\"sr\"),\n left = 0.6,\n right = 21.1\n ) %>%\n # Expect that column `pop15` is of type: numeric\n col_is_numeric(\n columns = c(\"pop15\")\n ) %>%\n # Expect that values in `pop15` should be between `21.44` and `47.64`\n col_vals_between(\n columns = c(\"pop15\"),\n left = 21.44,\n right = 47.64\n ) %>%\n # Expect that column `pop75` is of type: numeric\n col_is_numeric(\n columns = c(\"pop75\")\n ) %>%\n # Expect that values in `pop75` should be between `0.56` and `4.7`\n col_vals_between(\n columns = c(\"pop75\"),\n left = 0.56,\n right = 4.7\n ) %>%\n # Expect that column `dpi` is of type: numeric\n col_is_numeric(\n columns = c(\"dpi\")\n ) %>%\n # Expect that values in `dpi` should be between `88.94` and `4001.89`\n col_vals_between(\n columns = c(\"dpi\"),\n left = 88.94,\n right = 4001.89\n ) %>%\n # Expect that column `ddpi` is of type: numeric\n col_is_numeric(\n columns = c(\"ddpi\")\n ) %>%\n # Expect that values in `ddpi` should be between `0.22` and `16.71`\n col_vals_between(\n columns = c(\"ddpi\"),\n left = 0.22,\n right = 16.71\n ) %>%\n # Expect entirely distinct rows across `sr, pop15, pop75, dpi, ddpi`\n rows_distinct(\n columns = c(\"sr\", \"pop15\", \"pop75\", \"dpi\", \"ddpi\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n sr = \"numeric\",\n pop15 = \"numeric\",\n pop75 = \"numeric\",\n dpi = \"numeric\",\n ddpi = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `GNP.deflator` is of type: numeric\n col_is_numeric(\n columns = c(\"GNP.deflator\")\n ) %>%\n # Expect that values in `GNP.deflator` should be between `83` and `116.9`\n col_vals_between(\n columns = c(\"GNP.deflator\"),\n left = 83,\n right = 116.9\n ) %>%\n # Expect that column `GNP` is of type: numeric\n col_is_numeric(\n columns = c(\"GNP\")\n ) %>%\n # Expect that values in `GNP` should be between `234.289` and `554.894`\n col_vals_between(\n columns = c(\"GNP\"),\n left = 234.289,\n right = 554.894\n ) %>%\n # Expect that column `Unemployed` is of type: numeric\n col_is_numeric(\n columns = c(\"Unemployed\")\n ) %>%\n # Expect that values in `Unemployed` should be between `187` and `480.6`\n col_vals_between(\n columns = c(\"Unemployed\"),\n left = 187,\n right = 480.6\n ) %>%\n # Expect that column `Armed.Forces` is of type: numeric\n col_is_numeric(\n columns = c(\"Armed.Forces\")\n ) %>%\n # Expect that values in `Armed.Forces` should be between `145.6` and `359.4`\n col_vals_between(\n columns = c(\"Armed.Forces\"),\n left = 145.6,\n right = 359.4\n ) %>%\n # Expect that column `Population` is of type: numeric\n col_is_numeric(\n columns = c(\"Population\")\n ) %>%\n # Expect that values in `Population` should be between `107.608` and `130.081`\n col_vals_between(\n columns = c(\"Population\"),\n left = 107.608,\n right = 130.081\n ) %>%\n # Expect that column `Year` is of type: integer\n col_is_integer(\n columns = c(\"Year\")\n ) %>%\n # Expect that values in `Year` should be between `1947` and `1962`\n col_vals_between(\n columns = c(\"Year\"),\n left = 1947,\n right = 1962\n ) %>%\n # Expect that column `Employed` is of type: numeric\n col_is_numeric(\n columns = c(\"Employed\")\n ) %>%\n # Expect that values in `Employed` should be between `60.171` and `70.551`\n col_vals_between(\n columns = c(\"Employed\"),\n left = 60.171,\n right = 70.551\n ) %>%\n # Expect entirely distinct rows across `GNP.deflator, GNP, Unemployed, Armed.Forces, Population, Year, Employed`\n rows_distinct(\n columns = c(\"GNP.deflator\", \"GNP\", \"Unemployed\", \"Armed.Forces\", \"Population\", \"Year\", \"Employed\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n GNP.deflator = \"numeric\",\n GNP = \"numeric\",\n Unemployed = \"numeric\",\n Armed.Forces = \"numeric\",\n Population = \"numeric\",\n Year = \"integer\",\n Employed = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `GNP.deflator` is of type: numeric\n col_is_numeric(\n columns = c(\"GNP.deflator\")\n ) %>%\n # Expect that values in `GNP.deflator` should be between `83` and `116.9`\n col_vals_between(\n columns = c(\"GNP.deflator\"),\n left = 83,\n right = 116.9\n ) %>%\n # Expect that column `GNP` is of type: numeric\n col_is_numeric(\n columns = c(\"GNP\")\n ) %>%\n # Expect that values in `GNP` should be between `234.289` and `554.894`\n col_vals_between(\n columns = c(\"GNP\"),\n left = 234.289,\n right = 554.894\n ) %>%\n # Expect that column `Unemployed` is of type: numeric\n col_is_numeric(\n columns = c(\"Unemployed\")\n ) %>%\n # Expect that values in `Unemployed` should be between `187` and `480.6`\n col_vals_between(\n columns = c(\"Unemployed\"),\n left = 187,\n right = 480.6\n ) %>%\n # Expect that column `Armed.Forces` is of type: numeric\n col_is_numeric(\n columns = c(\"Armed.Forces\")\n ) %>%\n # Expect that values in `Armed.Forces` should be between `145.6` and `359.4`\n col_vals_between(\n columns = c(\"Armed.Forces\"),\n left = 145.6,\n right = 359.4\n ) %>%\n # Expect that column `Population` is of type: numeric\n col_is_numeric(\n columns = c(\"Population\")\n ) %>%\n # Expect that values in `Population` should be between `107.608` and `130.081`\n col_vals_between(\n columns = c(\"Population\"),\n left = 107.608,\n right = 130.081\n ) %>%\n # Expect that column `Year` is of type: integer\n col_is_integer(\n columns = c(\"Year\")\n ) %>%\n # Expect that values in `Year` should be between `1947` and `1962`\n col_vals_between(\n columns = c(\"Year\"),\n left = 1947,\n right = 1962\n ) %>%\n # Expect that column `Employed` is of type: numeric\n col_is_numeric(\n columns = c(\"Employed\")\n ) %>%\n # Expect that values in `Employed` should be between `60.171` and `70.551`\n col_vals_between(\n columns = c(\"Employed\"),\n left = 60.171,\n right = 70.551\n ) %>%\n # Expect entirely distinct rows across `GNP.deflator, GNP, Unemployed, Armed.Forces, Population, Year, Employed`\n rows_distinct(\n columns = c(\"GNP.deflator\", \"GNP\", \"Unemployed\", \"Armed.Forces\", \"Population\", \"Year\", \"Employed\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n GNP.deflator = \"numeric\",\n GNP = \"numeric\",\n Unemployed = \"numeric\",\n Armed.Forces = \"numeric\",\n Population = \"numeric\",\n Year = \"integer\",\n Employed = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Expt` is of type: integer\n col_is_integer(\n columns = c(\"Expt\")\n ) %>%\n # Expect that values in `Expt` should be between `1` and `5`\n col_vals_between(\n columns = c(\"Expt\"),\n left = 1,\n right = 5\n ) %>%\n # Expect that column `Run` is of type: integer\n col_is_integer(\n columns = c(\"Run\")\n ) %>%\n # Expect that values in `Run` should be between `1` and `20`\n col_vals_between(\n columns = c(\"Run\"),\n left = 1,\n right = 20\n ) %>%\n # Expect that column `Speed` is of type: integer\n col_is_integer(\n columns = c(\"Speed\")\n ) %>%\n # Expect that values in `Speed` should be between `620` and `1070`\n col_vals_between(\n columns = c(\"Speed\"),\n left = 620,\n right = 1070\n ) %>%\n # Expect entirely distinct rows across `Expt, Run, Speed`\n rows_distinct(\n columns = c(\"Expt\", \"Run\", \"Speed\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Expt = \"integer\",\n Run = \"integer\",\n Speed = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Expt` is of type: integer\n col_is_integer(\n columns = c(\"Expt\")\n ) %>%\n # Expect that values in `Expt` should be between `1` and `5`\n col_vals_between(\n columns = c(\"Expt\"),\n left = 1,\n right = 5\n ) %>%\n # Expect that column `Run` is of type: integer\n col_is_integer(\n columns = c(\"Run\")\n ) %>%\n # Expect that values in `Run` should be between `1` and `20`\n col_vals_between(\n columns = c(\"Run\"),\n left = 1,\n right = 20\n ) %>%\n # Expect that column `Speed` is of type: integer\n col_is_integer(\n columns = c(\"Speed\")\n ) %>%\n # Expect that values in `Speed` should be between `620` and `1070`\n col_vals_between(\n columns = c(\"Speed\"),\n left = 620,\n right = 1070\n ) %>%\n # Expect entirely distinct rows across `Expt, Run, Speed`\n rows_distinct(\n columns = c(\"Expt\", \"Run\", \"Speed\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Expt = \"integer\",\n Run = \"integer\",\n Speed = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `mpg` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg\")\n ) %>%\n # Expect that values in `mpg` should be between `10.4` and `33.9`\n col_vals_between(\n columns = c(\"mpg\"),\n left = 10.4,\n right = 33.9\n ) %>%\n # Expect that column `cyl` is of type: numeric\n col_is_numeric(\n columns = c(\"cyl\")\n ) %>%\n # Expect that values in `cyl` should be between `4` and `8`\n col_vals_between(\n columns = c(\"cyl\"),\n left = 4,\n right = 8\n ) %>%\n # Expect that column `disp` is of type: numeric\n col_is_numeric(\n columns = c(\"disp\")\n ) %>%\n # Expect that values in `disp` should be between `71.1` and `472`\n col_vals_between(\n columns = c(\"disp\"),\n left = 71.1,\n right = 472\n ) %>%\n # Expect that column `hp` is of type: numeric\n col_is_numeric(\n columns = c(\"hp\")\n ) %>%\n # Expect that values in `hp` should be between `52` and `335`\n col_vals_between(\n columns = c(\"hp\"),\n left = 52,\n right = 335\n ) %>%\n # Expect that column `drat` is of type: numeric\n col_is_numeric(\n columns = c(\"drat\")\n ) %>%\n # Expect that values in `drat` should be between `2.76` and `4.93`\n col_vals_between(\n columns = c(\"drat\"),\n left = 2.76,\n right = 4.93\n ) %>%\n # Expect that column `wt` is of type: numeric\n col_is_numeric(\n columns = c(\"wt\")\n ) %>%\n # Expect that values in `wt` should be between `1.513` and `5.424`\n col_vals_between(\n columns = c(\"wt\"),\n left = 1.513,\n right = 5.424\n ) %>%\n # Expect that column `qsec` is of type: numeric\n col_is_numeric(\n columns = c(\"qsec\")\n ) %>%\n # Expect that values in `qsec` should be between `14.5` and `22.9`\n col_vals_between(\n columns = c(\"qsec\"),\n left = 14.5,\n right = 22.9\n ) %>%\n # Expect that column `vs` is of type: numeric\n col_is_numeric(\n columns = c(\"vs\")\n ) %>%\n # Expect that values in `vs` should be between `0` and `1`\n col_vals_between(\n columns = c(\"vs\"),\n left = 0,\n right = 1\n ) %>%\n # Expect that column `am` is of type: numeric\n col_is_numeric(\n columns = c(\"am\")\n ) %>%\n # Expect that values in `am` should be between `0` and `1`\n col_vals_between(\n columns = c(\"am\"),\n left = 0,\n right = 1\n ) %>%\n # Expect that column `gear` is of type: numeric\n col_is_numeric(\n columns = c(\"gear\")\n ) %>%\n # Expect that values in `gear` should be between `3` and `5`\n col_vals_between(\n columns = c(\"gear\"),\n left = 3,\n right = 5\n ) %>%\n # Expect that column `carb` is of type: numeric\n col_is_numeric(\n columns = c(\"carb\")\n ) %>%\n # Expect that values in `carb` should be between `1` and `8`\n col_vals_between(\n columns = c(\"carb\"),\n left = 1,\n right = 8\n ) %>%\n # Expect entirely distinct rows across `mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb`\n rows_distinct(\n columns = c(\"mpg\", \"cyl\", \"disp\", \"hp\", \"drat\", \"wt\", \"qsec\", \"vs\", \"am\", \"gear\", \"carb\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n mpg = \"numeric\",\n cyl = \"numeric\",\n disp = \"numeric\",\n hp = \"numeric\",\n drat = \"numeric\",\n wt = \"numeric\",\n qsec = \"numeric\",\n vs = \"numeric\",\n am = \"numeric\",\n gear = \"numeric\",\n carb = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `mpg` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg\")\n ) %>%\n # Expect that values in `mpg` should be between `10.4` and `33.9`\n col_vals_between(\n columns = c(\"mpg\"),\n left = 10.4,\n right = 33.9\n ) %>%\n # Expect that column `cyl` is of type: numeric\n col_is_numeric(\n columns = c(\"cyl\")\n ) %>%\n # Expect that values in `cyl` should be between `4` and `8`\n col_vals_between(\n columns = c(\"cyl\"),\n left = 4,\n right = 8\n ) %>%\n # Expect that column `disp` is of type: numeric\n col_is_numeric(\n columns = c(\"disp\")\n ) %>%\n # Expect that values in `disp` should be between `71.1` and `472`\n col_vals_between(\n columns = c(\"disp\"),\n left = 71.1,\n right = 472\n ) %>%\n # Expect that column `hp` is of type: numeric\n col_is_numeric(\n columns = c(\"hp\")\n ) %>%\n # Expect that values in `hp` should be between `52` and `335`\n col_vals_between(\n columns = c(\"hp\"),\n left = 52,\n right = 335\n ) %>%\n # Expect that column `drat` is of type: numeric\n col_is_numeric(\n columns = c(\"drat\")\n ) %>%\n # Expect that values in `drat` should be between `2.76` and `4.93`\n col_vals_between(\n columns = c(\"drat\"),\n left = 2.76,\n right = 4.93\n ) %>%\n # Expect that column `wt` is of type: numeric\n col_is_numeric(\n columns = c(\"wt\")\n ) %>%\n # Expect that values in `wt` should be between `1.513` and `5.424`\n col_vals_between(\n columns = c(\"wt\"),\n left = 1.513,\n right = 5.424\n ) %>%\n # Expect that column `qsec` is of type: numeric\n col_is_numeric(\n columns = c(\"qsec\")\n ) %>%\n # Expect that values in `qsec` should be between `14.5` and `22.9`\n col_vals_between(\n columns = c(\"qsec\"),\n left = 14.5,\n right = 22.9\n ) %>%\n # Expect that column `vs` is of type: numeric\n col_is_numeric(\n columns = c(\"vs\")\n ) %>%\n # Expect that values in `vs` should be between `0` and `1`\n col_vals_between(\n columns = c(\"vs\"),\n left = 0,\n right = 1\n ) %>%\n # Expect that column `am` is of type: numeric\n col_is_numeric(\n columns = c(\"am\")\n ) %>%\n # Expect that values in `am` should be between `0` and `1`\n col_vals_between(\n columns = c(\"am\"),\n left = 0,\n right = 1\n ) %>%\n # Expect that column `gear` is of type: numeric\n col_is_numeric(\n columns = c(\"gear\")\n ) %>%\n # Expect that values in `gear` should be between `3` and `5`\n col_vals_between(\n columns = c(\"gear\"),\n left = 3,\n right = 5\n ) %>%\n # Expect that column `carb` is of type: numeric\n col_is_numeric(\n columns = c(\"carb\")\n ) %>%\n # Expect that values in `carb` should be between `1` and `8`\n col_vals_between(\n columns = c(\"carb\"),\n left = 1,\n right = 8\n ) %>%\n # Expect entirely distinct rows across `mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb`\n rows_distinct(\n columns = c(\"mpg\", \"cyl\", \"disp\", \"hp\", \"drat\", \"wt\", \"qsec\", \"vs\", \"am\", \"gear\", \"carb\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n mpg = \"numeric\",\n cyl = \"numeric\",\n disp = \"numeric\",\n hp = \"numeric\",\n drat = \"numeric\",\n wt = \"numeric\",\n qsec = \"numeric\",\n vs = \"numeric\",\n am = \"numeric\",\n gear = \"numeric\",\n carb = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Tree` is of type: factor\n col_is_factor(\n columns = c(\"Tree\")\n ) %>%\n # Expect that column `age` is of type: numeric\n col_is_numeric(\n columns = c(\"age\")\n ) %>%\n # Expect that values in `age` should be between `118` and `1582`\n col_vals_between(\n columns = c(\"age\"),\n left = 118,\n right = 1582\n ) %>%\n # Expect that column `circumference` is of type: numeric\n col_is_numeric(\n columns = c(\"circumference\")\n ) %>%\n # Expect that values in `circumference` should be between `30` and `214`\n col_vals_between(\n columns = c(\"circumference\"),\n left = 30,\n right = 214\n ) %>%\n # Expect entirely distinct rows across `Tree, age, circumference`\n rows_distinct(\n columns = c(\"Tree\", \"age\", \"circumference\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Tree = c(\"ordered\", \"factor\"),\n age = \"numeric\",\n circumference = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Tree` is of type: factor\n col_is_factor(\n columns = c(\"Tree\")\n ) %>%\n # Expect that column `age` is of type: numeric\n col_is_numeric(\n columns = c(\"age\")\n ) %>%\n # Expect that values in `age` should be between `118` and `1582`\n col_vals_between(\n columns = c(\"age\"),\n left = 118,\n right = 1582\n ) %>%\n # Expect that column `circumference` is of type: numeric\n col_is_numeric(\n columns = c(\"circumference\")\n ) %>%\n # Expect that values in `circumference` should be between `30` and `214`\n col_vals_between(\n columns = c(\"circumference\"),\n left = 30,\n right = 214\n ) %>%\n # Expect entirely distinct rows across `Tree, age, circumference`\n rows_distinct(\n columns = c(\"Tree\", \"age\", \"circumference\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Tree = c(\"ordered\", \"factor\"),\n age = \"numeric\",\n circumference = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `temperature` is of type: numeric\n col_is_numeric(\n columns = c(\"temperature\")\n ) %>%\n # Expect that values in `temperature` should be between `0` and `360`\n col_vals_between(\n columns = c(\"temperature\"),\n left = 0,\n right = 360\n ) %>%\n # Expect that column `pressure` is of type: numeric\n col_is_numeric(\n columns = c(\"pressure\")\n ) %>%\n # Expect that values in `pressure` should be between `2e-04` and `806`\n col_vals_between(\n columns = c(\"pressure\"),\n left = 2e-04,\n right = 806\n ) %>%\n # Expect entirely distinct rows across `temperature, pressure`\n rows_distinct(\n columns = c(\"temperature\", \"pressure\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n temperature = \"numeric\",\n pressure = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `temperature` is of type: numeric\n col_is_numeric(\n columns = c(\"temperature\")\n ) %>%\n # Expect that values in `temperature` should be between `0` and `360`\n col_vals_between(\n columns = c(\"temperature\"),\n left = 0,\n right = 360\n ) %>%\n # Expect that column `pressure` is of type: numeric\n col_is_numeric(\n columns = c(\"pressure\")\n ) %>%\n # Expect that values in `pressure` should be between `2e-04` and `806`\n col_vals_between(\n columns = c(\"pressure\"),\n left = 2e-04,\n right = 806\n ) %>%\n # Expect entirely distinct rows across `temperature, pressure`\n rows_distinct(\n columns = c(\"temperature\", \"pressure\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n temperature = \"numeric\",\n pressure = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `lat` is of type: numeric\n col_is_numeric(\n columns = c(\"lat\")\n ) %>%\n # Expect that values in `lat` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"lat\"),\n left = -90,\n right = 90\n ) %>%\n # Expect that column `long` is of type: numeric\n col_is_numeric(\n columns = c(\"long\")\n ) %>%\n # Expect that values in `long` should be between `-180` and `180`\n col_vals_between(\n columns = c(\"long\"),\n left = -180,\n right = 180\n ) %>%\n # Expect that column `depth` is of type: integer\n col_is_integer(\n columns = c(\"depth\")\n ) %>%\n # Expect that values in `depth` should be between `40` and `680`\n col_vals_between(\n columns = c(\"depth\"),\n left = 40,\n right = 680\n ) %>%\n # Expect that column `mag` is of type: numeric\n col_is_numeric(\n columns = c(\"mag\")\n ) %>%\n # Expect that values in `mag` should be between `4` and `6.4`\n col_vals_between(\n columns = c(\"mag\"),\n left = 4,\n right = 6.4\n ) %>%\n # Expect that column `stations` is of type: integer\n col_is_integer(\n columns = c(\"stations\")\n ) %>%\n # Expect that values in `stations` should be between `10` and `132`\n col_vals_between(\n columns = c(\"stations\"),\n left = 10,\n right = 132\n ) %>%\n # Expect entirely distinct rows across `lat, long, depth, mag, stations`\n rows_distinct(\n columns = c(\"lat\", \"long\", \"depth\", \"mag\", \"stations\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n lat = \"numeric\",\n long = \"numeric\",\n depth = \"integer\",\n mag = \"numeric\",\n stations = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `lat` is of type: numeric\n col_is_numeric(\n columns = c(\"lat\")\n ) %>%\n # Expect that values in `lat` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"lat\"),\n left = -90,\n right = 90\n ) %>%\n # Expect that column `long` is of type: numeric\n col_is_numeric(\n columns = c(\"long\")\n ) %>%\n # Expect that values in `long` should be between `-180` and `180`\n col_vals_between(\n columns = c(\"long\"),\n left = -180,\n right = 180\n ) %>%\n # Expect that column `depth` is of type: integer\n col_is_integer(\n columns = c(\"depth\")\n ) %>%\n # Expect that values in `depth` should be between `40` and `680`\n col_vals_between(\n columns = c(\"depth\"),\n left = 40,\n right = 680\n ) %>%\n # Expect that column `mag` is of type: numeric\n col_is_numeric(\n columns = c(\"mag\")\n ) %>%\n # Expect that values in `mag` should be between `4` and `6.4`\n col_vals_between(\n columns = c(\"mag\"),\n left = 4,\n right = 6.4\n ) %>%\n # Expect that column `stations` is of type: integer\n col_is_integer(\n columns = c(\"stations\")\n ) %>%\n # Expect that values in `stations` should be between `10` and `132`\n col_vals_between(\n columns = c(\"stations\"),\n left = 10,\n right = 132\n ) %>%\n # Expect entirely distinct rows across `lat, long, depth, mag, stations`\n rows_distinct(\n columns = c(\"lat\", \"long\", \"depth\", \"mag\", \"stations\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n lat = \"numeric\",\n long = \"numeric\",\n depth = \"integer\",\n mag = \"numeric\",\n stations = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `area` is of type: integer\n col_is_integer(\n columns = c(\"area\")\n ) %>%\n # Expect that values in `area` should be between `1016` and `12212`\n col_vals_between(\n columns = c(\"area\"),\n left = 1016,\n right = 12212\n ) %>%\n # Expect that column `peri` is of type: numeric\n col_is_numeric(\n columns = c(\"peri\")\n ) %>%\n # Expect that values in `peri` should be between `308.642` and `4864.22`\n col_vals_between(\n columns = c(\"peri\"),\n left = 308.642,\n right = 4864.22\n ) %>%\n # Expect that column `shape` is of type: numeric\n col_is_numeric(\n columns = c(\"shape\")\n ) %>%\n # Expect that values in `shape` should be between `0.0903296` and `0.464125`\n col_vals_between(\n columns = c(\"shape\"),\n left = 0.0903296,\n right = 0.464125\n ) %>%\n # Expect that column `perm` is of type: numeric\n col_is_numeric(\n columns = c(\"perm\")\n ) %>%\n # Expect that values in `perm` should be between `6.3` and `1300`\n col_vals_between(\n columns = c(\"perm\"),\n left = 6.3,\n right = 1300\n ) %>%\n # Expect entirely distinct rows across `area, peri, shape, perm`\n rows_distinct(\n columns = c(\"area\", \"peri\", \"shape\", \"perm\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n area = \"integer\",\n peri = \"numeric\",\n shape = \"numeric\",\n perm = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `area` is of type: integer\n col_is_integer(\n columns = c(\"area\")\n ) %>%\n # Expect that values in `area` should be between `1016` and `12212`\n col_vals_between(\n columns = c(\"area\"),\n left = 1016,\n right = 12212\n ) %>%\n # Expect that column `peri` is of type: numeric\n col_is_numeric(\n columns = c(\"peri\")\n ) %>%\n # Expect that values in `peri` should be between `308.642` and `4864.22`\n col_vals_between(\n columns = c(\"peri\"),\n left = 308.642,\n right = 4864.22\n ) %>%\n # Expect that column `shape` is of type: numeric\n col_is_numeric(\n columns = c(\"shape\")\n ) %>%\n # Expect that values in `shape` should be between `0.0903296` and `0.464125`\n col_vals_between(\n columns = c(\"shape\"),\n left = 0.0903296,\n right = 0.464125\n ) %>%\n # Expect that column `perm` is of type: numeric\n col_is_numeric(\n columns = c(\"perm\")\n ) %>%\n # Expect that values in `perm` should be between `6.3` and `1300`\n col_vals_between(\n columns = c(\"perm\"),\n left = 6.3,\n right = 1300\n ) %>%\n # Expect entirely distinct rows across `area, peri, shape, perm`\n rows_distinct(\n columns = c(\"area\", \"peri\", \"shape\", \"perm\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n area = \"integer\",\n peri = \"numeric\",\n shape = \"numeric\",\n perm = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Fertility` is of type: numeric\n col_is_numeric(\n columns = c(\"Fertility\")\n ) %>%\n # Expect that values in `Fertility` should be between `35` and `92.5`\n col_vals_between(\n columns = c(\"Fertility\"),\n left = 35,\n right = 92.5\n ) %>%\n # Expect that column `Agriculture` is of type: numeric\n col_is_numeric(\n columns = c(\"Agriculture\")\n ) %>%\n # Expect that values in `Agriculture` should be between `1.2` and `89.7`\n col_vals_between(\n columns = c(\"Agriculture\"),\n left = 1.2,\n right = 89.7\n ) %>%\n # Expect that column `Examination` is of type: integer\n col_is_integer(\n columns = c(\"Examination\")\n ) %>%\n # Expect that values in `Examination` should be between `3` and `37`\n col_vals_between(\n columns = c(\"Examination\"),\n left = 3,\n right = 37\n ) %>%\n # Expect that column `Education` is of type: integer\n col_is_integer(\n columns = c(\"Education\")\n ) %>%\n # Expect that values in `Education` should be between `1` and `53`\n col_vals_between(\n columns = c(\"Education\"),\n left = 1,\n right = 53\n ) %>%\n # Expect that column `Catholic` is of type: numeric\n col_is_numeric(\n columns = c(\"Catholic\")\n ) %>%\n # Expect that values in `Catholic` should be between `2.15` and `100`\n col_vals_between(\n columns = c(\"Catholic\"),\n left = 2.15,\n right = 100\n ) %>%\n # Expect that column `Infant.Mortality` is of type: numeric\n col_is_numeric(\n columns = c(\"Infant.Mortality\")\n ) %>%\n # Expect that values in `Infant.Mortality` should be between `10.8` and `26.6`\n col_vals_between(\n columns = c(\"Infant.Mortality\"),\n left = 10.8,\n right = 26.6\n ) %>%\n # Expect entirely distinct rows across `Fertility, Agriculture, Examination, Education, Catholic, Infant.Mortality`\n rows_distinct(\n columns = c(\"Fertility\", \"Agriculture\", \"Examination\", \"Education\", \"Catholic\", \"Infant.Mortality\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Fertility = \"numeric\",\n Agriculture = \"numeric\",\n Examination = \"integer\",\n Education = \"integer\",\n Catholic = \"numeric\",\n Infant.Mortality = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `Fertility` is of type: numeric\n col_is_numeric(\n columns = c(\"Fertility\")\n ) %>%\n # Expect that values in `Fertility` should be between `35` and `92.5`\n col_vals_between(\n columns = c(\"Fertility\"),\n left = 35,\n right = 92.5\n ) %>%\n # Expect that column `Agriculture` is of type: numeric\n col_is_numeric(\n columns = c(\"Agriculture\")\n ) %>%\n # Expect that values in `Agriculture` should be between `1.2` and `89.7`\n col_vals_between(\n columns = c(\"Agriculture\"),\n left = 1.2,\n right = 89.7\n ) %>%\n # Expect that column `Examination` is of type: integer\n col_is_integer(\n columns = c(\"Examination\")\n ) %>%\n # Expect that values in `Examination` should be between `3` and `37`\n col_vals_between(\n columns = c(\"Examination\"),\n left = 3,\n right = 37\n ) %>%\n # Expect that column `Education` is of type: integer\n col_is_integer(\n columns = c(\"Education\")\n ) %>%\n # Expect that values in `Education` should be between `1` and `53`\n col_vals_between(\n columns = c(\"Education\"),\n left = 1,\n right = 53\n ) %>%\n # Expect that column `Catholic` is of type: numeric\n col_is_numeric(\n columns = c(\"Catholic\")\n ) %>%\n # Expect that values in `Catholic` should be between `2.15` and `100`\n col_vals_between(\n columns = c(\"Catholic\"),\n left = 2.15,\n right = 100\n ) %>%\n # Expect that column `Infant.Mortality` is of type: numeric\n col_is_numeric(\n columns = c(\"Infant.Mortality\")\n ) %>%\n # Expect that values in `Infant.Mortality` should be between `10.8` and `26.6`\n col_vals_between(\n columns = c(\"Infant.Mortality\"),\n left = 10.8,\n right = 26.6\n ) %>%\n # Expect entirely distinct rows across `Fertility, Agriculture, Examination, Education, Catholic, Infant.Mortality`\n rows_distinct(\n columns = c(\"Fertility\", \"Agriculture\", \"Examination\", \"Education\", \"Catholic\", \"Infant.Mortality\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n Fertility = \"numeric\",\n Agriculture = \"numeric\",\n Examination = \"integer\",\n Education = \"integer\",\n Catholic = \"numeric\",\n Infant.Mortality = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `CONT` is of type: numeric\n col_is_numeric(\n columns = c(\"CONT\")\n ) %>%\n # Expect that values in `CONT` should be between `5.7` and `10.6`\n col_vals_between(\n columns = c(\"CONT\"),\n left = 5.7,\n right = 10.6\n ) %>%\n # Expect that column `INTG` is of type: numeric\n col_is_numeric(\n columns = c(\"INTG\")\n ) %>%\n # Expect that values in `INTG` should be between `5.9` and `9.2`\n col_vals_between(\n columns = c(\"INTG\"),\n left = 5.9,\n right = 9.2\n ) %>%\n # Expect that column `DMNR` is of type: numeric\n col_is_numeric(\n columns = c(\"DMNR\")\n ) %>%\n # Expect that values in `DMNR` should be between `4.3` and `9`\n col_vals_between(\n columns = c(\"DMNR\"),\n left = 4.3,\n right = 9\n ) %>%\n # Expect that column `DILG` is of type: numeric\n col_is_numeric(\n columns = c(\"DILG\")\n ) %>%\n # Expect that values in `DILG` should be between `5.1` and `9`\n col_vals_between(\n columns = c(\"DILG\"),\n left = 5.1,\n right = 9\n ) %>%\n # Expect that column `CFMG` is of type: numeric\n col_is_numeric(\n columns = c(\"CFMG\")\n ) %>%\n # Expect that values in `CFMG` should be between `5.4` and `8.7`\n col_vals_between(\n columns = c(\"CFMG\"),\n left = 5.4,\n right = 8.7\n ) %>%\n # Expect that column `DECI` is of type: numeric\n col_is_numeric(\n columns = c(\"DECI\")\n ) %>%\n # Expect that values in `DECI` should be between `5.7` and `8.8`\n col_vals_between(\n columns = c(\"DECI\"),\n left = 5.7,\n right = 8.8\n ) %>%\n # Expect that column `PREP` is of type: numeric\n col_is_numeric(\n columns = c(\"PREP\")\n ) %>%\n # Expect that values in `PREP` should be between `4.8` and `9.1`\n col_vals_between(\n columns = c(\"PREP\"),\n left = 4.8,\n right = 9.1\n ) %>%\n # Expect that column `FAMI` is of type: numeric\n col_is_numeric(\n columns = c(\"FAMI\")\n ) %>%\n # Expect that values in `FAMI` should be between `5.1` and `9.1`\n col_vals_between(\n columns = c(\"FAMI\"),\n left = 5.1,\n right = 9.1\n ) %>%\n # Expect that column `ORAL` is of type: numeric\n col_is_numeric(\n columns = c(\"ORAL\")\n ) %>%\n # Expect that values in `ORAL` should be between `4.7` and `8.9`\n col_vals_between(\n columns = c(\"ORAL\"),\n left = 4.7,\n right = 8.9\n ) %>%\n # Expect that column `WRIT` is of type: numeric\n col_is_numeric(\n columns = c(\"WRIT\")\n ) %>%\n # Expect that values in `WRIT` should be between `4.9` and `9`\n col_vals_between(\n columns = c(\"WRIT\"),\n left = 4.9,\n right = 9\n ) %>%\n # Expect that column `PHYS` is of type: numeric\n col_is_numeric(\n columns = c(\"PHYS\")\n ) %>%\n # Expect that values in `PHYS` should be between `4.7` and `9.1`\n col_vals_between(\n columns = c(\"PHYS\"),\n left = 4.7,\n right = 9.1\n ) %>%\n # Expect that column `RTEN` is of type: numeric\n col_is_numeric(\n columns = c(\"RTEN\")\n ) %>%\n # Expect that values in `RTEN` should be between `4.8` and `9.2`\n col_vals_between(\n columns = c(\"RTEN\"),\n left = 4.8,\n right = 9.2\n ) %>%\n # Expect entirely distinct rows across `CONT, INTG, DMNR, DILG, CFMG, DECI, PREP, FAMI, ORAL, WRIT, PHYS, RTEN`\n rows_distinct(\n columns = c(\"CONT\", \"INTG\", \"DMNR\", \"DILG\", \"CFMG\", \"DECI\", \"PREP\", \"FAMI\", \"ORAL\", \"WRIT\", \"PHYS\", \"RTEN\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n CONT = \"numeric\",\n INTG = \"numeric\",\n DMNR = \"numeric\",\n DILG = \"numeric\",\n CFMG = \"numeric\",\n DECI = \"numeric\",\n PREP = \"numeric\",\n FAMI = \"numeric\",\n ORAL = \"numeric\",\n WRIT = \"numeric\",\n PHYS = \"numeric\",\n RTEN = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `CONT` is of type: numeric\n col_is_numeric(\n columns = c(\"CONT\")\n ) %>%\n # Expect that values in `CONT` should be between `5.7` and `10.6`\n col_vals_between(\n columns = c(\"CONT\"),\n left = 5.7,\n right = 10.6\n ) %>%\n # Expect that column `INTG` is of type: numeric\n col_is_numeric(\n columns = c(\"INTG\")\n ) %>%\n # Expect that values in `INTG` should be between `5.9` and `9.2`\n col_vals_between(\n columns = c(\"INTG\"),\n left = 5.9,\n right = 9.2\n ) %>%\n # Expect that column `DMNR` is of type: numeric\n col_is_numeric(\n columns = c(\"DMNR\")\n ) %>%\n # Expect that values in `DMNR` should be between `4.3` and `9`\n col_vals_between(\n columns = c(\"DMNR\"),\n left = 4.3,\n right = 9\n ) %>%\n # Expect that column `DILG` is of type: numeric\n col_is_numeric(\n columns = c(\"DILG\")\n ) %>%\n # Expect that values in `DILG` should be between `5.1` and `9`\n col_vals_between(\n columns = c(\"DILG\"),\n left = 5.1,\n right = 9\n ) %>%\n # Expect that column `CFMG` is of type: numeric\n col_is_numeric(\n columns = c(\"CFMG\")\n ) %>%\n # Expect that values in `CFMG` should be between `5.4` and `8.7`\n col_vals_between(\n columns = c(\"CFMG\"),\n left = 5.4,\n right = 8.7\n ) %>%\n # Expect that column `DECI` is of type: numeric\n col_is_numeric(\n columns = c(\"DECI\")\n ) %>%\n # Expect that values in `DECI` should be between `5.7` and `8.8`\n col_vals_between(\n columns = c(\"DECI\"),\n left = 5.7,\n right = 8.8\n ) %>%\n # Expect that column `PREP` is of type: numeric\n col_is_numeric(\n columns = c(\"PREP\")\n ) %>%\n # Expect that values in `PREP` should be between `4.8` and `9.1`\n col_vals_between(\n columns = c(\"PREP\"),\n left = 4.8,\n right = 9.1\n ) %>%\n # Expect that column `FAMI` is of type: numeric\n col_is_numeric(\n columns = c(\"FAMI\")\n ) %>%\n # Expect that values in `FAMI` should be between `5.1` and `9.1`\n col_vals_between(\n columns = c(\"FAMI\"),\n left = 5.1,\n right = 9.1\n ) %>%\n # Expect that column `ORAL` is of type: numeric\n col_is_numeric(\n columns = c(\"ORAL\")\n ) %>%\n # Expect that values in `ORAL` should be between `4.7` and `8.9`\n col_vals_between(\n columns = c(\"ORAL\"),\n left = 4.7,\n right = 8.9\n ) %>%\n # Expect that column `WRIT` is of type: numeric\n col_is_numeric(\n columns = c(\"WRIT\")\n ) %>%\n # Expect that values in `WRIT` should be between `4.9` and `9`\n col_vals_between(\n columns = c(\"WRIT\"),\n left = 4.9,\n right = 9\n ) %>%\n # Expect that column `PHYS` is of type: numeric\n col_is_numeric(\n columns = c(\"PHYS\")\n ) %>%\n # Expect that values in `PHYS` should be between `4.7` and `9.1`\n col_vals_between(\n columns = c(\"PHYS\"),\n left = 4.7,\n right = 9.1\n ) %>%\n # Expect that column `RTEN` is of type: numeric\n col_is_numeric(\n columns = c(\"RTEN\")\n ) %>%\n # Expect that values in `RTEN` should be between `4.8` and `9.2`\n col_vals_between(\n columns = c(\"RTEN\"),\n left = 4.8,\n right = 9.2\n ) %>%\n # Expect entirely distinct rows across `CONT, INTG, DMNR, DILG, CFMG, DECI, PREP, FAMI, ORAL, WRIT, PHYS, RTEN`\n rows_distinct(\n columns = c(\"CONT\", \"INTG\", \"DMNR\", \"DILG\", \"CFMG\", \"DECI\", \"PREP\", \"FAMI\", \"ORAL\", \"WRIT\", \"PHYS\", \"RTEN\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n CONT = \"numeric\",\n INTG = \"numeric\",\n DMNR = \"numeric\",\n DILG = \"numeric\",\n CFMG = \"numeric\",\n DECI = \"numeric\",\n PREP = \"numeric\",\n FAMI = \"numeric\",\n ORAL = \"numeric\",\n WRIT = \"numeric\",\n PHYS = \"numeric\",\n RTEN = \"numeric\"\n )\n ) %>%\n interrogate()\n\nagent" # draft validations for data tables can be generated in different languages Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `a` is of type: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Expect that values in `a` should be between `1` and `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Expect that column `b` is of type: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Expect that column `c` is of type: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Expect that values in `c` should be between `2` and `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Expect that column `d` is of type: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Expect that values in `d` should be between `108.34` and `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Expect that column `e` is of type: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Expect that column `f` is of type: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `a` is of type: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Expect that values in `a` should be between `1` and `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Expect that column `b` is of type: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Expect that column `c` is of type: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Expect that values in `c` should be between `2` and `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Expect that column `d` is of type: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Expect that values in `d` should be between `108.34` and `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Expect that column `e` is of type: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Expect that column `f` is of type: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"fr\",\n locale = \"fr\"\n ) %>%\n # On s'attend à ce que la colonne `a` soit de type : integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # On s'attend à ce que les valeurs de `a` soient comprises entre `1` et `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # On s'attend à ce que la colonne `b` soit de type : character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # On s'attend à ce que la colonne `c` soit de type : numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # On s'attend à ce que les valeurs de `c` soient comprises entre `2` et `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # On s'attend à ce que la colonne `d` soit de type : numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # On s'attend à ce que les valeurs de `d` soient comprises entre `108.34` et `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # On s'attend à ce que la colonne `e` soit de type : logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # On s'attend à ce que la colonne `f` soit de type : character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # On s'attend à ce que les schémas de colonnes correspondent\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"fr\",\n locale = \"fr\"\n ) %>%\n # On s'attend à ce que la colonne `a` soit de type : integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # On s'attend à ce que les valeurs de `a` soient comprises entre `1` et `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # On s'attend à ce que la colonne `b` soit de type : character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # On s'attend à ce que la colonne `c` soit de type : numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # On s'attend à ce que les valeurs de `c` soient comprises entre `2` et `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # On s'attend à ce que la colonne `d` soit de type : numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # On s'attend à ce que les valeurs de `d` soient comprises entre `108.34` et `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # On s'attend à ce que la colonne `e` soit de type : logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # On s'attend à ce que la colonne `f` soit de type : character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # On s'attend à ce que les schémas de colonnes correspondent\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"de\",\n locale = \"de\"\n ) %>%\n # Erwarten Sie, dass die Spalte `a` vom Typ integer ist\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Erwarten Sie, dass die Werte in `a` zwischen `1` und `8` liegen sollten\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Erwarten Sie, dass die Spalte `b` vom Typ character ist\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Erwarten Sie, dass die Spalte `c` vom Typ numeric ist\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Erwarten Sie, dass die Werte in `c` zwischen `2` und `9` liegen sollten\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Erwarten Sie, dass die Spalte `d` vom Typ numeric ist\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Erwarten Sie, dass die Werte in `d` zwischen `108.34` und `9999.99` liegen sollten\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Erwarten Sie, dass die Spalte `e` vom Typ logical ist\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Erwarten Sie, dass die Spalte `f` vom Typ character ist\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Erwarten Sie, dass die Spaltenschemata übereinstimmen\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"de\",\n locale = \"de\"\n ) %>%\n # Erwarten Sie, dass die Spalte `a` vom Typ integer ist\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Erwarten Sie, dass die Werte in `a` zwischen `1` und `8` liegen sollten\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Erwarten Sie, dass die Spalte `b` vom Typ character ist\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Erwarten Sie, dass die Spalte `c` vom Typ numeric ist\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Erwarten Sie, dass die Werte in `c` zwischen `2` und `9` liegen sollten\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Erwarten Sie, dass die Spalte `d` vom Typ numeric ist\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Erwarten Sie, dass die Werte in `d` zwischen `108.34` und `9999.99` liegen sollten\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Erwarten Sie, dass die Spalte `e` vom Typ logical ist\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Erwarten Sie, dass die Spalte `f` vom Typ character ist\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Erwarten Sie, dass die Spaltenschemata übereinstimmen\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"it\",\n locale = \"it\"\n ) %>%\n # Aspettati che la colonna `a` sia di tipo: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Aspettati che i valori in `a` siano compresi tra `1` e `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Aspettati che la colonna `b` sia di tipo: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Aspettati che la colonna `c` sia di tipo: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Aspettati che i valori in `c` siano compresi tra `2` e `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Aspettati che la colonna `d` sia di tipo: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Aspettati che i valori in `d` siano compresi tra `108.34` e `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Aspettati che la colonna `e` sia di tipo: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Aspettati che la colonna `f` sia di tipo: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Aspettati che gli schemi di colonna corrispondano\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"it\",\n locale = \"it\"\n ) %>%\n # Aspettati che la colonna `a` sia di tipo: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Aspettati che i valori in `a` siano compresi tra `1` e `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Aspettati che la colonna `b` sia di tipo: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Aspettati che la colonna `c` sia di tipo: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Aspettati che i valori in `c` siano compresi tra `2` e `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Aspettati che la colonna `d` sia di tipo: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Aspettati che i valori in `d` siano compresi tra `108.34` e `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Aspettati che la colonna `e` sia di tipo: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Aspettati che la colonna `f` sia di tipo: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Aspettati che gli schemi di colonna corrispondano\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"es\",\n locale = \"es\"\n ) %>%\n # Se espera que la columna `a` sea del tipo \n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Se espera que los valores en `a` estén entre `1` y `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Se espera que la columna `b` sea del tipo \n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Se espera que la columna `c` sea del tipo \n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Se espera que los valores en `c` estén entre `2` y `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Se espera que la columna `d` sea del tipo \n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Se espera que los valores en `d` estén entre `108.34` y `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Se espera que la columna `e` sea del tipo \n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Se espera que la columna `f` sea del tipo \n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Se espera que los esquemas de columna coincidan\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"es\",\n locale = \"es\"\n ) %>%\n # Se espera que la columna `a` sea del tipo \n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Se espera que los valores en `a` estén entre `1` y `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Se espera que la columna `b` sea del tipo \n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Se espera que la columna `c` sea del tipo \n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Se espera que los valores en `c` estén entre `2` y `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Se espera que la columna `d` sea del tipo \n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Se espera que los valores en `d` estén entre `108.34` y `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Se espera que la columna `e` sea del tipo \n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Se espera que la columna `f` sea del tipo \n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Se espera que los esquemas de columna coincidan\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"pt\",\n locale = \"pt\"\n ) %>%\n # Espera-se que coluna `a` seja do tipo \n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Espera-se que os valores em `a` devem estar entre `1` e `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Espera-se que coluna `b` seja do tipo \n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Espera-se que coluna `c` seja do tipo \n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Espera-se que os valores em `c` devem estar entre `2` e `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Espera-se que coluna `d` seja do tipo \n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Espera-se que os valores em `d` devem estar entre `108.34` e `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Espera-se que coluna `e` seja do tipo \n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Espera-se que coluna `f` seja do tipo \n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Espera-se que os esquemas de coluna concordem\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"pt\",\n locale = \"pt\"\n ) %>%\n # Espera-se que coluna `a` seja do tipo \n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Espera-se que os valores em `a` devem estar entre `1` e `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Espera-se que coluna `b` seja do tipo \n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Espera-se que coluna `c` seja do tipo \n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Espera-se que os valores em `c` devem estar entre `2` e `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Espera-se que coluna `d` seja do tipo \n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Espera-se que os valores em `d` devem estar entre `108.34` e `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Espera-se que coluna `e` seja do tipo \n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Espera-se que coluna `f` seja do tipo \n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Espera-se que os esquemas de coluna concordem\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"tr\",\n locale = \"tr\"\n ) %>%\n # `a` sütununun şu türde olmasını bekleyin: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Beklenti, `a` 'deki değerlerin `1` ile `8` arasında olması gerektiğidir\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # `b` sütununun şu türde olmasını bekleyin: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # `c` sütununun şu türde olmasını bekleyin: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Beklenti, `c` 'deki değerlerin `2` ile `9` arasında olması gerektiğidir\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # `d` sütununun şu türde olmasını bekleyin: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Beklenti, `d` 'deki değerlerin `108.34` ile `9999.99` arasında olması gerektiğidir\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # `e` sütununun şu türde olmasını bekleyin: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # `f` sütununun şu türde olmasını bekleyin: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Sütun şemalarının eşleşmesini bekleyin\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"tr\",\n locale = \"tr\"\n ) %>%\n # `a` sütununun şu türde olmasını bekleyin: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Beklenti, `a` 'deki değerlerin `1` ile `8` arasında olması gerektiğidir\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # `b` sütununun şu türde olmasını bekleyin: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # `c` sütununun şu türde olmasını bekleyin: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Beklenti, `c` 'deki değerlerin `2` ile `9` arasında olması gerektiğidir\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # `d` sütununun şu türde olmasını bekleyin: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Beklenti, `d` 'deki değerlerin `108.34` ile `9999.99` arasında olması gerektiğidir\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # `e` sütununun şu türde olmasını bekleyin: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # `f` sütununun şu türde olmasını bekleyin: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Sütun şemalarının eşleşmesini bekleyin\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"zh\",\n locale = \"zh\"\n ) %>%\n # 预期列 `a`为类型 \n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # 预期在`a` 的值应当在 `1`和 `8`之间。 \n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # 预期列 `b`为类型 \n col_is_character(\n columns = c(\"b\")\n ) %>%\n # 预期列 `c`为类型 \n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # 预期在`c` 的值应当在 `2`和 `9`之间。 \n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # 预期列 `d`为类型 \n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # 预期在`d` 的值应当在 `108.34`和 `9999.99`之间。 \n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # 预期列 `e`为类型 \n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # 预期列 `f`为类型 \n col_is_character(\n columns = c(\"f\")\n ) %>%\n # 预期列模式(column schemas)应当匹配。 \n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"zh\",\n locale = \"zh\"\n ) %>%\n # 预期列 `a`为类型 \n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # 预期在`a` 的值应当在 `1`和 `8`之间。 \n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # 预期列 `b`为类型 \n col_is_character(\n columns = c(\"b\")\n ) %>%\n # 预期列 `c`为类型 \n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # 预期在`c` 的值应当在 `2`和 `9`之间。 \n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # 预期列 `d`为类型 \n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # 预期在`d` 的值应当在 `108.34`和 `9999.99`之间。 \n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # 预期列 `e`为类型 \n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # 预期列 `f`为类型 \n col_is_character(\n columns = c(\"f\")\n ) %>%\n # 预期列模式(column schemas)应当匹配。 \n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"ru\",\n locale = \"ru\"\n ) %>%\n # Ожидайте, что столбец `a` имеет тип: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Ожидайте, что значения в `a` должны находиться между `1` и `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Ожидайте, что столбец `b` имеет тип: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Ожидайте, что столбец `c` имеет тип: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Ожидайте, что значения в `c` должны находиться между `2` и `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Ожидайте, что столбец `d` имеет тип: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Ожидайте, что значения в `d` должны находиться между `108.34` и `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Ожидайте, что столбец `e` имеет тип: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Ожидайте, что столбец `f` имеет тип: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Ожидайте, что схемы столбцов совпадают\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"ru\",\n locale = \"ru\"\n ) %>%\n # Ожидайте, что столбец `a` имеет тип: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Ожидайте, что значения в `a` должны находиться между `1` и `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Ожидайте, что столбец `b` имеет тип: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Ожидайте, что столбец `c` имеет тип: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Ожидайте, что значения в `c` должны находиться между `2` и `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Ожидайте, что столбец `d` имеет тип: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Ожидайте, что значения в `d` должны находиться между `108.34` и `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Ожидайте, что столбец `e` имеет тип: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Ожидайте, что столбец `f` имеет тип: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Ожидайте, что схемы столбцов совпадают\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"pl\",\n locale = \"pl\"\n ) %>%\n # Spodziewaj się, że kolumna `a` jest typu: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Spodziewaj się, że wartości w `a` powinny zawierac się między `1` a `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Spodziewaj się, że kolumna `b` jest typu: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Spodziewaj się, że kolumna `c` jest typu: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Spodziewaj się, że wartości w `c` powinny zawierac się między `2` a `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Spodziewaj się, że kolumna `d` jest typu: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Spodziewaj się, że wartości w `d` powinny zawierac się między `108.34` a `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Spodziewaj się, że kolumna `e` jest typu: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Spodziewaj się, że kolumna `f` jest typu: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Spodziewaj się, że schematy kolumn będa zgodne\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"pl\",\n locale = \"pl\"\n ) %>%\n # Spodziewaj się, że kolumna `a` jest typu: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Spodziewaj się, że wartości w `a` powinny zawierac się między `1` a `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Spodziewaj się, że kolumna `b` jest typu: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Spodziewaj się, że kolumna `c` jest typu: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Spodziewaj się, że wartości w `c` powinny zawierac się między `2` a `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Spodziewaj się, że kolumna `d` jest typu: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Spodziewaj się, że wartości w `d` powinny zawierac się między `108.34` a `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Spodziewaj się, że kolumna `e` jest typu: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Spodziewaj się, że kolumna `f` jest typu: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Spodziewaj się, że schematy kolumn będa zgodne\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"da\",\n locale = \"da\"\n ) %>%\n # Forvent at kolonne `a` er af typen: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Forvent at værdierne i `a` skal være imellem `1` og `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Forvent at kolonne `b` er af typen: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Forvent at kolonne `c` er af typen: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Forvent at værdierne i `c` skal være imellem `2` og `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Forvent at kolonne `d` er af typen: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Forvent at værdierne i `d` skal være imellem `108.34` og `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Forvent at kolonne `e` er af typen: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Forvent at kolonne `f` er af typen: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Forvent overensstemmelse med kolonne schema\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"da\",\n locale = \"da\"\n ) %>%\n # Forvent at kolonne `a` er af typen: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Forvent at værdierne i `a` skal være imellem `1` og `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Forvent at kolonne `b` er af typen: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Forvent at kolonne `c` er af typen: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Forvent at værdierne i `c` skal være imellem `2` og `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Forvent at kolonne `d` er af typen: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Forvent at værdierne i `d` skal være imellem `108.34` og `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Forvent at kolonne `e` er af typen: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Forvent at kolonne `f` er af typen: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Forvent overensstemmelse med kolonne schema\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"sv\",\n locale = \"sv\"\n ) %>%\n # Förvänta dig att kolumn `a` är av typen: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Förvänta dig att värdena i `a` ligger mellan `1` och `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Förvänta dig att kolumn `b` är av typen: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Förvänta dig att kolumn `c` är av typen: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Förvänta dig att värdena i `c` ligger mellan `2` och `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Förvänta dig att kolumn `d` är av typen: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Förvänta dig att värdena i `d` ligger mellan `108.34` och `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Förvänta dig att kolumn `e` är av typen: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Förvänta dig att kolumn `f` är av typen: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Förvänta överensstämmelse med kolumn schema\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"sv\",\n locale = \"sv\"\n ) %>%\n # Förvänta dig att kolumn `a` är av typen: integer\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Förvänta dig att värdena i `a` ligger mellan `1` och `8`\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Förvänta dig att kolumn `b` är av typen: character\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Förvänta dig att kolumn `c` är av typen: numeric\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Förvänta dig att värdena i `c` ligger mellan `2` och `9`\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Förvänta dig att kolumn `d` är av typen: numeric\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Förvänta dig att värdena i `d` ligger mellan `108.34` och `9999.99`\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Förvänta dig att kolumn `e` är av typen: logical\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Förvänta dig att kolumn `f` är av typen: character\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Förvänta överensstämmelse med kolumn schema\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"nl\",\n locale = \"nl\"\n ) %>%\n # Verwacht dat de kolom `a` van het type integer is\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Verwacht dat de waarden in `a` tussen `1` en `8` moeten liggen\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Verwacht dat de kolom `b` van het type character is\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Verwacht dat de kolom `c` van het type numeric is\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Verwacht dat de waarden in `c` tussen `2` en `9` moeten liggen\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Verwacht dat de kolom `d` van het type numeric is\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Verwacht dat de waarden in `d` tussen `108.34` en `9999.99` moeten liggen\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Verwacht dat de kolom `e` van het type logical is\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Verwacht dat de kolom `f` van het type character is\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Verwacht dat de kolomschema's overeenkomen\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\",\n lang = \"nl\",\n locale = \"nl\"\n ) %>%\n # Verwacht dat de kolom `a` van het type integer is\n col_is_integer(\n columns = c(\"a\")\n ) %>%\n # Verwacht dat de waarden in `a` tussen `1` en `8` moeten liggen\n col_vals_between(\n columns = c(\"a\"),\n left = 1,\n right = 8\n ) %>%\n # Verwacht dat de kolom `b` van het type character is\n col_is_character(\n columns = c(\"b\")\n ) %>%\n # Verwacht dat de kolom `c` van het type numeric is\n col_is_numeric(\n columns = c(\"c\")\n ) %>%\n # Verwacht dat de waarden in `c` tussen `2` en `9` moeten liggen\n col_vals_between(\n columns = c(\"c\"),\n left = 2,\n right = 9,\n na_pass = TRUE\n ) %>%\n # Verwacht dat de kolom `d` van het type numeric is\n col_is_numeric(\n columns = c(\"d\")\n ) %>%\n # Verwacht dat de waarden in `d` tussen `108.34` en `9999.99` moeten liggen\n col_vals_between(\n columns = c(\"d\"),\n left = 108.34,\n right = 9999.99\n ) %>%\n # Verwacht dat de kolom `e` van het type logical is\n col_is_logical(\n columns = c(\"e\")\n ) %>%\n # Verwacht dat de kolom `f` van het type character is\n col_is_character(\n columns = c(\"f\")\n ) %>%\n # Verwacht dat de kolomschema's overeenkomen\n col_schema_match(\n schema = col_schema(\n date_time = c(\"POSIXct\", \"POSIXt\"),\n date = \"Date\",\n a = \"integer\",\n b = \"character\",\n c = \"numeric\",\n d = \"numeric\",\n e = \"logical\",\n f = \"character\"\n )\n ) %>%\n interrogate()\n\nagent" # draft validations for data tables can be generated in .Rmd format Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `country_name` is of type: character\n col_is_character(\n columns = c(\"country_name\")\n ) %>%\n # Expect that values in `country_name` should be in the set of `Aruba`, `Afghanistan`, `Angola` (and 212 more)\n col_vals_in_set(\n columns = c(\"country_name\"),\n set = c(\"Aruba\", \"Afghanistan\", \"Angola\", \"Albania\", \"Andorra\", \"United Arab Emirates\", \"Argentina\", \"Armenia\", \"American Samoa\", \"Antigua & Barbuda\", \"Australia\", \"Austria\", \"Azerbaijan\", \"Burundi\", \"Belgium\", \"Benin\", \"Burkina Faso\", \"Bangladesh\", \"Bulgaria\", \"Bahrain\", \"Bahamas\", \"Bosnia & Herzegovina\", \"Belarus\", \"Belize\", \"Bermuda\", \"Bolivia\", \"Brazil\", \"Barbados\", \"Brunei\", \"Bhutan\", \"Botswana\", \"Central African Republic\", \"Canada\", \"Switzerland\", \"Chile\", \"China\", \"Cote d'Ivoire\", \"Cameroon\", \"Congo (DRC)\", \"Congo (Republic)\", \"Colombia\", \"Comoros\", \"Cape Verde\", \"Costa Rica\", \"Cuba\", \"Curacao\", \"Cayman Islands\", \"Cyprus\", \"Czech Republic\", \"Germany\", \"Djibouti\", \"Dominica\", \"Denmark\", \"Dominican Republic\", \"Algeria\", \"Ecuador\", \"Egypt\", \"Eritrea\", \"Spain\", \"Estonia\", \"Ethiopia\", \"Finland\", \"Fiji\", \"France\", \"Faroe Islands\", \"Micronesia\", \"Gabon\", \"United Kingdom\", \"Georgia\", \"Ghana\", \"Gibraltar\", \"Guinea\", \"Gambia\", \"Guinea-Bissau\", \"Equatorial Guinea\", \"Greece\", \"Grenada\", \"Greenland\", \"Guatemala\", \"Guam\", \"Guyana\", \"Hong Kong\", \"Honduras\", \"Croatia\", \"Haiti\", \"Hungary\", \"Indonesia\", \"Isle of Man\", \"India\", \"Ireland\", \"Iran\", \"Iraq\", \"Iceland\", \"Israel\", \"Italy\", \"Jamaica\", \"Jordan\", \"Japan\", \"Kazakhstan\", \"Kenya\", \"Kyrgyzstan\", \"Cambodia\", \"Kiribati\", \"St. Kitts & Nevis\", \"South Korea\", \"Kuwait\", \"Laos\", \"Lebanon\", \"Liberia\", \"Libya\", \"St. Lucia\", \"Liechtenstein\", \"Sri Lanka\", \"Lesotho\", \"Lithuania\", \"Luxembourg\", \"Latvia\", \"Macao\", \"St. Martin\", \"Morocco\", \"Monaco\", \"Moldova\", \"Madagascar\", \"Maldives\", \"Mexico\", \"Marshall Islands\", \"North Macedonia\", \"Mali\", \"Malta\", \"Myanmar\", \"Montenegro\", \"Mongolia\", \"Northern Mariana Islands\", \"Mozambique\", \"Mauritania\", \"Mauritius\", \"Malawi\", \"Malaysia\", \"Namibia\", \"New Caledonia\", \"Niger\", \"Nigeria\", \"Nicaragua\", \"Netherlands\", \"Norway\", \"Nepal\", \"Nauru\", \"New Zealand\", \"Oman\", \"Pakistan\", \"Panama\", \"Peru\", \"Philippines\", \"Palau\", \"Papua New Guinea\", \"Poland\", \"Puerto Rico\", \"North Korea\", \"Portugal\", \"Paraguay\", \"Palestine\", \"French Polynesia\", \"Qatar\", \"Romania\", \"Russia\", \"Rwanda\", \"Saudi Arabia\", \"Sudan\", \"Senegal\", \"Singapore\", \"Solomon Islands\", \"Sierra Leone\", \"El Salvador\", \"San Marino\", \"Somalia\", \"Serbia\", \"South Sudan\", \"Sao Tome & Principe\", \"Suriname\", \"Slovakia\", \"Slovenia\", \"Sweden\", \"Eswatini\", \"Sint Maarten\", \"Seychelles\", \"Syria\", \"Turks & Caicos Islands\", \"Chad\", \"Togo\", \"Thailand\", \"Tajikistan\", \"Turkmenistan\", \"East Timor\", \"Tonga\", \"Trinidad & Tobago\", \"Tunisia\", \"Turkey\", \"Tuvalu\", \"Tanzania\", \"Uganda\", \"Ukraine\", \"Uruguay\", \"United States\", \"Uzbekistan\", \"St. Vincent & Grenadines\", \"Venezuela\", \"British Virgin Islands\", \"U.S. Virgin Islands\", \"Vietnam\", \"Vanuatu\", \"Samoa\", \"Yemen\", \"South Africa\", \"Zambia\", \"Zimbabwe\")\n ) %>%\n # Expect that column `country_code_2` is of type: character\n col_is_character(\n columns = c(\"country_code_2\")\n ) %>%\n # Expect that values in `country_code_2` should be in the set of `AD`, `AE`, `AF` (and 246 more)\n col_vals_in_set(\n columns = c(\"country_code_2\"),\n set = c(\"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\")\n ) %>%\n # Expect that column `country_code_3` is of type: character\n col_is_character(\n columns = c(\"country_code_3\")\n ) %>%\n # Expect that values in `country_code_3` should be in the set of `AND`, `ARE`, `AFG` (and 246 more)\n col_vals_in_set(\n columns = c(\"country_code_3\"),\n set = c(\"AND\", \"ARE\", \"AFG\", \"ATG\", \"AIA\", \"ALB\", \"ARM\", \"AGO\", \"ATA\", \"ARG\", \"ASM\", \"AUT\", \"AUS\", \"ABW\", \"ALA\", \"AZE\", \"BIH\", \"BRB\", \"BGD\", \"BEL\", \"BFA\", \"BGR\", \"BHR\", \"BDI\", \"BEN\", \"BLM\", \"BMU\", \"BRN\", \"BOL\", \"BES\", \"BRA\", \"BHS\", \"BTN\", \"BVT\", \"BWA\", \"BLR\", \"BLZ\", \"CAN\", \"CCK\", \"COD\", \"CAF\", \"COG\", \"CHE\", \"CIV\", \"COK\", \"CHL\", \"CMR\", \"CHN\", \"COL\", \"CRI\", \"CUB\", \"CPV\", \"CUW\", \"CXR\", \"CYP\", \"CZE\", \"DEU\", \"DJI\", \"DNK\", \"DMA\", \"DOM\", \"DZA\", \"ECU\", \"EST\", \"EGY\", \"ESH\", \"ERI\", \"ESP\", \"ETH\", \"FIN\", \"FJI\", \"FLK\", \"FSM\", \"FRO\", \"FRA\", \"GAB\", \"GBR\", \"GRD\", \"GEO\", \"GUF\", \"GGY\", \"GHA\", \"GIB\", \"GRL\", \"GMB\", \"GIN\", \"GLP\", \"GNQ\", \"GRC\", \"SGS\", \"GTM\", \"GUM\", \"GNB\", \"GUY\", \"HKG\", \"HMD\", \"HND\", \"HRV\", \"HTI\", \"HUN\", \"IDN\", \"IRL\", \"ISR\", \"IMN\", \"IND\", \"IOT\", \"IRQ\", \"IRN\", \"ISL\", \"ITA\", \"JEY\", \"JAM\", \"JOR\", \"JPN\", \"KEN\", \"KGZ\", \"KHM\", \"KIR\", \"COM\", \"KNA\", \"PRK\", \"KOR\", \"KWT\", \"CYM\", \"KAZ\", \"LAO\", \"LBN\", \"LCA\", \"LIE\", \"LKA\", \"LBR\", \"LSO\", \"LTU\", \"LUX\", \"LVA\", \"LBY\", \"MAR\", \"MCO\", \"MDA\", \"MNE\", \"MAF\", \"MDG\", \"MHL\", \"MKD\", \"MLI\", \"MMR\", \"MNG\", \"MAC\", \"MNP\", \"MTQ\", \"MRT\", \"MSR\", \"MLT\", \"MUS\", \"MDV\", \"MWI\", \"MEX\", \"MYS\", \"MOZ\", \"NAM\", \"NCL\", \"NER\", \"NFK\", \"NGA\", \"NIC\", \"NLD\", \"NOR\", \"NPL\", \"NRU\", \"NIU\", \"NZL\", \"OMN\", \"PAN\", \"PER\", \"PYF\", \"PNG\", \"PHL\", \"PAK\", \"POL\", \"SPM\", \"PCN\", \"PRI\", \"PSE\", \"PRT\", \"PLW\", \"PRY\", \"QAT\", \"REU\", \"ROU\", \"SRB\", \"RUS\", \"RWA\", \"SAU\", \"SLB\", \"SYC\", \"SDN\", \"SWE\", \"SGP\", \"SHN\", \"SVN\", \"SJM\", \"SVK\", \"SLE\", \"SMR\", \"SEN\", \"SOM\", \"SUR\", \"SSD\", \"STP\", \"SLV\", \"SXM\", \"SYR\", \"SWZ\", \"TCA\", \"TCD\", \"ATF\", \"TGO\", \"THA\", \"TJK\", \"TKL\", \"TLS\", \"TKM\", \"TUN\", \"TON\", \"TUR\", \"TTO\", \"TUV\", \"TWN\", \"TZA\", \"UKR\", \"UGA\", \"UMI\", \"USA\", \"URY\", \"UZB\", \"VAT\", \"VCT\", \"VEN\", \"VGB\", \"VIR\", \"VNM\", \"VUT\", \"WLF\", \"WSM\", \"YEM\", \"MYT\", \"ZAF\", \"ZMB\", \"ZWE\")\n ) %>%\n # Expect that column `year` is of type: integer\n col_is_integer(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `1960` and `2023`\n col_vals_between(\n columns = c(\"year\"),\n left = 1960,\n right = 2023\n ) %>%\n # Expect that column `population` is of type: integer\n col_is_integer(\n columns = c(\"population\")\n ) %>%\n # Expect that values in `population` should be between `2646` and `1428627663`\n col_vals_between(\n columns = c(\"population\"),\n left = 2646,\n right = 1428627700,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `country_name, country_code_2, country_code_3, year, population`\n rows_distinct(\n columns = c(\"country_name\", \"country_code_2\", \"country_code_3\", \"year\", \"population\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n country_name = \"character\",\n country_code_2 = \"character\",\n country_code_3 = \"character\",\n year = \"integer\",\n population = \"integer\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" + [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `country_name` is of type: character\n col_is_character(\n columns = c(\"country_name\")\n ) %>%\n # Expect that values in `country_name` should be in the set of `Aruba`, `Afghanistan`, `Angola` (and 212 more)\n col_vals_in_set(\n columns = c(\"country_name\"),\n set = c(\"Aruba\", \"Afghanistan\", \"Angola\", \"Albania\", \"Andorra\", \"United Arab Emirates\", \"Argentina\", \"Armenia\", \"American Samoa\", \"Antigua & Barbuda\", \"Australia\", \"Austria\", \"Azerbaijan\", \"Burundi\", \"Belgium\", \"Benin\", \"Burkina Faso\", \"Bangladesh\", \"Bulgaria\", \"Bahrain\", \"Bahamas\", \"Bosnia & Herzegovina\", \"Belarus\", \"Belize\", \"Bermuda\", \"Bolivia\", \"Brazil\", \"Barbados\", \"Brunei\", \"Bhutan\", \"Botswana\", \"Central African Republic\", \"Canada\", \"Switzerland\", \"Chile\", \"China\", \"Cote d'Ivoire\", \"Cameroon\", \"Congo (DRC)\", \"Congo (Republic)\", \"Colombia\", \"Comoros\", \"Cape Verde\", \"Costa Rica\", \"Cuba\", \"Curacao\", \"Cayman Islands\", \"Cyprus\", \"Czech Republic\", \"Germany\", \"Djibouti\", \"Dominica\", \"Denmark\", \"Dominican Republic\", \"Algeria\", \"Ecuador\", \"Egypt\", \"Eritrea\", \"Spain\", \"Estonia\", \"Ethiopia\", \"Finland\", \"Fiji\", \"France\", \"Faroe Islands\", \"Micronesia\", \"Gabon\", \"United Kingdom\", \"Georgia\", \"Ghana\", \"Gibraltar\", \"Guinea\", \"Gambia\", \"Guinea-Bissau\", \"Equatorial Guinea\", \"Greece\", \"Grenada\", \"Greenland\", \"Guatemala\", \"Guam\", \"Guyana\", \"Hong Kong\", \"Honduras\", \"Croatia\", \"Haiti\", \"Hungary\", \"Indonesia\", \"Isle of Man\", \"India\", \"Ireland\", \"Iran\", \"Iraq\", \"Iceland\", \"Israel\", \"Italy\", \"Jamaica\", \"Jordan\", \"Japan\", \"Kazakhstan\", \"Kenya\", \"Kyrgyzstan\", \"Cambodia\", \"Kiribati\", \"St. Kitts & Nevis\", \"South Korea\", \"Kuwait\", \"Laos\", \"Lebanon\", \"Liberia\", \"Libya\", \"St. Lucia\", \"Liechtenstein\", \"Sri Lanka\", \"Lesotho\", \"Lithuania\", \"Luxembourg\", \"Latvia\", \"Macao\", \"St. Martin\", \"Morocco\", \"Monaco\", \"Moldova\", \"Madagascar\", \"Maldives\", \"Mexico\", \"Marshall Islands\", \"North Macedonia\", \"Mali\", \"Malta\", \"Myanmar\", \"Montenegro\", \"Mongolia\", \"Northern Mariana Islands\", \"Mozambique\", \"Mauritania\", \"Mauritius\", \"Malawi\", \"Malaysia\", \"Namibia\", \"New Caledonia\", \"Niger\", \"Nigeria\", \"Nicaragua\", \"Netherlands\", \"Norway\", \"Nepal\", \"Nauru\", \"New Zealand\", \"Oman\", \"Pakistan\", \"Panama\", \"Peru\", \"Philippines\", \"Palau\", \"Papua New Guinea\", \"Poland\", \"Puerto Rico\", \"North Korea\", \"Portugal\", \"Paraguay\", \"Palestine\", \"French Polynesia\", \"Qatar\", \"Romania\", \"Russia\", \"Rwanda\", \"Saudi Arabia\", \"Sudan\", \"Senegal\", \"Singapore\", \"Solomon Islands\", \"Sierra Leone\", \"El Salvador\", \"San Marino\", \"Somalia\", \"Serbia\", \"South Sudan\", \"Sao Tome & Principe\", \"Suriname\", \"Slovakia\", \"Slovenia\", \"Sweden\", \"Eswatini\", \"Sint Maarten\", \"Seychelles\", \"Syria\", \"Turks & Caicos Islands\", \"Chad\", \"Togo\", \"Thailand\", \"Tajikistan\", \"Turkmenistan\", \"East Timor\", \"Tonga\", \"Trinidad & Tobago\", \"Tunisia\", \"Turkey\", \"Tuvalu\", \"Tanzania\", \"Uganda\", \"Ukraine\", \"Uruguay\", \"United States\", \"Uzbekistan\", \"St. Vincent & Grenadines\", \"Venezuela\", \"British Virgin Islands\", \"U.S. Virgin Islands\", \"Vietnam\", \"Vanuatu\", \"Samoa\", \"Yemen\", \"South Africa\", \"Zambia\", \"Zimbabwe\")\n ) %>%\n # Expect that column `country_code_2` is of type: character\n col_is_character(\n columns = c(\"country_code_2\")\n ) %>%\n # Expect that values in `country_code_2` should be in the set of `AD`, `AE`, `AF` (and 246 more)\n col_vals_in_set(\n columns = c(\"country_code_2\"),\n set = c(\"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\")\n ) %>%\n # Expect that column `country_code_3` is of type: character\n col_is_character(\n columns = c(\"country_code_3\")\n ) %>%\n # Expect that values in `country_code_3` should be in the set of `AND`, `ARE`, `AFG` (and 246 more)\n col_vals_in_set(\n columns = c(\"country_code_3\"),\n set = c(\"AND\", \"ARE\", \"AFG\", \"ATG\", \"AIA\", \"ALB\", \"ARM\", \"AGO\", \"ATA\", \"ARG\", \"ASM\", \"AUT\", \"AUS\", \"ABW\", \"ALA\", \"AZE\", \"BIH\", \"BRB\", \"BGD\", \"BEL\", \"BFA\", \"BGR\", \"BHR\", \"BDI\", \"BEN\", \"BLM\", \"BMU\", \"BRN\", \"BOL\", \"BES\", \"BRA\", \"BHS\", \"BTN\", \"BVT\", \"BWA\", \"BLR\", \"BLZ\", \"CAN\", \"CCK\", \"COD\", \"CAF\", \"COG\", \"CHE\", \"CIV\", \"COK\", \"CHL\", \"CMR\", \"CHN\", \"COL\", \"CRI\", \"CUB\", \"CPV\", \"CUW\", \"CXR\", \"CYP\", \"CZE\", \"DEU\", \"DJI\", \"DNK\", \"DMA\", \"DOM\", \"DZA\", \"ECU\", \"EST\", \"EGY\", \"ESH\", \"ERI\", \"ESP\", \"ETH\", \"FIN\", \"FJI\", \"FLK\", \"FSM\", \"FRO\", \"FRA\", \"GAB\", \"GBR\", \"GRD\", \"GEO\", \"GUF\", \"GGY\", \"GHA\", \"GIB\", \"GRL\", \"GMB\", \"GIN\", \"GLP\", \"GNQ\", \"GRC\", \"SGS\", \"GTM\", \"GUM\", \"GNB\", \"GUY\", \"HKG\", \"HMD\", \"HND\", \"HRV\", \"HTI\", \"HUN\", \"IDN\", \"IRL\", \"ISR\", \"IMN\", \"IND\", \"IOT\", \"IRQ\", \"IRN\", \"ISL\", \"ITA\", \"JEY\", \"JAM\", \"JOR\", \"JPN\", \"KEN\", \"KGZ\", \"KHM\", \"KIR\", \"COM\", \"KNA\", \"PRK\", \"KOR\", \"KWT\", \"CYM\", \"KAZ\", \"LAO\", \"LBN\", \"LCA\", \"LIE\", \"LKA\", \"LBR\", \"LSO\", \"LTU\", \"LUX\", \"LVA\", \"LBY\", \"MAR\", \"MCO\", \"MDA\", \"MNE\", \"MAF\", \"MDG\", \"MHL\", \"MKD\", \"MLI\", \"MMR\", \"MNG\", \"MAC\", \"MNP\", \"MTQ\", \"MRT\", \"MSR\", \"MLT\", \"MUS\", \"MDV\", \"MWI\", \"MEX\", \"MYS\", \"MOZ\", \"NAM\", \"NCL\", \"NER\", \"NFK\", \"NGA\", \"NIC\", \"NLD\", \"NOR\", \"NPL\", \"NRU\", \"NIU\", \"NZL\", \"OMN\", \"PAN\", \"PER\", \"PYF\", \"PNG\", \"PHL\", \"PAK\", \"POL\", \"SPM\", \"PCN\", \"PRI\", \"PSE\", \"PRT\", \"PLW\", \"PRY\", \"QAT\", \"REU\", \"ROU\", \"SRB\", \"RUS\", \"RWA\", \"SAU\", \"SLB\", \"SYC\", \"SDN\", \"SWE\", \"SGP\", \"SHN\", \"SVN\", \"SJM\", \"SVK\", \"SLE\", \"SMR\", \"SEN\", \"SOM\", \"SUR\", \"SSD\", \"STP\", \"SLV\", \"SXM\", \"SYR\", \"SWZ\", \"TCA\", \"TCD\", \"ATF\", \"TGO\", \"THA\", \"TJK\", \"TKL\", \"TLS\", \"TKM\", \"TUN\", \"TON\", \"TUR\", \"TTO\", \"TUV\", \"TWN\", \"TZA\", \"UKR\", \"UGA\", \"UMI\", \"USA\", \"URY\", \"UZB\", \"VAT\", \"VCT\", \"VEN\", \"VGB\", \"VIR\", \"VNM\", \"VUT\", \"WLF\", \"WSM\", \"YEM\", \"MYT\", \"ZAF\", \"ZMB\", \"ZWE\")\n ) %>%\n # Expect that column `year` is of type: integer\n col_is_integer(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `1960` and `2023`\n col_vals_between(\n columns = c(\"year\"),\n left = 1960,\n right = 2023\n ) %>%\n # Expect that column `population` is of type: integer\n col_is_integer(\n columns = c(\"population\")\n ) %>%\n # Expect that values in `population` should be between `2646` and `1428627663`\n col_vals_between(\n columns = c(\"population\"),\n left = 2646,\n right = 1428627700,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `country_name, country_code_2, country_code_3, year, population`\n rows_distinct(\n columns = c(\"country_name\", \"country_code_2\", \"country_code_3\", \"year\", \"population\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n country_name = \"character\",\n country_code_2 = \"character\",\n country_code_3 = \"character\",\n year = \"integer\",\n population = \"integer\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `latitude` is of type: numeric\n col_is_numeric(\n columns = c(\"latitude\")\n ) %>%\n # Expect that values in `latitude` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"latitude\"),\n left = -90,\n right = 90\n ) %>%\n # Expect that column `month` is of type: factor\n col_is_factor(\n columns = c(\"month\")\n ) %>%\n # Expect that column `tst` is of type: character\n col_is_character(\n columns = c(\"tst\")\n ) %>%\n # Expect that column `sza` is of type: numeric\n col_is_numeric(\n columns = c(\"sza\")\n ) %>%\n # Expect that values in `sza` should be between `1.9` and `89.7`\n col_vals_between(\n columns = c(\"sza\"),\n left = 1.9,\n right = 89.7,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `latitude, month, tst, sza`\n rows_distinct(\n columns = c(\"latitude\", \"month\", \"tst\", \"sza\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n latitude = \"numeric\",\n month = \"factor\",\n tst = \"character\",\n sza = \"numeric\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" + [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `latitude` is of type: numeric\n col_is_numeric(\n columns = c(\"latitude\")\n ) %>%\n # Expect that values in `latitude` should be between `-90` and `90`\n col_vals_between(\n columns = c(\"latitude\"),\n left = -90,\n right = 90\n ) %>%\n # Expect that column `month` is of type: factor\n col_is_factor(\n columns = c(\"month\")\n ) %>%\n # Expect that column `tst` is of type: character\n col_is_character(\n columns = c(\"tst\")\n ) %>%\n # Expect that column `sza` is of type: numeric\n col_is_numeric(\n columns = c(\"sza\")\n ) %>%\n # Expect that values in `sza` should be between `1.9` and `89.7`\n col_vals_between(\n columns = c(\"sza\"),\n left = 1.9,\n right = 89.7,\n na_pass = TRUE\n ) %>%\n # Expect entirely distinct rows across `latitude, month, tst, sza`\n rows_distinct(\n columns = c(\"latitude\", \"month\", \"tst\", \"sza\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n latitude = \"numeric\",\n month = \"factor\",\n tst = \"character\",\n sza = \"numeric\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `mfr` is of type: character\n col_is_character(\n columns = c(\"mfr\")\n ) %>%\n # Expect that column `model` is of type: character\n col_is_character(\n columns = c(\"model\")\n ) %>%\n # Expect that column `year` is of type: numeric\n col_is_numeric(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `2014` and `2017`\n col_vals_between(\n columns = c(\"year\"),\n left = 2014,\n right = 2017\n ) %>%\n # Expect that column `trim` is of type: character\n col_is_character(\n columns = c(\"trim\")\n ) %>%\n # Expect that column `bdy_style` is of type: character\n col_is_character(\n columns = c(\"bdy_style\")\n ) %>%\n # Expect that column `hp` is of type: numeric\n col_is_numeric(\n columns = c(\"hp\")\n ) %>%\n # Expect that values in `hp` should be between `259` and `949`\n col_vals_between(\n columns = c(\"hp\"),\n left = 259,\n right = 949\n ) %>%\n # Expect that column `hp_rpm` is of type: numeric\n col_is_numeric(\n columns = c(\"hp_rpm\")\n ) %>%\n # Expect that values in `hp_rpm` should be between `5000` and `9000`\n col_vals_between(\n columns = c(\"hp_rpm\"),\n left = 5000,\n right = 9000\n ) %>%\n # Expect that column `trq` is of type: numeric\n col_is_numeric(\n columns = c(\"trq\")\n ) %>%\n # Expect that values in `trq` should be between `243` and `664`\n col_vals_between(\n columns = c(\"trq\"),\n left = 243,\n right = 664\n ) %>%\n # Expect that column `trq_rpm` is of type: numeric\n col_is_numeric(\n columns = c(\"trq_rpm\")\n ) %>%\n # Expect that values in `trq_rpm` should be between `1400` and `6750`\n col_vals_between(\n columns = c(\"trq_rpm\"),\n left = 1400,\n right = 6750,\n na_pass = TRUE\n ) %>%\n # Expect that column `mpg_c` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg_c\")\n ) %>%\n # Expect that values in `mpg_c` should be between `11` and `28`\n col_vals_between(\n columns = c(\"mpg_c\"),\n left = 11,\n right = 28,\n na_pass = TRUE\n ) %>%\n # Expect that column `mpg_h` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg_h\")\n ) %>%\n # Expect that values in `mpg_h` should be between `16` and `30`\n col_vals_between(\n columns = c(\"mpg_h\"),\n left = 16,\n right = 30,\n na_pass = TRUE\n ) %>%\n # Expect that column `drivetrain` is of type: character\n col_is_character(\n columns = c(\"drivetrain\")\n ) %>%\n # Expect that column `trsmn` is of type: character\n col_is_character(\n columns = c(\"trsmn\")\n ) %>%\n # Expect that column `ctry_origin` is of type: character\n col_is_character(\n columns = c(\"ctry_origin\")\n ) %>%\n # Expect that values in `ctry_origin` should be in the set of `United States`, `Italy`, `Japan` (and 2 more)\n col_vals_in_set(\n columns = c(\"ctry_origin\"),\n set = c(\"United States\", \"Italy\", \"Japan\", \"United Kingdom\", \"Germany\")\n ) %>%\n # Expect that column `msrp` is of type: numeric\n col_is_numeric(\n columns = c(\"msrp\")\n ) %>%\n # Expect that values in `msrp` should be between `53900` and `1416362`\n col_vals_between(\n columns = c(\"msrp\"),\n left = 53900,\n right = 1416362\n ) %>%\n # Expect entirely distinct rows across `mfr, model, year, trim, bdy_style, hp, hp_rpm, trq, trq_rpm, mpg_c, mpg_h, drivetrain, trsmn, ctry_origin, msrp`\n rows_distinct(\n columns = c(\"mfr\", \"model\", \"year\", \"trim\", \"bdy_style\", \"hp\", \"hp_rpm\", \"trq\", \"trq_rpm\", \"mpg_c\", \"mpg_h\", \"drivetrain\", \"trsmn\", \"ctry_origin\", \"msrp\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n mfr = \"character\",\n model = \"character\",\n year = \"numeric\",\n trim = \"character\",\n bdy_style = \"character\",\n hp = \"numeric\",\n hp_rpm = \"numeric\",\n trq = \"numeric\",\n trq_rpm = \"numeric\",\n mpg_c = \"numeric\",\n mpg_h = \"numeric\",\n drivetrain = \"character\",\n trsmn = \"character\",\n ctry_origin = \"character\",\n msrp = \"numeric\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" + [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `mfr` is of type: character\n col_is_character(\n columns = c(\"mfr\")\n ) %>%\n # Expect that column `model` is of type: character\n col_is_character(\n columns = c(\"model\")\n ) %>%\n # Expect that column `year` is of type: numeric\n col_is_numeric(\n columns = c(\"year\")\n ) %>%\n # Expect that values in `year` should be between `2014` and `2017`\n col_vals_between(\n columns = c(\"year\"),\n left = 2014,\n right = 2017\n ) %>%\n # Expect that column `trim` is of type: character\n col_is_character(\n columns = c(\"trim\")\n ) %>%\n # Expect that column `bdy_style` is of type: character\n col_is_character(\n columns = c(\"bdy_style\")\n ) %>%\n # Expect that column `hp` is of type: numeric\n col_is_numeric(\n columns = c(\"hp\")\n ) %>%\n # Expect that values in `hp` should be between `259` and `949`\n col_vals_between(\n columns = c(\"hp\"),\n left = 259,\n right = 949\n ) %>%\n # Expect that column `hp_rpm` is of type: numeric\n col_is_numeric(\n columns = c(\"hp_rpm\")\n ) %>%\n # Expect that values in `hp_rpm` should be between `5000` and `9000`\n col_vals_between(\n columns = c(\"hp_rpm\"),\n left = 5000,\n right = 9000\n ) %>%\n # Expect that column `trq` is of type: numeric\n col_is_numeric(\n columns = c(\"trq\")\n ) %>%\n # Expect that values in `trq` should be between `243` and `664`\n col_vals_between(\n columns = c(\"trq\"),\n left = 243,\n right = 664\n ) %>%\n # Expect that column `trq_rpm` is of type: numeric\n col_is_numeric(\n columns = c(\"trq_rpm\")\n ) %>%\n # Expect that values in `trq_rpm` should be between `1400` and `6750`\n col_vals_between(\n columns = c(\"trq_rpm\"),\n left = 1400,\n right = 6750,\n na_pass = TRUE\n ) %>%\n # Expect that column `mpg_c` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg_c\")\n ) %>%\n # Expect that values in `mpg_c` should be between `11` and `28`\n col_vals_between(\n columns = c(\"mpg_c\"),\n left = 11,\n right = 28,\n na_pass = TRUE\n ) %>%\n # Expect that column `mpg_h` is of type: numeric\n col_is_numeric(\n columns = c(\"mpg_h\")\n ) %>%\n # Expect that values in `mpg_h` should be between `16` and `30`\n col_vals_between(\n columns = c(\"mpg_h\"),\n left = 16,\n right = 30,\n na_pass = TRUE\n ) %>%\n # Expect that column `drivetrain` is of type: character\n col_is_character(\n columns = c(\"drivetrain\")\n ) %>%\n # Expect that column `trsmn` is of type: character\n col_is_character(\n columns = c(\"trsmn\")\n ) %>%\n # Expect that column `ctry_origin` is of type: character\n col_is_character(\n columns = c(\"ctry_origin\")\n ) %>%\n # Expect that values in `ctry_origin` should be in the set of `United States`, `Italy`, `Japan` (and 2 more)\n col_vals_in_set(\n columns = c(\"ctry_origin\"),\n set = c(\"United States\", \"Italy\", \"Japan\", \"United Kingdom\", \"Germany\")\n ) %>%\n # Expect that column `msrp` is of type: numeric\n col_is_numeric(\n columns = c(\"msrp\")\n ) %>%\n # Expect that values in `msrp` should be between `53900` and `1416362`\n col_vals_between(\n columns = c(\"msrp\"),\n left = 53900,\n right = 1416362\n ) %>%\n # Expect entirely distinct rows across `mfr, model, year, trim, bdy_style, hp, hp_rpm, trq, trq_rpm, mpg_c, mpg_h, drivetrain, trsmn, ctry_origin, msrp`\n rows_distinct(\n columns = c(\"mfr\", \"model\", \"year\", \"trim\", \"bdy_style\", \"hp\", \"hp_rpm\", \"trq\", \"trq_rpm\", \"mpg_c\", \"mpg_h\", \"drivetrain\", \"trsmn\", \"ctry_origin\", \"msrp\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n mfr = \"character\",\n model = \"character\",\n year = \"numeric\",\n trim = \"character\",\n bdy_style = \"character\",\n hp = \"numeric\",\n hp_rpm = \"numeric\",\n trq = \"numeric\",\n trq_rpm = \"numeric\",\n mpg_c = \"numeric\",\n mpg_h = \"numeric\",\n drivetrain = \"character\",\n trsmn = \"character\",\n ctry_origin = \"character\",\n msrp = \"numeric\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `open` is of type: numeric\n col_is_numeric(\n columns = c(\"open\")\n ) %>%\n # Expect that values in `open` should be between `16.66` and `2130.3601`\n col_vals_between(\n columns = c(\"open\"),\n left = 16.66,\n right = 2130.3601\n ) %>%\n # Expect that column `high` is of type: numeric\n col_is_numeric(\n columns = c(\"high\")\n ) %>%\n # Expect that values in `high` should be between `16.66` and `2134.72`\n col_vals_between(\n columns = c(\"high\"),\n left = 16.66,\n right = 2134.72\n ) %>%\n # Expect that column `low` is of type: numeric\n col_is_numeric(\n columns = c(\"low\")\n ) %>%\n # Expect that values in `low` should be between `16.66` and `2126.0601`\n col_vals_between(\n columns = c(\"low\"),\n left = 16.66,\n right = 2126.0601\n ) %>%\n # Expect that column `close` is of type: numeric\n col_is_numeric(\n columns = c(\"close\")\n ) %>%\n # Expect that values in `close` should be between `16.66` and `2130.8201`\n col_vals_between(\n columns = c(\"close\"),\n left = 16.66,\n right = 2130.8201\n ) %>%\n # Expect that column `volume` is of type: numeric\n col_is_numeric(\n columns = c(\"volume\")\n ) %>%\n # Expect that values in `volume` should be between `680000` and `11456230400`\n col_vals_between(\n columns = c(\"volume\"),\n left = 680000,\n right = 11456230000\n ) %>%\n # Expect that column `adj_close` is of type: numeric\n col_is_numeric(\n columns = c(\"adj_close\")\n ) %>%\n # Expect that values in `adj_close` should be between `16.66` and `2130.8201`\n col_vals_between(\n columns = c(\"adj_close\"),\n left = 16.66,\n right = 2130.8201\n ) %>%\n # Expect entirely distinct rows across `date, open, high, low, close, volume, adj_close`\n rows_distinct(\n columns = c(\"date\", \"open\", \"high\", \"low\", \"close\", \"volume\", \"adj_close\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date = \"Date\",\n open = \"numeric\",\n high = \"numeric\",\n low = \"numeric\",\n close = \"numeric\",\n volume = \"numeric\",\n adj_close = \"numeric\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" + [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `open` is of type: numeric\n col_is_numeric(\n columns = c(\"open\")\n ) %>%\n # Expect that values in `open` should be between `16.66` and `2130.3601`\n col_vals_between(\n columns = c(\"open\"),\n left = 16.66,\n right = 2130.3601\n ) %>%\n # Expect that column `high` is of type: numeric\n col_is_numeric(\n columns = c(\"high\")\n ) %>%\n # Expect that values in `high` should be between `16.66` and `2134.72`\n col_vals_between(\n columns = c(\"high\"),\n left = 16.66,\n right = 2134.72\n ) %>%\n # Expect that column `low` is of type: numeric\n col_is_numeric(\n columns = c(\"low\")\n ) %>%\n # Expect that values in `low` should be between `16.66` and `2126.0601`\n col_vals_between(\n columns = c(\"low\"),\n left = 16.66,\n right = 2126.0601\n ) %>%\n # Expect that column `close` is of type: numeric\n col_is_numeric(\n columns = c(\"close\")\n ) %>%\n # Expect that values in `close` should be between `16.66` and `2130.8201`\n col_vals_between(\n columns = c(\"close\"),\n left = 16.66,\n right = 2130.8201\n ) %>%\n # Expect that column `volume` is of type: numeric\n col_is_numeric(\n columns = c(\"volume\")\n ) %>%\n # Expect that values in `volume` should be between `680000` and `11456230400`\n col_vals_between(\n columns = c(\"volume\"),\n left = 680000,\n right = 11456230000\n ) %>%\n # Expect that column `adj_close` is of type: numeric\n col_is_numeric(\n columns = c(\"adj_close\")\n ) %>%\n # Expect that values in `adj_close` should be between `16.66` and `2130.8201`\n col_vals_between(\n columns = c(\"adj_close\"),\n left = 16.66,\n right = 2130.8201\n ) %>%\n # Expect entirely distinct rows across `date, open, high, low, close, volume, adj_close`\n rows_distinct(\n columns = c(\"date\", \"open\", \"high\", \"low\", \"close\", \"volume\", \"adj_close\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n date = \"Date\",\n open = \"numeric\",\n high = \"numeric\",\n low = \"numeric\",\n close = \"numeric\",\n volume = \"numeric\",\n adj_close = \"numeric\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `id` is of type: character\n col_is_character(\n columns = c(\"id\")\n ) %>%\n # Expect that column `date` is of type: character\n col_is_character(\n columns = c(\"date\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `size` is of type: character\n col_is_character(\n columns = c(\"size\")\n ) %>%\n # Expect that column `type` is of type: character\n col_is_character(\n columns = c(\"type\")\n ) %>%\n # Expect that column `price` is of type: numeric\n col_is_numeric(\n columns = c(\"price\")\n ) %>%\n # Expect that values in `price` should be between `9.75` and `35.95`\n col_vals_between(\n columns = c(\"price\"),\n left = 9.75,\n right = 35.95\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n id = \"character\",\n date = \"character\",\n time = \"character\",\n name = \"character\",\n size = \"character\",\n type = \"character\",\n price = \"numeric\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" + [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `id` is of type: character\n col_is_character(\n columns = c(\"id\")\n ) %>%\n # Expect that column `date` is of type: character\n col_is_character(\n columns = c(\"date\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `name` is of type: character\n col_is_character(\n columns = c(\"name\")\n ) %>%\n # Expect that column `size` is of type: character\n col_is_character(\n columns = c(\"size\")\n ) %>%\n # Expect that column `type` is of type: character\n col_is_character(\n columns = c(\"type\")\n ) %>%\n # Expect that column `price` is of type: numeric\n col_is_numeric(\n columns = c(\"price\")\n ) %>%\n # Expect that values in `price` should be between `9.75` and `35.95`\n col_vals_between(\n columns = c(\"price\"),\n left = 9.75,\n right = 35.95\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n id = \"character\",\n date = \"character\",\n time = \"character\",\n name = \"character\",\n size = \"character\",\n type = \"character\",\n price = \"numeric\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" --- Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `num` is of type: numeric\n col_is_numeric(\n columns = c(\"num\")\n ) %>%\n # Expect that values in `num` should be between `0.1111` and `8880000`\n col_vals_between(\n columns = c(\"num\"),\n left = 0.1111,\n right = 8880000,\n na_pass = TRUE\n ) %>%\n # Expect that column `char` is of type: character\n col_is_character(\n columns = c(\"char\")\n ) %>%\n # Expect that column `fctr` is of type: factor\n col_is_factor(\n columns = c(\"fctr\")\n ) %>%\n # Expect that column `date` is of type: character\n col_is_character(\n columns = c(\"date\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `datetime` is of type: character\n col_is_character(\n columns = c(\"datetime\")\n ) %>%\n # Expect that column `currency` is of type: numeric\n col_is_numeric(\n columns = c(\"currency\")\n ) %>%\n # Expect that values in `currency` should be between `0.44` and `65100`\n col_vals_between(\n columns = c(\"currency\"),\n left = 0.44,\n right = 65100,\n na_pass = TRUE\n ) %>%\n # Expect that column `row` is of type: character\n col_is_character(\n columns = c(\"row\")\n ) %>%\n # Expect that column `group` is of type: character\n col_is_character(\n columns = c(\"group\")\n ) %>%\n # Expect entirely distinct rows across `num, char, fctr, date, time, datetime, currency, row, group`\n rows_distinct(\n columns = c(\"num\", \"char\", \"fctr\", \"date\", \"time\", \"datetime\", \"currency\", \"row\", \"group\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n num = \"numeric\",\n char = \"character\",\n fctr = \"factor\",\n date = \"character\",\n time = \"character\",\n datetime = \"character\",\n currency = \"numeric\",\n row = \"character\",\n group = \"character\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" + [1] "---\ntitle: \"tbl\"\noutput: html_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\nlibrary(pointblank)\n```\n\n\n```{r create_agent, echo=TRUE}\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n # Expect that column `num` is of type: numeric\n col_is_numeric(\n columns = c(\"num\")\n ) %>%\n # Expect that values in `num` should be between `0.1111` and `8880000`\n col_vals_between(\n columns = c(\"num\"),\n left = 0.1111,\n right = 8880000,\n na_pass = TRUE\n ) %>%\n # Expect that column `char` is of type: character\n col_is_character(\n columns = c(\"char\")\n ) %>%\n # Expect that column `fctr` is of type: factor\n col_is_factor(\n columns = c(\"fctr\")\n ) %>%\n # Expect that column `date` is of type: character\n col_is_character(\n columns = c(\"date\")\n ) %>%\n # Expect that column `time` is of type: character\n col_is_character(\n columns = c(\"time\")\n ) %>%\n # Expect that column `datetime` is of type: character\n col_is_character(\n columns = c(\"datetime\")\n ) %>%\n # Expect that column `currency` is of type: numeric\n col_is_numeric(\n columns = c(\"currency\")\n ) %>%\n # Expect that values in `currency` should be between `0.44` and `65100`\n col_vals_between(\n columns = c(\"currency\"),\n left = 0.44,\n right = 65100,\n na_pass = TRUE\n ) %>%\n # Expect that column `row` is of type: character\n col_is_character(\n columns = c(\"row\")\n ) %>%\n # Expect that column `group` is of type: character\n col_is_character(\n columns = c(\"group\")\n ) %>%\n # Expect entirely distinct rows across `num, char, fctr, date, time, datetime, currency, row, group`\n rows_distinct(\n columns = c(\"num\", \"char\", \"fctr\", \"date\", \"time\", \"datetime\", \"currency\", \"row\", \"group\")\n ) %>%\n # Expect that column schemas match\n col_schema_match(\n schema = col_schema(\n num = \"numeric\",\n char = \"character\",\n fctr = \"factor\",\n date = \"character\",\n time = \"character\",\n datetime = \"character\",\n currency = \"numeric\",\n row = \"character\",\n group = \"character\"\n )\n ) %>%\n interrogate()\n```\n\n\n```{r print_agent, echo=FALSE}\nagent\n```\n" # draft validations for data tables can be generated without comments Code readLines(con = path) %>% paste0(collapse = "\n") Output - [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn_at = 0.05,\n stop_at = 0.10\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n col_is_character(\n columns = c(\"country_name\")\n ) %>%\n col_vals_in_set(\n columns = c(\"country_name\"),\n set = c(\"Aruba\", \"Afghanistan\", \"Angola\", \"Albania\", \"Andorra\", \"United Arab Emirates\", \"Argentina\", \"Armenia\", \"American Samoa\", \"Antigua & Barbuda\", \"Australia\", \"Austria\", \"Azerbaijan\", \"Burundi\", \"Belgium\", \"Benin\", \"Burkina Faso\", \"Bangladesh\", \"Bulgaria\", \"Bahrain\", \"Bahamas\", \"Bosnia & Herzegovina\", \"Belarus\", \"Belize\", \"Bermuda\", \"Bolivia\", \"Brazil\", \"Barbados\", \"Brunei\", \"Bhutan\", \"Botswana\", \"Central African Republic\", \"Canada\", \"Switzerland\", \"Chile\", \"China\", \"Cote d'Ivoire\", \"Cameroon\", \"Congo (DRC)\", \"Congo (Republic)\", \"Colombia\", \"Comoros\", \"Cape Verde\", \"Costa Rica\", \"Cuba\", \"Curacao\", \"Cayman Islands\", \"Cyprus\", \"Czech Republic\", \"Germany\", \"Djibouti\", \"Dominica\", \"Denmark\", \"Dominican Republic\", \"Algeria\", \"Ecuador\", \"Egypt\", \"Eritrea\", \"Spain\", \"Estonia\", \"Ethiopia\", \"Finland\", \"Fiji\", \"France\", \"Faroe Islands\", \"Micronesia\", \"Gabon\", \"United Kingdom\", \"Georgia\", \"Ghana\", \"Gibraltar\", \"Guinea\", \"Gambia\", \"Guinea-Bissau\", \"Equatorial Guinea\", \"Greece\", \"Grenada\", \"Greenland\", \"Guatemala\", \"Guam\", \"Guyana\", \"Hong Kong\", \"Honduras\", \"Croatia\", \"Haiti\", \"Hungary\", \"Indonesia\", \"Isle of Man\", \"India\", \"Ireland\", \"Iran\", \"Iraq\", \"Iceland\", \"Israel\", \"Italy\", \"Jamaica\", \"Jordan\", \"Japan\", \"Kazakhstan\", \"Kenya\", \"Kyrgyzstan\", \"Cambodia\", \"Kiribati\", \"St. Kitts & Nevis\", \"South Korea\", \"Kuwait\", \"Laos\", \"Lebanon\", \"Liberia\", \"Libya\", \"St. Lucia\", \"Liechtenstein\", \"Sri Lanka\", \"Lesotho\", \"Lithuania\", \"Luxembourg\", \"Latvia\", \"Macao\", \"St. Martin\", \"Morocco\", \"Monaco\", \"Moldova\", \"Madagascar\", \"Maldives\", \"Mexico\", \"Marshall Islands\", \"North Macedonia\", \"Mali\", \"Malta\", \"Myanmar\", \"Montenegro\", \"Mongolia\", \"Northern Mariana Islands\", \"Mozambique\", \"Mauritania\", \"Mauritius\", \"Malawi\", \"Malaysia\", \"Namibia\", \"New Caledonia\", \"Niger\", \"Nigeria\", \"Nicaragua\", \"Netherlands\", \"Norway\", \"Nepal\", \"Nauru\", \"New Zealand\", \"Oman\", \"Pakistan\", \"Panama\", \"Peru\", \"Philippines\", \"Palau\", \"Papua New Guinea\", \"Poland\", \"Puerto Rico\", \"North Korea\", \"Portugal\", \"Paraguay\", \"Palestine\", \"French Polynesia\", \"Qatar\", \"Romania\", \"Russia\", \"Rwanda\", \"Saudi Arabia\", \"Sudan\", \"Senegal\", \"Singapore\", \"Solomon Islands\", \"Sierra Leone\", \"El Salvador\", \"San Marino\", \"Somalia\", \"Serbia\", \"South Sudan\", \"Sao Tome & Principe\", \"Suriname\", \"Slovakia\", \"Slovenia\", \"Sweden\", \"Eswatini\", \"Sint Maarten\", \"Seychelles\", \"Syria\", \"Turks & Caicos Islands\", \"Chad\", \"Togo\", \"Thailand\", \"Tajikistan\", \"Turkmenistan\", \"East Timor\", \"Tonga\", \"Trinidad & Tobago\", \"Tunisia\", \"Turkey\", \"Tuvalu\", \"Tanzania\", \"Uganda\", \"Ukraine\", \"Uruguay\", \"United States\", \"Uzbekistan\", \"St. Vincent & Grenadines\", \"Venezuela\", \"British Virgin Islands\", \"U.S. Virgin Islands\", \"Vietnam\", \"Vanuatu\", \"Samoa\", \"Yemen\", \"South Africa\", \"Zambia\", \"Zimbabwe\")\n ) %>%\n col_is_character(\n columns = c(\"country_code_2\")\n ) %>%\n col_vals_in_set(\n columns = c(\"country_code_2\"),\n set = c(\"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\")\n ) %>%\n col_is_character(\n columns = c(\"country_code_3\")\n ) %>%\n col_vals_in_set(\n columns = c(\"country_code_3\"),\n set = c(\"AND\", \"ARE\", \"AFG\", \"ATG\", \"AIA\", \"ALB\", \"ARM\", \"AGO\", \"ATA\", \"ARG\", \"ASM\", \"AUT\", \"AUS\", \"ABW\", \"ALA\", \"AZE\", \"BIH\", \"BRB\", \"BGD\", \"BEL\", \"BFA\", \"BGR\", \"BHR\", \"BDI\", \"BEN\", \"BLM\", \"BMU\", \"BRN\", \"BOL\", \"BES\", \"BRA\", \"BHS\", \"BTN\", \"BVT\", \"BWA\", \"BLR\", \"BLZ\", \"CAN\", \"CCK\", \"COD\", \"CAF\", \"COG\", \"CHE\", \"CIV\", \"COK\", \"CHL\", \"CMR\", \"CHN\", \"COL\", \"CRI\", \"CUB\", \"CPV\", \"CUW\", \"CXR\", \"CYP\", \"CZE\", \"DEU\", \"DJI\", \"DNK\", \"DMA\", \"DOM\", \"DZA\", \"ECU\", \"EST\", \"EGY\", \"ESH\", \"ERI\", \"ESP\", \"ETH\", \"FIN\", \"FJI\", \"FLK\", \"FSM\", \"FRO\", \"FRA\", \"GAB\", \"GBR\", \"GRD\", \"GEO\", \"GUF\", \"GGY\", \"GHA\", \"GIB\", \"GRL\", \"GMB\", \"GIN\", \"GLP\", \"GNQ\", \"GRC\", \"SGS\", \"GTM\", \"GUM\", \"GNB\", \"GUY\", \"HKG\", \"HMD\", \"HND\", \"HRV\", \"HTI\", \"HUN\", \"IDN\", \"IRL\", \"ISR\", \"IMN\", \"IND\", \"IOT\", \"IRQ\", \"IRN\", \"ISL\", \"ITA\", \"JEY\", \"JAM\", \"JOR\", \"JPN\", \"KEN\", \"KGZ\", \"KHM\", \"KIR\", \"COM\", \"KNA\", \"PRK\", \"KOR\", \"KWT\", \"CYM\", \"KAZ\", \"LAO\", \"LBN\", \"LCA\", \"LIE\", \"LKA\", \"LBR\", \"LSO\", \"LTU\", \"LUX\", \"LVA\", \"LBY\", \"MAR\", \"MCO\", \"MDA\", \"MNE\", \"MAF\", \"MDG\", \"MHL\", \"MKD\", \"MLI\", \"MMR\", \"MNG\", \"MAC\", \"MNP\", \"MTQ\", \"MRT\", \"MSR\", \"MLT\", \"MUS\", \"MDV\", \"MWI\", \"MEX\", \"MYS\", \"MOZ\", \"NAM\", \"NCL\", \"NER\", \"NFK\", \"NGA\", \"NIC\", \"NLD\", \"NOR\", \"NPL\", \"NRU\", \"NIU\", \"NZL\", \"OMN\", \"PAN\", \"PER\", \"PYF\", \"PNG\", \"PHL\", \"PAK\", \"POL\", \"SPM\", \"PCN\", \"PRI\", \"PSE\", \"PRT\", \"PLW\", \"PRY\", \"QAT\", \"REU\", \"ROU\", \"SRB\", \"RUS\", \"RWA\", \"SAU\", \"SLB\", \"SYC\", \"SDN\", \"SWE\", \"SGP\", \"SHN\", \"SVN\", \"SJM\", \"SVK\", \"SLE\", \"SMR\", \"SEN\", \"SOM\", \"SUR\", \"SSD\", \"STP\", \"SLV\", \"SXM\", \"SYR\", \"SWZ\", \"TCA\", \"TCD\", \"ATF\", \"TGO\", \"THA\", \"TJK\", \"TKL\", \"TLS\", \"TKM\", \"TUN\", \"TON\", \"TUR\", \"TTO\", \"TUV\", \"TWN\", \"TZA\", \"UKR\", \"UGA\", \"UMI\", \"USA\", \"URY\", \"UZB\", \"VAT\", \"VCT\", \"VEN\", \"VGB\", \"VIR\", \"VNM\", \"VUT\", \"WLF\", \"WSM\", \"YEM\", \"MYT\", \"ZAF\", \"ZMB\", \"ZWE\")\n ) %>%\n col_is_integer(\n columns = c(\"year\")\n ) %>%\n col_vals_between(\n columns = c(\"year\"),\n left = 1960,\n right = 2023\n ) %>%\n col_is_integer(\n columns = c(\"population\")\n ) %>%\n col_vals_between(\n columns = c(\"population\"),\n left = 2646,\n right = 1428627700,\n na_pass = TRUE\n ) %>%\n rows_distinct(\n columns = c(\"country_name\", \"country_code_2\", \"country_code_3\", \"year\", \"population\")\n ) %>%\n col_schema_match(\n schema = col_schema(\n country_name = \"character\",\n country_code_2 = \"character\",\n country_code_3 = \"character\",\n year = \"integer\",\n population = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" + [1] "library(pointblank)\n\nagent <-\n create_agent(\n tbl = ~ tbl,\n actions = action_levels(\n warn = 0.05,\n error = 0.1\n ),\n tbl_name = \"tbl\",\n label = \"Validation plan generated by `draft_validation()`.\"\n ) %>%\n col_is_character(\n columns = c(\"country_name\")\n ) %>%\n col_vals_in_set(\n columns = c(\"country_name\"),\n set = c(\"Aruba\", \"Afghanistan\", \"Angola\", \"Albania\", \"Andorra\", \"United Arab Emirates\", \"Argentina\", \"Armenia\", \"American Samoa\", \"Antigua & Barbuda\", \"Australia\", \"Austria\", \"Azerbaijan\", \"Burundi\", \"Belgium\", \"Benin\", \"Burkina Faso\", \"Bangladesh\", \"Bulgaria\", \"Bahrain\", \"Bahamas\", \"Bosnia & Herzegovina\", \"Belarus\", \"Belize\", \"Bermuda\", \"Bolivia\", \"Brazil\", \"Barbados\", \"Brunei\", \"Bhutan\", \"Botswana\", \"Central African Republic\", \"Canada\", \"Switzerland\", \"Chile\", \"China\", \"Cote d'Ivoire\", \"Cameroon\", \"Congo (DRC)\", \"Congo (Republic)\", \"Colombia\", \"Comoros\", \"Cape Verde\", \"Costa Rica\", \"Cuba\", \"Curacao\", \"Cayman Islands\", \"Cyprus\", \"Czech Republic\", \"Germany\", \"Djibouti\", \"Dominica\", \"Denmark\", \"Dominican Republic\", \"Algeria\", \"Ecuador\", \"Egypt\", \"Eritrea\", \"Spain\", \"Estonia\", \"Ethiopia\", \"Finland\", \"Fiji\", \"France\", \"Faroe Islands\", \"Micronesia\", \"Gabon\", \"United Kingdom\", \"Georgia\", \"Ghana\", \"Gibraltar\", \"Guinea\", \"Gambia\", \"Guinea-Bissau\", \"Equatorial Guinea\", \"Greece\", \"Grenada\", \"Greenland\", \"Guatemala\", \"Guam\", \"Guyana\", \"Hong Kong\", \"Honduras\", \"Croatia\", \"Haiti\", \"Hungary\", \"Indonesia\", \"Isle of Man\", \"India\", \"Ireland\", \"Iran\", \"Iraq\", \"Iceland\", \"Israel\", \"Italy\", \"Jamaica\", \"Jordan\", \"Japan\", \"Kazakhstan\", \"Kenya\", \"Kyrgyzstan\", \"Cambodia\", \"Kiribati\", \"St. Kitts & Nevis\", \"South Korea\", \"Kuwait\", \"Laos\", \"Lebanon\", \"Liberia\", \"Libya\", \"St. Lucia\", \"Liechtenstein\", \"Sri Lanka\", \"Lesotho\", \"Lithuania\", \"Luxembourg\", \"Latvia\", \"Macao\", \"St. Martin\", \"Morocco\", \"Monaco\", \"Moldova\", \"Madagascar\", \"Maldives\", \"Mexico\", \"Marshall Islands\", \"North Macedonia\", \"Mali\", \"Malta\", \"Myanmar\", \"Montenegro\", \"Mongolia\", \"Northern Mariana Islands\", \"Mozambique\", \"Mauritania\", \"Mauritius\", \"Malawi\", \"Malaysia\", \"Namibia\", \"New Caledonia\", \"Niger\", \"Nigeria\", \"Nicaragua\", \"Netherlands\", \"Norway\", \"Nepal\", \"Nauru\", \"New Zealand\", \"Oman\", \"Pakistan\", \"Panama\", \"Peru\", \"Philippines\", \"Palau\", \"Papua New Guinea\", \"Poland\", \"Puerto Rico\", \"North Korea\", \"Portugal\", \"Paraguay\", \"Palestine\", \"French Polynesia\", \"Qatar\", \"Romania\", \"Russia\", \"Rwanda\", \"Saudi Arabia\", \"Sudan\", \"Senegal\", \"Singapore\", \"Solomon Islands\", \"Sierra Leone\", \"El Salvador\", \"San Marino\", \"Somalia\", \"Serbia\", \"South Sudan\", \"Sao Tome & Principe\", \"Suriname\", \"Slovakia\", \"Slovenia\", \"Sweden\", \"Eswatini\", \"Sint Maarten\", \"Seychelles\", \"Syria\", \"Turks & Caicos Islands\", \"Chad\", \"Togo\", \"Thailand\", \"Tajikistan\", \"Turkmenistan\", \"East Timor\", \"Tonga\", \"Trinidad & Tobago\", \"Tunisia\", \"Turkey\", \"Tuvalu\", \"Tanzania\", \"Uganda\", \"Ukraine\", \"Uruguay\", \"United States\", \"Uzbekistan\", \"St. Vincent & Grenadines\", \"Venezuela\", \"British Virgin Islands\", \"U.S. Virgin Islands\", \"Vietnam\", \"Vanuatu\", \"Samoa\", \"Yemen\", \"South Africa\", \"Zambia\", \"Zimbabwe\")\n ) %>%\n col_is_character(\n columns = c(\"country_code_2\")\n ) %>%\n col_vals_in_set(\n columns = c(\"country_code_2\"),\n set = c(\"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\")\n ) %>%\n col_is_character(\n columns = c(\"country_code_3\")\n ) %>%\n col_vals_in_set(\n columns = c(\"country_code_3\"),\n set = c(\"AND\", \"ARE\", \"AFG\", \"ATG\", \"AIA\", \"ALB\", \"ARM\", \"AGO\", \"ATA\", \"ARG\", \"ASM\", \"AUT\", \"AUS\", \"ABW\", \"ALA\", \"AZE\", \"BIH\", \"BRB\", \"BGD\", \"BEL\", \"BFA\", \"BGR\", \"BHR\", \"BDI\", \"BEN\", \"BLM\", \"BMU\", \"BRN\", \"BOL\", \"BES\", \"BRA\", \"BHS\", \"BTN\", \"BVT\", \"BWA\", \"BLR\", \"BLZ\", \"CAN\", \"CCK\", \"COD\", \"CAF\", \"COG\", \"CHE\", \"CIV\", \"COK\", \"CHL\", \"CMR\", \"CHN\", \"COL\", \"CRI\", \"CUB\", \"CPV\", \"CUW\", \"CXR\", \"CYP\", \"CZE\", \"DEU\", \"DJI\", \"DNK\", \"DMA\", \"DOM\", \"DZA\", \"ECU\", \"EST\", \"EGY\", \"ESH\", \"ERI\", \"ESP\", \"ETH\", \"FIN\", \"FJI\", \"FLK\", \"FSM\", \"FRO\", \"FRA\", \"GAB\", \"GBR\", \"GRD\", \"GEO\", \"GUF\", \"GGY\", \"GHA\", \"GIB\", \"GRL\", \"GMB\", \"GIN\", \"GLP\", \"GNQ\", \"GRC\", \"SGS\", \"GTM\", \"GUM\", \"GNB\", \"GUY\", \"HKG\", \"HMD\", \"HND\", \"HRV\", \"HTI\", \"HUN\", \"IDN\", \"IRL\", \"ISR\", \"IMN\", \"IND\", \"IOT\", \"IRQ\", \"IRN\", \"ISL\", \"ITA\", \"JEY\", \"JAM\", \"JOR\", \"JPN\", \"KEN\", \"KGZ\", \"KHM\", \"KIR\", \"COM\", \"KNA\", \"PRK\", \"KOR\", \"KWT\", \"CYM\", \"KAZ\", \"LAO\", \"LBN\", \"LCA\", \"LIE\", \"LKA\", \"LBR\", \"LSO\", \"LTU\", \"LUX\", \"LVA\", \"LBY\", \"MAR\", \"MCO\", \"MDA\", \"MNE\", \"MAF\", \"MDG\", \"MHL\", \"MKD\", \"MLI\", \"MMR\", \"MNG\", \"MAC\", \"MNP\", \"MTQ\", \"MRT\", \"MSR\", \"MLT\", \"MUS\", \"MDV\", \"MWI\", \"MEX\", \"MYS\", \"MOZ\", \"NAM\", \"NCL\", \"NER\", \"NFK\", \"NGA\", \"NIC\", \"NLD\", \"NOR\", \"NPL\", \"NRU\", \"NIU\", \"NZL\", \"OMN\", \"PAN\", \"PER\", \"PYF\", \"PNG\", \"PHL\", \"PAK\", \"POL\", \"SPM\", \"PCN\", \"PRI\", \"PSE\", \"PRT\", \"PLW\", \"PRY\", \"QAT\", \"REU\", \"ROU\", \"SRB\", \"RUS\", \"RWA\", \"SAU\", \"SLB\", \"SYC\", \"SDN\", \"SWE\", \"SGP\", \"SHN\", \"SVN\", \"SJM\", \"SVK\", \"SLE\", \"SMR\", \"SEN\", \"SOM\", \"SUR\", \"SSD\", \"STP\", \"SLV\", \"SXM\", \"SYR\", \"SWZ\", \"TCA\", \"TCD\", \"ATF\", \"TGO\", \"THA\", \"TJK\", \"TKL\", \"TLS\", \"TKM\", \"TUN\", \"TON\", \"TUR\", \"TTO\", \"TUV\", \"TWN\", \"TZA\", \"UKR\", \"UGA\", \"UMI\", \"USA\", \"URY\", \"UZB\", \"VAT\", \"VCT\", \"VEN\", \"VGB\", \"VIR\", \"VNM\", \"VUT\", \"WLF\", \"WSM\", \"YEM\", \"MYT\", \"ZAF\", \"ZMB\", \"ZWE\")\n ) %>%\n col_is_integer(\n columns = c(\"year\")\n ) %>%\n col_vals_between(\n columns = c(\"year\"),\n left = 1960,\n right = 2023\n ) %>%\n col_is_integer(\n columns = c(\"population\")\n ) %>%\n col_vals_between(\n columns = c(\"population\"),\n left = 2646,\n right = 1428627700,\n na_pass = TRUE\n ) %>%\n rows_distinct(\n columns = c(\"country_name\", \"country_code_2\", \"country_code_3\", \"year\", \"population\")\n ) %>%\n col_schema_match(\n schema = col_schema(\n country_name = \"character\",\n country_code_2 = \"character\",\n country_code_3 = \"character\",\n year = \"integer\",\n population = \"integer\"\n )\n ) %>%\n interrogate()\n\nagent" diff --git a/tests/testthat/postgres.R b/tests/testthat/postgres.R index b201d3526..f83724430 100644 --- a/tests/testthat/postgres.R +++ b/tests/testthat/postgres.R @@ -18,7 +18,7 @@ test_that("pointblank agent works with dittodb-mocked Postgres database connecti # Set failure thresholds and functions that are # actioned from exceeding certain error levels - al <- action_levels(warn_at = 0.02, stop_at = 0.05, notify_at = 0.10) + al <- action_levels(warn = 0.02, error = 0.05, critical = 0.10) # Validate the `assembly` table in the `aedes_aegypti_core_55_1d` DB # the expect_warning is used to suppres the message diff --git a/tests/testthat/test-action_levels.R b/tests/testthat/test-action_levels.R index 865a71d82..deb78f638 100644 --- a/tests/testthat/test-action_levels.R +++ b/tests/testthat/test-action_levels.R @@ -19,15 +19,15 @@ test_that("The `action_levels()` helper function works as expected", { expect_null(al[[4]]) expect_null(al[[5]]) expect_null(al[[6]]) - expect_named(al[[7]], c("warn", "stop", "notify")) + expect_true(all(c("warn", "stop", "notify") %in% names(al[[7]]))) expect_type(al[[7]], "list") expect_null(al[[7]][[1]]) expect_null(al[[7]][[2]]) expect_null(al[[7]][[3]]) - expect_length(al[[7]], 3) + expect_length(al[[7]], 5) # Create an `action_levels()` list with fractional values - al <- action_levels(warn_at = 0.2, stop_at = 0.8, notify_at = 0.345) + al <- action_levels(warn = 0.2, error = 0.8, critical = 0.345) expect_s3_class(al, "action_levels") expect_length(al, 7) @@ -46,15 +46,15 @@ test_that("The `action_levels()` helper function works as expected", { expect_equal(al$notify_fraction, 0.345) expect_null(al$notify_count) - expect_length(al[[7]], 3) - expect_named(al[[7]], c("warn", "stop", "notify")) + expect_length(al[[7]], 5) + expect_true(all(c("warn", "stop", "notify") %in% names(al[[7]]))) expect_type(al[[7]], "list") expect_null(al[[7]][[1]]) expect_null(al[[7]][[2]]) expect_null(al[[7]][[3]]) # Create an `action_levels()` list with count values - al <- action_levels(warn_at = 20, stop_at = 80, notify_at = 34.6) + al <- action_levels(warn = 20, error = 80, critical = 34.6) al %>% expect_s3_class("action_levels") al %>% @@ -63,7 +63,7 @@ test_that("The `action_levels()` helper function works as expected", { "warn_fraction", "warn_count", "stop_fraction", "stop_count", "notify_fraction", "notify_count", "fns") ) - al[[7]] %>% expect_named(c("warn", "stop", "notify")) + expect_true(all(c("warn", "stop", "notify") %in% names(al[[7]]))) al$warn_fraction %>% expect_null() al$warn_count %>% expect_equal(20) @@ -76,21 +76,21 @@ test_that("The `action_levels()` helper function works as expected", { al[[7]][[2]] %>% expect_null() al[[7]][[3]] %>% expect_null() al %>% length() %>% expect_equal(7) - al[[7]] %>% length() %>% expect_equal(3) + expect_length(al[[7]], 5) # Expect an error if non-numeric values provided - expect_error(action_levels(warn_at = "20")) + expect_error(action_levels(warn = "20")) # Expect an error if any value less than or # equal to zero is provided - expect_error(action_levels(warn_at = 0)) - expect_error(action_levels(warn_at = -1.5)) + expect_error(action_levels(warn = 0)) + expect_error(action_levels(warn = -1.5)) # Add functions to the `fns` arg al <- action_levels( - warn_at = 3, - fns = list(warn = ~ my_great_function(vl = .vars_list)) + warn = 3, + fns = action_fns(warn = ~ my_great_function(vl = .vars_list)) ) al %>% expect_s3_class("action_levels") @@ -101,7 +101,7 @@ test_that("The `action_levels()` helper function works as expected", { "warn_fraction", "warn_count", "stop_fraction", "stop_count", "notify_fraction", "notify_count", "fns") ) - al[[7]] %>% expect_named("warn") + expect_true(all(c("warn", "stop", "notify") %in% names(al[[7]]))) al[[7]][[1]] %>% expect_s3_class("formula") al[[7]][[1]] %>% as.character() %>% @@ -115,17 +115,16 @@ test_that("The `action_levels()` helper function works as expected", { al$notify_count %>% expect_null() al[[7]] %>% expect_type("list") al %>% expect_length(7) - al[[7]] %>% expect_length(1) # Expect an error if not all components # of the `fns` list are formulas - expect_error(action_levels(warn_at = 3, fns = list(warn = "text"))) + expect_error(action_levels(warn = 3, fns = action_fns(warn = "text"))) # Expect an error if not all components # of the `fns` list are named expect_error( action_levels( - warn_at = 3, + warn = 3, fns = list( warn = ~ my_great_function(vl = .vars_list), ~ another_function() @@ -138,8 +137,8 @@ test_that("The `action_levels()` helper function works as expected", { # or `notify` expect_error( action_levels( - warn_at = 3, - fns = list( + warn = 3, + fns = action_fns( warn = ~ my_great_function(vl = .vars_list), notable = ~ another_function() ) @@ -153,12 +152,12 @@ test_that("The appropriate actions occur when using `action_levels()`", { create_agent(tbl = small_table, label = "small_table_tests") %>% col_vals_gt( vars(d), 1000, - actions = action_levels(warn_at = 3, fns = list(warn = ~"warning") + actions = action_levels(warn = 3, fns = action_fns(warn = ~"warning") ) ) %>% col_vals_in_set( vars(f), c("low", "high"), - actions = action_levels(warn_at = 0.1, fns = list(warn = ~"warning") + actions = action_levels(warn = 0.1, fns = action_fns(warn = ~"warning") ) ) %>% interrogate() @@ -170,33 +169,33 @@ test_that("The appropriate actions occur when using `action_levels()`", { create_agent(tbl = small_table, label = "small_table_tests") %>% col_vals_gt( vars(d), 1000, - actions = action_levels(notify_at = 3, fns = list(notify = ~"notify") + actions = action_levels(critical = 3, fns = action_fns(critical = ~"critical") ) ) %>% col_vals_in_set( vars(f), c("low", "high"), - actions = action_levels(notify_at = 0.1, fns = list(notify = ~"notify") + actions = action_levels(critical = 0.1, fns = action_fns(critical = ~"critical") ) ) %>% interrogate() agent_report <- get_agent_report(agent, display_table = FALSE) - agent_report$N %>% expect_equal(rep(TRUE, 2)) + agent_report$C %>% expect_equal(rep(TRUE, 2)) agent <- create_agent(tbl = small_table, label = "small_table_tests") %>% col_vals_gt( vars(d), 1000, - actions = action_levels(stop_at = 3, fns = list(stop = ~"stop") + actions = action_levels(error = 3, fns = action_fns(error = ~"error") ) ) %>% col_vals_in_set( vars(f), c("low", "high"), - actions = action_levels(stop_at = 0.1, fns = list(stop = ~"stop") + actions = action_levels(error = 0.1, fns = action_fns(error = ~"error") ) ) %>% interrogate() agent_report <- get_agent_report(agent, display_table = FALSE) - agent_report$S %>% expect_equal(rep(TRUE, 2)) + agent_report$E %>% expect_equal(rep(TRUE, 2)) }) diff --git a/tests/testthat/test-brief.R b/tests/testthat/test-brief.R index f422b9bcf..8e678a2e0 100644 --- a/tests/testthat/test-brief.R +++ b/tests/testthat/test-brief.R @@ -152,7 +152,7 @@ test_that("Briefs batch tests: special validations", { ~ test_col_vals_gt(., columns = c, value = vars(a)), ~ col_vals_not_null(., columns = b), preconditions = ~ . %>% dplyr::filter(a < 10), - actions = action_levels(warn_at = 0.1, stop_at = 0.2), + actions = action_levels(warn = 0.1, error = 0.2), label = "The `serially()` step.", active = FALSE, brief = "custom brief" @@ -168,7 +168,7 @@ test_that("Briefs batch tests: special validations", { specially( fn = function(x) { ... }, preconditions = ~ . %>% dplyr::filter(a < 10), - actions = action_levels(warn_at = 0.1, stop_at = 0.2), + actions = action_levels(warn = 0.1, error = 0.2), label = "The `specially()` step.", active = FALSE, brief = "custom brief" @@ -187,7 +187,7 @@ test_that("Briefs batch tests: special validations", { ~ col_vals_not_null(., columns = b), preconditions = ~ . %>% dplyr::filter(a < 10), # segments = b ~ c("group_1", "group_2"), - actions = action_levels(warn_at = 0.1, stop_at = 0.2), + actions = action_levels(warn = 0.1, error = 0.2), label = "The `conjointly()` step.", active = FALSE, brief = "custom brief" @@ -205,7 +205,7 @@ test_that("Briefs batch tests: special validations", { ~ col_vals_not_null(., columns = b), preconditions = ~ . %>% dplyr::filter(a < 10), segments = b ~ c("group_1", "group_2"), - actions = action_levels(warn_at = 0.1, stop_at = 0.2), + actions = action_levels(warn = 0.1, error = 0.2), label = "The `conjointly()` step.", active = FALSE, brief = "custom brief constant" @@ -216,7 +216,7 @@ test_that("Briefs batch tests: special validations", { ~ col_vals_not_null(., columns = b), preconditions = ~ . %>% dplyr::filter(a < 10), segments = b ~ c("group_1", "group_2"), - actions = action_levels(warn_at = 0.1, stop_at = 0.2), + actions = action_levels(warn = 0.1, error = 0.2), label = "The `conjointly()` step.", active = FALSE, brief = c("custom brief multi1", "custom brief multi2") diff --git a/tests/testthat/test-get_agent_report.R b/tests/testthat/test-get_agent_report.R index 85b468102..aa64e3ced 100644 --- a/tests/testthat/test-get_agent_report.R +++ b/tests/testthat/test-get_agent_report.R @@ -14,7 +14,7 @@ test_that("Getting an agent report is possible", { expect_equal( colnames(report), c("i", "type", "columns", "values", "precon", "active", "eval", - "units", "n_pass", "f_pass", "W", "S", "N", "extract") + "units", "n_pass", "f_pass", "W", "E", "C", "extract") ) # Expect a single row in this report @@ -29,8 +29,8 @@ test_that("Getting an agent report is possible", { expect_type(report$n_pass, "double") expect_type(report$f_pass, "double") expect_type(report$W, "logical") - expect_type(report$S, "logical") - expect_type(report$N, "logical") + expect_type(report$E, "logical") + expect_type(report$C, "logical") expect_type(report$extract, "integer") # Use `col_is_character()` function to create @@ -49,8 +49,8 @@ test_that("Getting an agent report is possible", { expect_equal(agent_report_empty$n_pass, NA_integer_) expect_equal(agent_report_empty$f_pass, NA_real_) expect_equal(agent_report_empty$W, NA) - expect_equal(agent_report_empty$S, NA) - expect_equal(agent_report_empty$N, NA) + expect_equal(agent_report_empty$E, NA) + expect_equal(agent_report_empty$C, NA) expect_equal(agent_report_empty$extract, NA) }) @@ -322,7 +322,7 @@ test_that("report shows informative error tooltips", { test_that("rows of report can be shuffled or dropped", { agent <- iris %>% - create_agent(actions = action_levels(warn_at = 1)) %>% + create_agent(actions = action_levels(warn = 1)) %>% col_exists("Petal.Length", active = has_columns(iris, Petal.Length)) %>% col_exists("skip", diff --git a/tests/testthat/test-interrogate_simple.R b/tests/testthat/test-interrogate_simple.R index f6a32053d..5f93c2d82 100644 --- a/tests/testthat/test-interrogate_simple.R +++ b/tests/testthat/test-interrogate_simple.R @@ -89,7 +89,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_lt( columns = vars(a), value = 7, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -136,7 +136,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_lte( columns = vars(a), value = 7, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -184,7 +184,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_equal( columns = vars(d), value = 283.94, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -233,7 +233,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_not_equal( columns = vars(d), value = 283.94, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -280,7 +280,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_gte( columns = vars(a), value = 3, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -327,7 +327,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_gt( columns = vars(a), value = 2, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -374,7 +374,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_between( columns = vars(d), left = 0, right = 1000, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -421,7 +421,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_not_between( columns = vars(d), left = 9000, right = 11000, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -467,7 +467,7 @@ test_that("Interrogating simply returns the expected results", { columns = vars(d), left = 0, right = 3000, preconditions = ~ . %>% dplyr::filter(date > "2016-01-20"), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -514,7 +514,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_in_set( columns = vars(f), set = c("low", "mid", "higher"), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -561,7 +561,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_not_in_set( columns = vars(f), set = c("lower", "mid", "higher"), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -608,7 +608,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_in_set( columns = vars(f), set = c("low", "mid", "higher", "highest"), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -622,7 +622,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_in_set( columns = vars(f), set = c("low", "mid"), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -682,7 +682,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_make_subset( columns = vars(f), set = c("lower", "mid", "higher", "highest"), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -696,7 +696,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_make_subset( columns = vars(f), set = c("low", "mid", "highly"), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -740,7 +740,7 @@ test_that("Interrogating simply returns the expected results", { increasing_tbl %>% col_vals_increasing( columns = vars(b), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -784,7 +784,7 @@ test_that("Interrogating simply returns the expected results", { decreasing_tbl %>% col_vals_decreasing( columns = vars(b), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -831,7 +831,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_null( columns = vars(c), preconditions = ~ . %>% dplyr::filter(date != "2016-01-06"), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -875,7 +875,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_vals_not_null( columns = vars(c), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -922,7 +922,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_regex( columns = vars(b), regex = "[0-7]-[a-z]*?-[0-9]*?", - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -978,7 +978,7 @@ test_that("Interrogating simply returns the expected results", { col_vals_within_spec( columns = vars(isbn_numbers), spec = "isbn", - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1022,7 +1022,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_vals_expr( expr = ~ a %% 2 == 0, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1052,7 +1052,7 @@ test_that("Interrogating simply returns the expected results", { # Perform a simple validation step that results in stopping expect_error( - tbl_result <- tbl %>% rows_distinct(actions = stop_on_fail()) + tbl_result <- tbl %>% rows_distinct(actions = error_on_fail()) ) # Expect that `tbl_result` is never created @@ -1081,7 +1081,7 @@ test_that("Interrogating simply returns the expected results", { # Perform a simple validation step that results in stopping expect_error( - tbl_result <- tbl_complete_no %>% rows_complete(actions = stop_on_fail()) + tbl_result <- tbl_complete_no %>% rows_complete(actions = error_on_fail()) ) # Expect that `tbl_result` is never created @@ -1119,7 +1119,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_is_character( columns = vars(a), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1165,7 +1165,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_is_numeric( columns = vars(b), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1209,7 +1209,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_is_integer( columns = vars(b), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1253,7 +1253,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_is_posix( columns = vars(b), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1297,7 +1297,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_is_date( columns = vars(b), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1335,7 +1335,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_is_logical( columns = vars(b), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1374,7 +1374,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_is_factor( columns = vars(a), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1403,16 +1403,16 @@ test_that("Interrogating simply returns the expected results", { # Using the `col_exists()` function to perform # a simple validation step results in an error expect_error( - tbl %>% col_exists(columns = vars(h), actions = stop_on_fail()) + tbl %>% col_exists(columns = vars(h), actions = error_on_fail()) ) expect_error( - tbl %>% col_exists(columns = "h", actions = stop_on_fail()) + tbl %>% col_exists(columns = "h", actions = error_on_fail()) ) expect_error( - tbl %>% col_exists(columns = vars(a, h), actions = stop_on_fail()) + tbl %>% col_exists(columns = vars(a, h), actions = error_on_fail()) ) expect_error( - tbl %>% col_exists(columns = c("a", "h"), actions = stop_on_fail()) + tbl %>% col_exists(columns = c("a", "h"), actions = error_on_fail()) ) # Expect no warning or error if all column names are correct @@ -1420,7 +1420,7 @@ test_that("Interrogating simply returns the expected results", { tbl %>% col_exists(columns = colnames(tbl), actions = warn_on_fail()) ) expect_no_error( - tbl %>% col_exists(columns = colnames(tbl), actions = stop_on_fail()) + tbl %>% col_exists(columns = colnames(tbl), actions = error_on_fail()) ) # @@ -1466,7 +1466,7 @@ test_that("Interrogating simply returns the expected results", { tbl_result <- tbl %>% col_schema_match( schema = schema_incorrect, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1521,7 +1521,7 @@ test_that("Interrogating simply returns the expected results", { tbl_complete_yes %>% row_count_match( count = pointblank::small_table, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1569,7 +1569,7 @@ test_that("Interrogating simply returns the expected results", { tbl_complete_yes %>% row_count_match( count = 15, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1624,7 +1624,7 @@ test_that("Interrogating simply returns the expected results", { tbl_complete_yes %>% col_count_match( count = pointblank::small_table, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1672,7 +1672,7 @@ test_that("Interrogating simply returns the expected results", { tbl_complete_yes %>% col_count_match( count = 15, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1725,7 +1725,7 @@ test_that("Interrogating simply returns the expected results", { tbl_complete_yes %>% tbl_match( tbl_compare = pointblank::small_table, - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -1784,7 +1784,7 @@ test_that("Interrogating simply returns the expected results", { conjointly( ~ col_vals_gt(., columns = vars(d), value = 200), ~ col_vals_lt(., columns = vars(c), value = 10), - actions = stop_on_fail() + actions = error_on_fail() ) ) @@ -2038,7 +2038,7 @@ test_that("The inclusivity options work well for the range-based validations", { col_vals_between( columns = vars(a), left = 1, right = 10, inclusive = c(FALSE, FALSE), - actions = action_levels(warn_at = 3) + actions = action_levels(warn = 3) ) ) expect_warning( @@ -2046,7 +2046,7 @@ test_that("The inclusivity options work well for the range-based validations", { col_vals_between( columns = vars(a), left = 1, right = 10, inclusive = c(FALSE, FALSE), - actions = action_levels(warn_at = 2) + actions = action_levels(warn = 2) ) ) diff --git a/tests/testthat/test-interrogate_with_agent.R b/tests/testthat/test-interrogate_with_agent.R index fb377461c..93c448adc 100644 --- a/tests/testthat/test-interrogate_with_agent.R +++ b/tests/testthat/test-interrogate_with_agent.R @@ -1495,7 +1495,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 1.5, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1507,7 +1507,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 1.5, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1522,7 +1522,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 2.0, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1534,7 +1534,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 2.0, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1549,7 +1549,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 0.5, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1561,7 +1561,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 0.5, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1576,7 +1576,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 1.0, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1588,7 +1588,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 1.0, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1603,7 +1603,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 3.0, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1615,7 +1615,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 3.0, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1630,7 +1630,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 2.5, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1642,7 +1642,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), value = 2.5, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1657,7 +1657,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), left = 0, right = 3.0, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1669,7 +1669,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), left = 0, right = 3.0, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1684,7 +1684,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), left = 3.0, right = 4.5, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1696,7 +1696,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), left = 3.0, right = 4.5, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1711,7 +1711,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), regex = "[0-9]-[a-z]{3}-[0-9]{3}", na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1723,7 +1723,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(a), regex = "[0-9]-[a-z]{3}-[0-9]{3}", na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1756,7 +1756,7 @@ test_that("The validations with sets can include NA values", { col_vals_in_set( columns = vars(a), set = c("one", "two", "three", "four", "five"), - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1767,7 +1767,7 @@ test_that("The validations with sets can include NA values", { col_vals_in_set( columns = vars(a), set = c("one", "two", "three", "four", "five", NA), - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1780,7 +1780,7 @@ test_that("The validations with sets can include NA values", { col_vals_not_in_set( columns = vars(a), set = c("four", "five", "six", NA), - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1791,7 +1791,7 @@ test_that("The validations with sets can include NA values", { col_vals_not_in_set( columns = vars(a), set = c("four", "five", "six"), - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1925,7 +1925,7 @@ test_that("Select validation steps can be `active` or not", { # Perform validation directly on data with `active = TRUE` # for all of the validation steps; set action levels to # warn when there is a single unit failing in each step - al <- action_levels(warn_at = 1) + al <- action_levels(warn = 1) expect_snapshot( obj <- small_table %>% diff --git a/tests/testthat/test-interrogate_with_agent_db.R b/tests/testthat/test-interrogate_with_agent_db.R index a128dee06..f6daf2671 100644 --- a/tests/testthat/test-interrogate_with_agent_db.R +++ b/tests/testthat/test-interrogate_with_agent_db.R @@ -843,7 +843,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 1.5, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -856,7 +856,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 1.5, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -872,7 +872,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 2.0, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -885,7 +885,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 2.0, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -901,7 +901,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 0.5, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -914,7 +914,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 0.5, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -930,7 +930,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 1.0, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -943,7 +943,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 1.0, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -959,7 +959,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 3.0, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -972,7 +972,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 3.0, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -988,7 +988,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 1.5, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1001,7 +1001,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), value = 1.5, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1017,7 +1017,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), left = 0, right = 3.0, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1030,7 +1030,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), left = 0, right = 3.0, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1046,7 +1046,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), left = 3.0, right = 4.5, na_pass = FALSE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1059,7 +1059,7 @@ test_that("Interrogating with an agent incorporates the `na_pass` option", { columns = vars(g), left = 3.0, right = 4.5, na_pass = TRUE, - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1084,7 +1084,7 @@ test_that("The validations with sets can include NA values", { col_vals_in_set( columns = vars(g), set = c("one", "two", "three", "four", "five"), - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1095,7 +1095,7 @@ test_that("The validations with sets can include NA values", { col_vals_in_set( columns = vars(g), set = c("one", "two", "three", "four", "five", NA), - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1108,7 +1108,7 @@ test_that("The validations with sets can include NA values", { col_vals_not_in_set( columns = vars(g), set = c("four", "five", "six", NA), - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% @@ -1119,7 +1119,7 @@ test_that("The validations with sets can include NA values", { col_vals_not_in_set( columns = vars(g), set = c("four", "five", "six"), - actions = action_levels(warn_at = 1) + actions = action_levels(warn = 1) ) %>% interrogate() %>% all_passed() %>% diff --git a/tests/testthat/test-schema.R b/tests/testthat/test-schema.R index 32c2a96c5..05316e82f 100644 --- a/tests/testthat/test-schema.R +++ b/tests/testthat/test-schema.R @@ -1,4 +1,4 @@ -al <- action_levels(stop_at = 1) +al <- action_levels(error = 1) test_that("The `cols_schema_match()` function works with an agent", { diff --git a/tests/testthat/test-write_testthat_file.R b/tests/testthat/test-write_testthat_file.R index f65b854b8..d7c37f000 100644 --- a/tests/testthat/test-write_testthat_file.R +++ b/tests/testthat/test-write_testthat_file.R @@ -2,7 +2,7 @@ agent <- create_agent( tbl = ~ small_table, - actions = action_levels(stop_at = 0.1) + actions = action_levels(error = 0.1) ) %>% col_vals_gt( vars(date_time), vars(date), diff --git a/tests/testthat/test-x_list.R b/tests/testthat/test-x_list.R index a56101163..3d3bed6da 100644 --- a/tests/testthat/test-x_list.R +++ b/tests/testthat/test-x_list.R @@ -1,4 +1,4 @@ -al <- action_levels(warn_at = 0.1, stop_at = 0.2) +al <- action_levels(warn = 0.1, error = 0.2) agent <- create_agent(tbl = small_table, actions = al) %>% @@ -84,10 +84,10 @@ test_that("An x-list for a step is structurally correct", { expect_equal(x_list_before$f_failed, NA_real_) expect_type(x_list_before$warn, "logical") expect_equal(x_list_before$warn, NA) - expect_type(x_list_before$stop, "logical") - expect_equal(x_list_before$stop, NA) - expect_type(x_list_before$notify, "logical") - expect_equal(x_list_before$notify, NA) + expect_type(x_list_before$error, "logical") + expect_equal(x_list_before$error, NA) + expect_type(x_list_before$critical, "logical") + expect_equal(x_list_before$critical, NA) expect_type(x_list_before$lang, "character") expect_equal(x_list_before$lang, "en") @@ -170,10 +170,10 @@ test_that("An x-list for a step is structurally correct", { expect_equal(x_list_after$f_failed, 0.76923) expect_type(x_list_after$warn, "logical") expect_equal(x_list_after$warn, TRUE) - expect_type(x_list_after$stop, "logical") - expect_equal(x_list_after$stop, TRUE) - expect_type(x_list_after$notify, "logical") - expect_equal(x_list_after$notify, NA) + expect_type(x_list_after$error, "logical") + expect_equal(x_list_after$error, TRUE) + expect_type(x_list_after$critical, "logical") + expect_equal(x_list_after$critical, NA) expect_type(x_list_after$lang, "character") expect_equal(x_list_after$lang, "en") }) @@ -270,10 +270,10 @@ test_that("A complete x-list is structurally correct", { expect_equal(x_list_before$f_failed, rep(NA_real_, 3)) expect_type(x_list_before$warn, "logical") expect_equal(x_list_before$warn, rep(NA, 3)) - expect_type(x_list_before$stop, "logical") - expect_equal(x_list_before$stop, rep(NA, 3)) - expect_type(x_list_before$notify, "logical") - expect_equal(x_list_before$notify, rep(NA, 3)) + expect_type(x_list_before$error, "logical") + expect_equal(x_list_before$error, rep(NA, 3)) + expect_type(x_list_before$critical, "logical") + expect_equal(x_list_before$critical, rep(NA, 3)) expect_s3_class(x_list_before$validation_set, c("tbl_df", "tbl", "data.frame")) expect_equal(nrow(x_list_before$validation_set), 3) expect_equal(ncol(x_list_before$validation_set), 35) @@ -374,10 +374,10 @@ test_that("A complete x-list is structurally correct", { expect_equal(x_list_after$f_failed, c(0.76923, 0.23077, 0)) expect_type(x_list_after$warn, "logical") expect_equal(x_list_after$warn, c(TRUE, TRUE, FALSE)) - expect_type(x_list_after$stop, "logical") - expect_equal(x_list_after$stop, c(TRUE, TRUE, FALSE)) - expect_type(x_list_after$notify, "logical") - expect_equal(x_list_after$notify, rep(NA, 3)) + expect_type(x_list_after$error, "logical") + expect_equal(x_list_after$error, c(TRUE, TRUE, FALSE)) + expect_type(x_list_after$critical, "logical") + expect_equal(x_list_after$critical, rep(NA, 3)) expect_s3_class(x_list_after$validation_set, c("tbl_df", "tbl", "data.frame"), exact = TRUE) expect_equal(nrow(x_list_after$validation_set), 3) expect_equal(ncol(x_list_after$validation_set), 35) diff --git a/tests/testthat/test-yaml.R b/tests/testthat/test-yaml.R index afd643db9..66b496571 100644 --- a/tests/testthat/test-yaml.R +++ b/tests/testthat/test-yaml.R @@ -17,7 +17,7 @@ get_oneline_expr_str <- function(agent, expanded = FALSE) { test_that("YAML writing and reading works as expected", { - al <- action_levels(warn_at = 0.1, stop_at = 0.2) + al <- action_levels(warn = 0.1, error = 0.2) agent <- create_agent(tbl = ~ small_table, actions = al) %>% @@ -279,10 +279,10 @@ test_that("Individual validation steps make the YAML round-trip successfully", { agent %>% col_vals_lt( vars(a, c), 1, - actions = action_levels(warn_at = 0.1, stop_at = 0.2) + actions = action_levels(warn = 0.1, error = 0.2) ) ), - "col_vals_lt(columns = vars(a, c),value = 1,actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_vals_lt(columns = vars(a, c),value = 1,actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_vals_lt(vars(a, c), 1, label = "my_label")), @@ -348,10 +348,10 @@ test_that("Individual validation steps make the YAML round-trip successfully", { agent %>% col_vals_between( vars(c), left = vars(a), right = vars(d), - actions = action_levels(warn_at = 0.1, stop_at = 0.2) + actions = action_levels(warn = 0.1, error = 0.2) ) ), - "col_vals_between(columns = vars(c),left = vars(a),right = vars(d),actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_vals_between(columns = vars(c),left = vars(a),right = vars(d),actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_vals_between(vars(c), left = -5, right = 15, label = "my_label")), @@ -409,10 +409,10 @@ test_that("Individual validation steps make the YAML round-trip successfully", { agent %>% col_vals_not_between( vars(c), left = vars(a), right = vars(d), - actions = action_levels(warn_at = 0.1, stop_at = 0.2) + actions = action_levels(warn = 0.1, error = 0.2) ) ), - "col_vals_not_between(columns = vars(c),left = vars(a),right = vars(d),actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_vals_not_between(columns = vars(c),left = vars(a),right = vars(d),actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_vals_not_between(vars(a), left = -5, right = 15, label = "my_label")), @@ -454,10 +454,10 @@ test_that("Individual validation steps make the YAML round-trip successfully", { agent %>% col_vals_in_set( vars(c), set = c(1:10), - actions = action_levels(warn_at = 0.1, stop_at = 0.2) + actions = action_levels(warn = 0.1, error = 0.2) ) ), - "col_vals_in_set(columns = vars(c),set = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_vals_in_set(columns = vars(c),set = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_vals_in_set(vars(f), set = c("low", "high"), label = "my_label")), @@ -499,10 +499,10 @@ test_that("Individual validation steps make the YAML round-trip successfully", { agent %>% col_vals_not_in_set( vars(c), set = c(1:10), - actions = action_levels(warn_at = 0.1, stop_at = 0.2) + actions = action_levels(warn = 0.1, error = 0.2) ) ), - "col_vals_not_in_set(columns = vars(c),set = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_vals_not_in_set(columns = vars(c),set = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_vals_not_in_set(vars(f), set = c("low", "high"), label = "my_label")), @@ -544,10 +544,10 @@ test_that("Individual validation steps make the YAML round-trip successfully", { agent %>% col_vals_make_set( vars(c), set = c(1:10), - actions = action_levels(warn_at = 0.1, stop_at = 0.2) + actions = action_levels(warn = 0.1, error = 0.2) ) ), - "col_vals_make_set(columns = vars(c),set = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_vals_make_set(columns = vars(c),set = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_vals_make_set(vars(f), set = c("low", "high"), label = "my_label")), @@ -589,10 +589,10 @@ test_that("Individual validation steps make the YAML round-trip successfully", { agent %>% col_vals_make_subset( vars(c), set = c(1:10), - actions = action_levels(warn_at = 0.1, stop_at = 0.2) + actions = action_levels(warn = 0.1, error = 0.2) ) ), - "col_vals_make_subset(columns = vars(c),set = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_vals_make_subset(columns = vars(c),set = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_vals_make_subset(vars(f), set = c("low", "high"), label = "my_label")), @@ -835,9 +835,9 @@ test_that("Individual validation steps make the YAML round-trip successfully", { ) expect_equal( get_oneline_expr_str( - agent %>% col_is_character(vars(b, f), actions = action_levels(warn_at = 0.1, stop_at = 0.2)) + agent %>% col_is_character(vars(b, f), actions = action_levels(warn = 0.1, error = 0.2)) ), - "col_is_character(columns = vars(b, f),actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_is_character(columns = vars(b, f),actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_is_character(vars(b), label = "my_label")), @@ -858,9 +858,9 @@ test_that("Individual validation steps make the YAML round-trip successfully", { ) expect_equal( get_oneline_expr_str( - agent %>% col_exists(vars(b, f), actions = action_levels(warn_at = 0.1, stop_at = 0.2)) + agent %>% col_exists(vars(b, f), actions = action_levels(warn = 0.1, error = 0.2)) ), - "col_exists(columns = vars(b, f),actions = action_levels(warn_at = 0.1,stop_at = 0.2))" + "col_exists(columns = vars(b, f),actions = action_levels(warn = 0.1,error = 0.2))" ) expect_equal( get_oneline_expr_str(agent %>% col_exists(vars(b), label = "my_label")), diff --git a/vignettes/pointblank.Rmd b/vignettes/pointblank.Rmd index 416b6d120..74ec58eb8 100644 --- a/vignettes/pointblank.Rmd +++ b/vignettes/pointblank.Rmd @@ -121,10 +121,10 @@ Some validation methods like `col_exists()` or `row_count_match()` have only a s ## Using Action Levels -Knowing about the numbers of test units across validation methods matters because you have the option to set action levels (that can signal 'warn_at', 'stop_at', and 'notify_at' flags) based on either the relative proportion or absolute number of failing test units. +Knowing about the numbers of test units across validation methods matters because you have the option to set action levels (that can signal 'warn', 'error', and 'critical' flags) based on either the relative proportion or absolute number of failing test units. ```{r} -al <- action_levels(warn_at = 2, stop_at = 4) +al <- action_levels(warn = 2, error = 4) small_table %>% col_vals_lt(a, value = 7, actions = al) @@ -146,10 +146,10 @@ If you look at the validation report table, we can see: - The `FAIL` column shows that 2 tests units have failed. - the `W` column (short for 'warning') shows a filled yellow circle indicating those failing test units reached that threshold value. -- the `S` column (short for 'stop') shows an open red circle indicating that the number of +- the `E` column (short for 'error') shows an open red circle indicating that the number of failing test units is below that threshold. -The one final action level, `N` (for 'notify'), wasn't set so it appears on the validation table as a long dash. +The one final action level, `C` (for 'critical'), wasn't set so it appears on the validation table as a long dash. Setting thresholds is important since you might want some sort of signal for the discovery of errors in your data. How you set the particular threshold levels is highly dependent on your tolerance for data failures.