R/benchmark.R

benchmark <- function(fcn, tags=NULL, path=NULL, workdir="reports", envir=parent.frame(), ...) {
  require("R.rsp", character.only=TRUE) || stop("R.rsp not installed.")

  if (is.function(fcn)) {
    fcn <- deparse(substitute(fcn))
  }

  if (is.null(path)) {
    path <- system.file("benchmarking", package="matrixStats")
  }

  fullname <- paste(c(fcn, tags), collapse=",")
  filename <- sprintf("%s.md.rsp", fullname)
  pathname <- file.path(path, filename)

  R.rsp::rfile(pathname,workdir=workdir, envir=envir, ...)
} # benchmark()

############################################################################
# HISTORY:
# 2014-06-02
# o Created.
############################################################################

Try the matrixStats package in your browser

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

matrixStats documentation built on May 2, 2019, 4:52 p.m.