R/class_step.R

Defines functions step_reset step_set step_new

step_new <- function() {
  new.env(hash = TRUE, parent = emptyenv())
}

step_set <- function(step, batch, rep, reps) {
  step$batch <- as.integer(batch)
  step$rep <- as.integer(rep)
  step$index <- as.integer(rep + (reps * (batch - 1)))
}

step_reset <- function(step) {
  step$batch <- NULL
  step$rep <- NULL
  step$index <- NULL
}

step_tar_rep <- step_new()
wlandau/tarchetypes documentation built on April 11, 2025, 11:47 p.m.