Knitr :: spin Disallow execution of all chunks

I would like to document some R functions (not scripts) as html pages using spin (). I thought of something like:

#' Test of rmarkdown  wit spin() for an html documented function
#' =======================================================
#+ eval=FALSE
test <- function(x,y)
{
  #' comment 1
  z <- x + y 
  #' comment 2
  z
}

      

But #+ eval=FALSE

it only applies to the first snippet. Is there a way to prevent all chunks from actually executing with one command at the beginning?

+3


source to share


1 answer


Install globally:



#' Test of rmarkdown  wit spin() for an html documented function
#' =======================================================
#+ setup, include=FALSE
knitr::opts_chunk$set(eval = FALSE)
#+
test <- function(x,y) {
  # comment 1
  z <- x + y
  # comment 2
  z
}

      

+3


source







All Articles