RaukR 2026 • Data Science With R
Roy Francis
23-Feb-2026
---
title: "This is a title"
format:
revealjs
---
quarto::quarto_render() in R:quarto render in the terminal:Slides are separated by ##. Incremental content on is separated by . . . like below.
Hide or not count a slide:
## Slide Title {visibility="hidden"}
## Slide Title {visibility="uncounted"}
. . .
Any content inside class .notes on a slide are notes. This is only visible in presenter mode (by pressing s).
. . .
The slide content can be organized into columns which can be nested if needed.
:::{.columns}
:::{.column width="50%"}
<div style="background-color:#fdebd0">Left content</div>
:::
:::{.column width="50%"}
<div style="background-color:#eaf2f8">Right content</div>
:::{.column width="60%"}
<div style="background-color:#d0ece7">Inner left</div>
:::
:::{.column width="40%"}
<div style="background-color:#f2d7d5">Inner right</div>
:::
:::
:::
Left content
Right content
Inner left
Inner right
::: {.v-top}
::: {}
- Top aligned
- content
:::
:::
::: {.v-center}
::: {}
- Center aligned
- content
:::
:::
::: {.v-bottom}
::: {}
- Bottom aligned
- content
:::
:::
Rendering of normal text, numbers and symbols.
ABCDEFGHIJKLMNOPQRSTUYWXYZÅÄÖ
abcdefghijklmnopqrstuvwxyzåäö
0123456789
!“#%&/()$@*^~<>-:;,_±|?+=
!"#%&/\()$@*^~<>-:;,_±|?+=
Headings can be defined as shown below.
## Level 2 heading
### Level 3 heading
#### Level 4 heading
##### Level 5 heading
###### Level 6 heading
Level 1 usage is not recommended. Use level 2 for slide titles. Use level 3 and below for other titles.
Text scaling classes
[Largest text]{.largest}
[Larger text]{.larger}
[Large text]{.large}
Normal text.
[Small text]{.small}
[Smaller text]{.smaller}
[Smallest text]{.smallest}
Largest text
Larger text
Large text
Normal text
Small text
Smaller text
Smallest text
Horizontal alignment of text can be adjusted as shown below.
[Left aligned text]{.left}
[Center aligned text]{.center}
[Right aligned text]{.right}
Left aligned text
Center aligned text
Right aligned text
::: {.blockquote}
This line is quoted
:::
This line is quoted
A horizontal line can be created using ---
This is **Bold text** This is Bold text
This is *Italic text* This is Italic text
~~Strikethrough~~ text Strikethrough text
This is subscript H~2~O H2O
This is superscript 2^10 210
This is a [badge]{.badge .badge-primary}
This is a badge
This is a [badge]{.badge .badge-secondary}
This is a badge
This is a [link](r-project.org) This is a link
Fit text to full width.
::: {.r-fit-text}
Attention
:::
Attention
In reports, .aside pushes content into the margin while in revealjs, it is pushed to the bottom.
::: {.aside}
Content inside aside.
:::
Unordered List
- Bullet 1
- Bullet 2
- Sub-bullet 2.1
Incremental List
:::{.incremental}
1. Incremental Bullet 1
2. Incremental Bullet 2
3. Incremental Bullet 3
:::
For more options, see here.
::: {style="color: red"}
This paragraph is red.
:::
This paragraph is red.
[This text is blue]{style="color: blue"}
This text is blue
::: {.callout-note}
This is a callout.
:::
::: {.callout-warning}
This is a callout.
:::
::: {.callout-important}
This is a callout.
:::
::: {.callout-tip}
This is a callout.
:::
::: {.callout-caution}
This is a callout.
:::
Note
This is a callout.
Warning
This is a callout.
Important
This is a callout.
Tip
This is a callout.
Caution
This is a callout.
Variants of callout
::: {.callout-note icon=false}
Icon is disabled
:::
::: {.callout-note appearance="simple"}
Appearance is simple
:::
::: {.callout-note appearance="minimal"}
Appearance is minimal
:::
::: {.callout-note appearance="simple"}
## Custom title
Simple appearance and a custom title
:::
::: {.callout-note appearance="minimal"}
## Custom title
Minimal appearance and a custom title
:::
Note
Icon is disabled
Appearance is simple
Appearance is minimal
Custom title
Simple appearance and a custom title
Custom title
Minimal appearance and a custom title
::: {.callout-note}
This contains code
## Callout with code
```
Sys.Date()
```
:::
Callout with code
This contains code
Sys.Date()
Inline code
`this` looks like this.`r Sys.Date()` producing 2026-02-23.== != && ++ |> <> <- <= <~ /= |=> ->>
Code chunks
Code can also be defined inside chunks.
```
This is code
```
This is code
R code is executed inside code blocks like this
which shows the code and output.
Sizing pre-formatted inline code
[`Sys.Date()`]{.largest}
[`Sys.Date()`]{.larger}
[`Sys.Date()`]{.large}
`Sys.Date()`
[`Sys.Date()`]{.small}
[`Sys.Date()`]{.smaller}
[`Sys.Date()`]{.smallest}
Sys.Date()
Sys.Date()
Sys.Date()
Sys.Date()
Sys.Date()
Sys.Date()
Sys.Date()
Sizing pre-formatted code block
::: {.small}
```
Sys.Date()
```
:::
Sys.Date()
::: {.smaller}
```
Sys.Date()
```
:::
Sys.Date()
Sys.Date()
Sizing source code
The output can be hidden using echo: false or results: hide.
For more code highlighting documentation, see here.
Using Markdown
Using regular markdown.


