run <- FALSE
root_dir <- paste(rep("../", 1), collapse = "")
knitr::opts_chunk$set(comment = "#>", collapse = TRUE)
knitr::opts_knit$set(root.dir = root_dir)

Generic function

preprocess <- function(dat, ...) {
  UseMethod("preprocess", dat)
}

Default method

Suppose you had a very specific preprocessing goal in mind that was based on taking a data.frame as an input

preprocess.data.frame <- function(dat, ...) {
  dat[nrow(dat), ]
}
preprocess(mtcars)


rappster/instancer documentation built on May 26, 2019, 11:17 p.m.