Learn R Programming

knitr (version 0.6.3)

knit2html: Convert markdown to HTML using knit() and markdownToHTML()

Description

This is a convenience function to knit the input markdown source and call markdownToHTML() to convert the result to HTML.

Usage

knit2html(input, ..., envir = parent.frame())

Arguments

...
options passed to knit
input
path of the input file
envir
the environment in which the code chunks are to be evaluated (can use new.env() to guarantee an empty new environment)

See Also

knit, markdownToHTML

Examples

Run this code
# a minimal example
writeLines(c("# hello markdown", "``` {r hello-random, echo=TRUE}", "rnorm(5)", 
    "```"), "test.Rmd")
knit2html("test.Rmd")
if (interactive()) browseURL("test.html")

Run the code above in your browser using DataLab