The dimensions are based on image and/or fill up the entire width.
Control image dimensions.
{width=50%}
{width=20%}

For more image documentation, see here.
Figure layout
::: {layout-ncol=3}
{#fig-layout-1}
{#fig-layout-2}
{#fig-layout-3}
:::
Absolute positioning
{.absolute top=250 left=0 height="450"}
{.absolute top=200 right=50 height="250"}
{.absolute bottom=0 right=200 height="200"}



Using Raw HTML
This image is 30% size. <img src="assets/featured.webp" style="width:30%;"/>

Using R
R chunks in RMarkdown can be used to control image display size using the argument out.width.
This image is displayed at a size of 200 pixels.
Stack images and display incrementally
::: {.r-stack}
::: {.fragment}
{style="transform:rotate(-5deg);border:beige 40px solid;"}
:::
::: {.fragment}
{style="transform:rotate(5deg);border:beige 40px solid;"}
:::
:::


Stretch images to use up remaining space.
{.stretch}
Some examples of rendering equations.
$e^{i\pi} + 1 = 0$
$$\frac{E \times X^2 \prod I}{2+7} = 432$$
$$\sum_{i=1}^n X_i$$
$$\int_0^{2\pi} \sin x~dx$$
\(e^{i\pi} + 1 = 0\) \[\frac{E \times X^2 \prod I}{2+7} = 432\] \[\sum_{i=1}^n X_i\] \[\int_0^{2\pi} \sin x~dx\]
Some examples of rendering equations.
$\left( \sum_{i=1}^{n}{i} \right)^2 = \left( \frac{n(n-1)}{2}\right)^2 = \frac{n^2(n-1)^2}{4}$
$\begin{eqnarray} X & \sim & \mathrm{N}(0,1)\\ Y & \sim & \chi^2_{n-p}\\ R & \equiv & X/Y \sim t_{n-p} \end{eqnarray}$
$\begin{eqnarray} P(|X-\mu| > k) & = & P(|X-\mu|^2 > k^2)\\ & \leq & \frac{\mathbb{E}\left[|X-\mu|^2\right]}{k^2}\\ & \leq & \frac{\mathrm{Var}[X]}{k^2} \end{eqnarray}$
\(\left( \sum_{i=1}^{n}{i} \right)^2 = \left( \frac{n(n-1)}{2}\right)^2 = \frac{n^2(n-1)^2}{4}\)
\(\begin{eqnarray} X & \sim & \mathrm{N}(0,1)\\ Y & \sim & \chi^2_{n-p}\\ R & \equiv & X/Y \sim t_{n-p} \end{eqnarray}\)
\(\begin{eqnarray} P(|X-\mu| > k) & = & P(|X-\mu|^2 > k^2)\\ & \leq & \frac{\mathbb{E}\left[|X-\mu|^2\right]}{k^2}\\ & \leq & \frac{\mathrm{Var}[X]}{k^2} \end{eqnarray}\)
kableThe most simple table using kable from R package knitr.
kableExtraMore advanced table using kableExtra and formattable.
iris[c(1:2,51:52,105:106),] %>%
mutate(Sepal.Length=color_bar("lightsteelblue")(Sepal.Length)) %>%
mutate(Sepal.Width=color_tile("white","orange")(Sepal.Width)) %>%
mutate(Species=cell_spec(Species,"html",color="white",bold=T,
background=c("#8dd3c7","#fb8072","#bebada")[factor(.$Species)])) %>%
kable("html",escape=F) %>%
kable_styling(bootstrap_options=c("striped","hover","responsive"),full_width=F) %>%
column_spec(5,width="3cm")| Sepal.Length | Sepal.Width | Petal.Length | Petal.Width | Species | |
|---|---|---|---|---|---|
| 1 | 5.1 | 3.5 | 1.4 | 0.2 | setosa |
| 2 | 4.9 | 3.0 | 1.4 | 0.2 | setosa |
| 51 | 7.0 | 3.2 | 4.7 | 1.4 | versicolor |
| 52 | 6.4 | 3.2 | 4.5 | 1.5 | versicolor |
| 105 | 6.5 | 3.0 | 5.8 | 2.2 | virginica |
| 106 | 7.6 | 3.0 | 6.6 | 2.1 | virginica |
Tables using the gt package. Grammar of tables with extensive customization options.
| Sepal Length | Sepal Width | Petal Length | Petal Width |
|---|---|---|---|
| setosa | |||
| 5.1 | 3.5 | 1.4 | 0.2 |
| 4.9 | 3.0 | 1.4 | 0.2 |
| versicolor | |||
| 7.0 | 3.2 | 4.7 | 1.4 |
| 6.4 | 3.2 | 4.5 | 1.5 |
| virginica | |||
| 6.3 | 3.3 | 6.0 | 2.5 |
| 5.8 | 2.7 | 5.1 | 1.9 |
| Source: Iris data. Anderson, 1936; Fisher, 1936) | |||
DTInteractive table using R package DT.
reactableInteractive tables with reactable.
Plots using base R.
ggplot2Plotting using ggplot2.
highcharterR package highcharter is a wrapper around javascript library highcharts.
library(highcharter)
h <- iris %>%
hchart("scatter",hcaes(x="Sepal.Length",y="Sepal.Width",group="Species")) %>%
hc_xAxis(title=list(text="Sepal Length"),crosshair=TRUE) %>%
hc_yAxis(title=list(text="Sepal Width"),crosshair=TRUE) %>%
hc_chart(zoomType="xy",inverted=FALSE) %>%
hc_legend(verticalAlign="top",align="right") %>% hc_size(height=300,width=500)
htmltools::tagList(list(h))plotlyR package plotly provides R binding around javascript plotting library plotly.
ggplotlyplotly also has a function called ggplotly which converts a static ggplot2 object into an interactive plot.
ggiraphR package ggiraph converts a static ggplot2 object into an interactive plot.
library(ggiraph)
p <- ggplot(iris,aes(x=Sepal.Length,y=Petal.Length,colour=Species))+
geom_point_interactive(aes(tooltip=paste0("<b>Petal Length:</b> ",Petal.Length,"\n<b>Sepal Length: </b>",Sepal.Length,"\n<b>Species: </b>",Species)),size=1)+
theme_bw()
tooltip_css <- "background-color:#f8f9f9;padding:10px;border-style:solid;border-width:2px;border-color:#125687;border-radius:5px;"
girafe(code=print(p), height_svg=2, width_svg=4,
options=list(opts_hover(css="cursor:pointer;stroke:black;fill-opacity:0.3"), opts_zoom(max=5),
opts_tooltip(css=tooltip_css,opacity=0.9), opts_sizing(width=0.6)))R package networkD3 allows the use of interactive network graphs from the D3.js javascript library.
leafletR package leaflet provides R bindings for javascript mapping library; leafletjs.
crosstalkR package crosstalk allows crosstalk enabled plotting libraries to be linked. Through the shared ‘key’ variable, data points can be manipulated simultaneously on two independent plots.
library(crosstalk)
shared_quakes <- SharedData$new(quakes[sample(nrow(quakes), 100),])
lf <- leaflet(shared_quakes,height=300) %>%
addTiles(urlTemplate='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png') %>%
addMarkers()
py <- plot_ly(shared_quakes,x=~depth,y=~mag,size=~stations,height=300) %>%
add_markers()
div(div(lf,style="float:left;width:49%"),div(py,style="float:right;width:49%"))Define inputs
ObservableJS in quarto documentation.
This slide has a colourful background
## Colourful {background-color="#ABEBC6"}
This slide has a background image
## Big Image {background-image="assets/featured.webp"}
css: "styles.css"Change title slide background image by adjusting the following YAML parameters.
---
title-slide-attributes:
data-background-image: "assets/image.webp"
data-background-size: "cover"
data-background-opacity: "1"
---
To add custom end slide picture, set page title
## {background-image="assets/images/image.webp"}
R version 4.5.2 (2025-10-31)
Platform: aarch64-apple-darwin20.0.0
Running under: macOS Tahoe 26.3
Matrix products: default
BLAS/LAPACK: /opt/homebrew/Caskroom/miniforge/envs/r-4.5-arm/lib/libopenblas.0.dylib; LAPACK version 3.12.0
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
time zone: Europe/Stockholm
tzcode source: system (macOS)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] reactable_0.4.4 gt_1.1.0 crosstalk_1.2.2 leaflet_2.2.3
[5] networkD3_0.4.1 dygraphs_1.1.1.6 ggiraph_0.8.12 plotly_4.11.0
[9] highcharter_0.9.4 htmltools_0.5.8.1 ggplot2_4.0.1 DT_0.34.0
[13] formattable_0.2.1 kableExtra_1.4.0 stringr_1.6.0 tidyr_1.3.2
[17] dplyr_1.1.4
loaded via a namespace (and not attached):
[1] tidyselect_1.2.1 viridisLite_0.4.2 farver_2.1.2 S7_0.2.1
[5] fastmap_1.2.0 lazyeval_0.2.2 promises_1.5.0 digest_0.6.38
[9] mime_0.13 timechange_0.3.0 lifecycle_1.0.4 magrittr_2.0.4
[13] compiler_4.5.2 rlang_1.1.6 sass_0.4.10 tools_4.5.2
[17] igraph_2.1.4 yaml_2.3.10 data.table_1.17.8 knitr_1.50
[21] labeling_0.4.3 htmlwidgets_1.6.4 curl_7.0.0 xml2_1.5.0
[25] TTR_0.24.4 RColorBrewer_1.1-3 withr_3.0.2 purrr_1.2.0
[29] grid_4.5.2 xts_0.14.1 xtable_1.8-4 data.tree_1.2.0
[33] scales_1.4.0 cli_3.6.5 rmarkdown_2.30 generics_0.1.4
[37] otel_0.2.0 rlist_0.4.6.2 rstudioapi_0.17.1 httr_1.4.7
[41] commonmark_2.0.0 cachem_1.1.0 assertthat_0.2.1 base64enc_0.1-3
[45] vctrs_0.6.5 jsonlite_2.0.0 litedown_0.8 systemfonts_1.3.1
[49] jquerylib_0.1.4 quantmod_0.4.28 glue_1.8.0 reactR_0.6.1
[53] lubridate_1.9.4 stringi_1.8.7 gtable_0.3.6 later_1.4.4
[57] tibble_3.3.0 pillar_1.11.1 R6_2.6.1 textshaping_1.0.4
[61] evaluate_1.0.5 shiny_1.11.1 lattice_0.22-7 markdown_2.0
[65] backports_1.5.0 broom_1.0.10 httpuv_1.6.16 bslib_0.9.0.9002
[69] Rcpp_1.1.0 uuid_1.2-1 svglite_2.2.2 xfun_0.54
[73] fs_1.6.6 zoo_1.8-14 pkgconfig_2.0.3