A Minimal R Markdown Example

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.

Code chunks

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")


Try the inlmisc package in your browser

Any scripts or data that you put into this service are public.

inlmisc documentation built on Jan. 25, 2022, 1:14 a.m.