R/void_dev.R

Defines functions void_dev

Documented in void_dev

#' Open a void device
#'
#' This function opens a graphic device that accepts inputs, but do not perform
#' any action. As such it is useful for benchmarking graphic code as it removes
#' the device implementation from the implementation.
#'
#' @export
#'
#' @examples
#' void_dev()
#' # Any plotting instructions will now have no effect
#' plot(1:10000, 1:10000)
#' dev.off()
void_dev <- function() {
  invisible(.Call('void_dev', PACKAGE = 'devoid'))
}

Try the devoid package in your browser

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

devoid documentation built on April 25, 2023, 5:10 p.m.