assign.redo: Assign Redo Variables

View source: R/assign_redo.R

assign.redoR Documentation

Assign Redo Variables

Description

When you have various chunks of code you may or may not to rerun during script execution (and rather load from a file, say), you can set certain variables to TRUE/FALSE for use in if() statements to run that chunk or not. This function creates those variables and assigns them their default state.

Usage

assign.redo(redo.vars, state = FALSE)

Arguments

redo.vars

A character vector of the variable names you want to give TRUE or FALSE to

state

A the default state to set the redo variables to, either TRUE or FALSE

Examples

chunk.names <- c("chunk1", "chunk2")

assign.redo(chunk.names)

if (redo$chunk1) {
  x <- rnorm(100)
} else {
  x <- data(example_data1)
}

kstagaman/redoControl documentation built on April 6, 2022, 8:04 a.m.