knit2html

0th

Percentile

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

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

Usage
knit2html(input, ..., text = NULL, envir = parent.frame())
Arguments
...
options passed to markdownToHTML
input
path of the input file
text
a character vector as an alternative way to provide 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)
Value

  • If the argument text is NULL, a character string (HTML code) is returned; otherwise the result is written into a file and NULL is returned.

See Also

knit, markdownToHTML

Aliases
  • knit2html
Examples
# a minimal example
writeLines(c("# hello markdown", "```{r hello-random, echo=TRUE}", "rnorm(5)", "```"), 
    "test.Rmd")
knit2html("test.Rmd")
if (interactive()) browseURL("test.html")
Documentation reproduced from package knitr, version 0.9, License: GPL

Community examples

Looks like there are no examples yet.