library(knitr) library(rmdformats) library(DT) ## Global options options(max.print = "75") opts_chunk$set(echo = FALSE, cache = FALSE, prompt = FALSE, tidy = FALSE, comment = NA, message = FALSE, warning = FALSE) opts_knit$set(width = 75)
Here is a sample code chunk, just to show that syntax highlighting works as expected.
library(ggplot2) library(dplyr) not_null <- function (v) { if (!is.null(v)) return(paste(v, "not null")) } data(iris) tab <- iris %>% group_by(Species) %>% summarise(Sepal.Length = mean(Sepal.Length), Sepal.Width = mean(Sepal.Width), Petal.Length = mean(Petal.Length), Petal.Width = mean(Petal.Length))
Here is the structure of the iris
dataset.
str(iris)
And blockquote :
Oh ! What a nice blockquote you have here. Much more wonderful than a classical Lorem Ipsum, really.
And we could also include links or simply URLs like this : https://github.com/juba/rmdformats
Here is a sample table output.
kable(tab)
Here is a sample DT:datatable
output.
DT::datatable(tab)
Here we display a crosstab displayed in several different ways with a "pills"
interface. To do this, just pass your table()
result to the pilltabs()
function.
iris$seplc <- cut(iris$Sepal.Length,3) tab <- table(iris$Species, iris$seplc) pilltabs(tab)
An incredibly complex equation :
$$ y = \sqrt{\frac{1}{x}} $$
Here is an histogram.
ggplot(data=iris) + geom_histogram(aes(x=Petal.Width)) + facet_grid(Species~.)
And a wonderful scatterplot, with a caption.
ggplot(data=iris) + geom_point(aes(x=Petal.Width, y=Petal.Length, color=Species))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.