remove_steps: Remove one or more of an _agent_'s validation steps

View source: R/remove_deactivate.R

remove_stepsR Documentation

Remove one or more of an agent's validation steps

Description

Validation steps can be removed from an agent object through use of the remove_steps() function. This is useful, for instance, when getting an agent from disk (via the x_read_disk() function) and omitting one or more steps from the agent's validation plan. Please note that when removing validation steps all stored data extracts will be removed from the agent.

Usage

remove_steps(agent, i = NULL)

Arguments

agent

An agent object of class ptblank_agent.

i

The validation step number, which is assigned to each validation step in the order of definition. If NULL (the default) then step removal won't occur by index.

Value

A ptblank_agent object.

A ptblank_agent object.

Function ID

9-7

See Also

Instead of removal, the deactivate_steps() function will simply change the active status of one or more validation steps to FALSE (and activate_steps() will do the opposite).

Other Object Ops: activate_steps(), deactivate_steps(), export_report(), set_tbl(), x_read_disk(), x_write_disk()

Examples

# Create an agent that has the
# `small_table` object as the
# target table, add a few
# validation steps, and then use
# `interrogate()`
agent_1 <- 
  create_agent(
    tbl = small_table,
    tbl_name = "small_table",
    label = "An example."
  ) %>%
  col_exists(columns = vars(date)) %>%
  col_vals_regex(
    columns = vars(b),
    regex = "[0-9]-[a-z]{3}-[0-9]"
  ) %>%
  interrogate()
  
# The second validation step has
# been determined to be unneeded and
# is to be removed; this can be done
# by using `remove_steps()` with the
# agent object
agent_2 <-
  agent_1 %>%
  remove_steps(i = 2) %>%
  interrogate()


pointblank documentation built on April 25, 2023, 5:06 p.m.