R/zzz.R

Defines functions .onLoad

# used evaluate() to avoid overhead of calling new_output_handler() repeatedly
evaluate_default_output_handler <- NULL
# used by knitr, as above, but also for value handler
default_output_handler <- NULL

.onLoad <- function(...) {
  evaluate_default_output_handler <<- new_output_handler()
  default_output_handler <<- new_output_handler()
  # Match knitr's expectations
  default_output_handler$value <<- function(x) {
    render(x, visible = TRUE, envir = parent.frame())
  }
}

Try the evaluate package in your browser

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

evaluate documentation built on Oct. 10, 2024, 5:06 p.m.