R/error_counter.R

Defines functions increase_error_counter_by

increase_error_counter_by <-
  function(x, envir = knitr::knit_global())
  {
    # get value from environment (return NULL if not exists)
    num_errors_total = get0(x = "repror_error_counter",
                            envir = envir)

    if (is.null(num_errors_total))
      num_errors_total <- 0

    # increase value
    num_errors_total = num_errors_total + x

    # assign value to environment
    assign(x = "repror_error_counter",
           value = num_errors_total,
           envir = envir)
  }

Try the reproducibleRchunks package in your browser

Any scripts or data that you put into this service are public.

reproducibleRchunks documentation built on Aug. 8, 2025, 6:38 p.m.