From 1013fe2f01d432d56e6b0ff541b0d385c8f3f631 Mon Sep 17 00:00:00 2001 From: yjunechoe Date: Sun, 4 Aug 2024 13:24:39 +0900 Subject: [PATCH] add argument extract_tbl_checked --- R/interrogate.R | 15 +++++++++++++++ man/interrogate.Rd | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/R/interrogate.R b/R/interrogate.R index 14a3825bf..37722420d 100644 --- a/R/interrogate.R +++ b/R/interrogate.R @@ -44,6 +44,15 @@ #' The default is `TRUE` and further options allow for fine control of how #' these rows are collected. #' +#' @param extract_tbl_checked *Collect validation results from each step* +#' +#' `scalar` // *default:* `TRUE` +#' +#' An option to collect processed data frames produced by executing the +#' validation steps. This information is necessary for some functions +#' (e.g., `get_sundered_data()`), but may grow to a large size. To opt out +#' of attaching this data to the agent, set this argument to `FALSE`. +#' #' @param get_first_n *Get the first n values* #' #' `scalar` // *default:* `NULL` (`optional`) @@ -143,6 +152,7 @@ interrogate <- function( agent, extract_failed = TRUE, + extract_tbl_checked = TRUE, get_first_n = NULL, sample_n = NULL, sample_frac = NULL, @@ -729,6 +739,11 @@ interrogate <- function( # all validation steps have been carried out class(agent) <- c("has_intel", "ptblank_agent") + # Drop $tbl_checked if `extract_tbl_checked = FALSE` + if (!extract_tbl_checked) { + agent$validation_set$tbl_checked <- NULL + } + # Add the ending time to the `agent` object agent$time_end <- Sys.time() diff --git a/man/interrogate.Rd b/man/interrogate.Rd index d7cc65fdd..1a16c3efe 100644 --- a/man/interrogate.Rd +++ b/man/interrogate.Rd @@ -7,6 +7,7 @@ interrogate( agent, extract_failed = TRUE, + extract_tbl_checked = TRUE, get_first_n = NULL, sample_n = NULL, sample_frac = NULL, @@ -31,6 +32,15 @@ An option to collect rows that didn't pass a particular validation step. The default is \code{TRUE} and further options allow for fine control of how these rows are collected.} +\item{extract_tbl_checked}{\emph{Collect validation results from each step} + +\verb{scalar} // \emph{default:} \code{TRUE} + +An option to collect processed data frames produced by executing the +validation steps. This information is necessary for some functions +(e.g., \code{get_sundered_data()}), but may grow to a large size. To opt out +of attaching this data to the agent, set this argument to \code{FALSE}.} + \item{get_first_n}{\emph{Get the first n values} \verb{scalar} // \emph{default:} \code{NULL} (\code{optional})