#' write normal text like this and chunk options like below
#+ label, opt=value
# /*
#' these lines are treated as comments in spin()
1 + 1
# */
(s = system.file("examples", "knitr-spin.R", package = "knitr"))
spin(s) # default markdown
o = spin(s, knit = FALSE) # convert only; do not make a purse yet
knit2html(o) # compile to HTML
# other formats
spin(s, FALSE, format = "Rnw") # you need to write documentclass after #'
spin(s, FALSE, format = "Rhtml")
spin(s, FALSE, format = "Rtex")
spin(s, FALSE, format = "Rrst")
Run the code above in your browser using DataLab