Data science with R

Using the tidyverse and Quarto

Aurélien Ginolhac

UniLu

Thursday, the 27th of June, 2024

First slide

  • {.incremental} fenced div 👍
  • from: markdown+emoji in header allows emoji usage 😄
  • Chunk options are hashpipe, completion works great 👋
  • Great trick in RStudio: CTRL+, ✔️

echo: fenced ideal for teaching

  • Fragment for increment
```{r}
#| output-location: column-fragment
1 + 3
mean(c(1, 3, 6))
```
[1] 4
[1] 3.333333

Practical

Using {background="#e4f0ff"} class to the header2

Absolute positioning of image and text, increment with . . .

Console

Columns as fenced divs {.columns} and LaTex

Trying to get rid of xaringanExtra1

contents… 40%

\[\begin{gather*} a_1=b_1+c_1\\ a_2=b_2+c_2-d_2+e_2 \end{gather*}\]

Playing with {.fragment} transitions

Highlight red

Fade in

Slide up while fading in

YAML

::: {.panel-tabset}

---
format: test
---

Layout for images

Install dplyr via RStudio

Install using the console

Two ways of installing packages

.r-fit-text class

Big Text

More in the official Quarto Presentation demo and available code

Blockquote

Literate programming is the practice of mixing code and descriptive writing in order to execute and explain a data analysis simultaneously in the same document.

William Landau

Layout for chunks too

  • Highlight code lines, incremental with |
  • Execute code inside a caption with !expr
```{r}
#| layout-ncol: 2
#| code-line-numbers: "|3-4,6|7"
#| fig-cap: !expr glue::glue("Swiss data are {nrow(swiss)} rows")
#| fig-height: 3
plot(swiss$Agriculture, swiss$Fertility)
plot(swiss$Agriculture, swiss$Education)
```

Swiss data are 47 rows

Swiss data are 47 rows