80’s idea from D. Knuth:
write code for humans, not for computer
June 6th, 2024
80’s idea from D. Knuth:
write code for humans, not for computer
One document to rule them all with both text & code
=> export to different formats
Science reproducibility crisis
Is most scientific research false ? Ioanidis et al.
have you had to redo a whole analysis with just slightly different data
(e.g. 1 patient added or removed ?)
Fench book on reproducible research:
Vers une recherche reproductible : faire évoluer ses pratiques
.qmd
(“Quarto markdown”)markdown
: lightweight structured text
qmd = (or Python
, Julia
, …) + markdown
Quarto + pandoc
=> output in many formats (.docx
, .pdf
, .html
, etc…)
(These materials have been prepared in Rmarkdown & Quarto)
.qmd
structure--- title: 'SAVOR: Part II' subtitle: "Dynamic & Reproducible reporting with `Quarto`" author: "Boris Hejblum" date: "06/06/2024" output: ioslides_presentation: number_sections: false ---
Text
Narration
Code Chunks
```{r}
```
results
(default is 'markup'
)
'asis'
- passthrough results'hide'
- do not display results'hold'
- put all results below all codeeval
- Run code in chunk (default is TRUE
)
echo
- Display code in output document (default is TRUE
)
message
- display code messages in document (default is TRUE
)
error
- Display error messages in output document (TRUE
) or stop render when errors occur (FALSE
)
(default is FALSE
)
tidy
- tidy code for display (default is FALSE)warning
- display code warnings in document (default = TRUE)collapse
- collapse all output into single block (default = FALSE)highlight
- highlight source code (default = TRUE)include
- include chunk in doc after running (default = TRUE)comment
- prefix for each line of results (default = ‘##’)fig.align
- figure postion: 'left'
, 'right'
, or 'center'
fig.cap
- figure caption as character string (default is NULL
)fig.height
, fig.width
- Dimensions of plots in inchesout.width
- only in pdf: size of the figureLong running code chunks
cache
- cache results for future knits (default is FALSE
)cache.path
- directory to save cached results in (default is "cache/"
)dependson
- chunk dependencies for caching (default is NULL
)child
- file(s) to knit and then include (default is NULL
)engine
- code language used in chunk (default = )*italic*
— italic**bold**
— bold~~no~~
— verbatim code
^2^
— superscript2~2~
— subscript2$\alpha = \beta^2$
— LaTeX equations: \(\alpha = \beta^2\)# Header1 {#anchor}
## Header 2
Jump to [Header 1](#anchor)
A footnote [^1]
[^1]
: Here is the footnote.
![Caption](pathtoimage.png)
- Bullet 1 - Bullet 2
1. item 1 2. item 2
| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
| 12 | 12 | 12 | 12|
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
Right | Left | Default | Center |
---|---|---|---|
12 | 12 | 12 | 12 |
123 | 123 | 123 | 123 |
1 | 1 | 1 | 1 |
--- bibliography: refs.bib csl: style.csl ---
Smith cited [@smith04]
.
Smith cited without author [-@smith04]
.@smith04
cited in line.
.qmd
practical.qmd