library(knitr)
library(rmdformats)

## Global options
options(max.print = "75")
knitr::opts_chunk$set(
  echo = FALSE, cache = FALSE, prompt = FALSE,
  tidy = FALSE, comment = NA,
  message = FALSE, warning = FALSE
)
opts_knit$set(width = 75)

Code and tables

Syntax highlighting

Here is a sample code chunk, just to show that syntax highlighting works as expected.

say_hello <- function (name) {
  paste("Hello,", name, "!")
}

say_hello("world")

Verbatim

Here is the structure of the penguins dataset.

library(palmerpenguins)
str(penguins)

Table

Sample table output.

tab <- table(penguins$island, penguins$species)
kable(tab)

Sample DT:datatable output.

library(DT)
DT::datatable(penguins)

Here is a crosstab displayed in several different ways with a "pills" interface. To do this, just pass your table() result to the pilltabs() function.

tab <- table(penguins$sex, penguins$species)
pilltabs(tab)

Styling

A simple list :

A 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://www.r-project.org/

An incredibly complex equation :

$$ y = \sqrt{\frac{1}{x + \beta}} $$

Figures

Here is an histogram.

library(ggplot2)
ggplot(data = penguins) +
    geom_histogram(aes(x = body_mass_g)) +
    facet_grid(species~.)

And a wonderful scatterplot, with a caption.

ggplot(data = penguins) + 
  geom_point(aes(x = bill_length_mm, y = bill_depth_mm))


juba/rmdformats documentation built on Feb. 22, 2024, 3:09 p.m.