run <- FALSE root_dir <- paste(rep("../", 1), collapse = "") knitr::opts_chunk$set(comment = "#>", collapse = TRUE) knitr::opts_knit$set(root.dir = root_dir)
preprocess <- function(dat, ...) { UseMethod("preprocess", dat) }
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.