The contents of this document were adapted from one of Yihui Xie's wonderful examples.
To convert to a HTML document, run this in R using the
knitr::knit2html("knitr-markdown.Rmd")
command.
Below are some code chunks as examples.
if (TRUE) cat("_hello_ **markdown**!", "\n")
Normally you do not need any chunk options.
1+1 10:1 rnorm(5)^2 strsplit("hello, markdown vignettes", "")
Feel free to draw beautiful plots and write math $P(X>x)=\alpha/2$.
n <- 300; set.seed(123) x <- rnorm(n) y <- rnorm(n)
par(mar = c(4, 4, 0.1, 0.1)) plot(x, y, pch = 21, cex = 5 * runif(n), col = "white", bg="gray")
You can use your own CSS file instead of the built-in style in the
markdown package -- just set the option markdown.HTML.stylesheet
, e.g.
options(markdown.HTML.stylesheet = "path/to/a/custom/style.css")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.