[1] "Mon Jun 10 07:34:32 2024"
RaukR 2024 • Advanced R for Bioinformatics
Roy Francis
21-Jun-2024
An open-source scientific and technical publishing system built on Pandoc
.qmd
---
title: "This is a title"
format: html
---
Render to PDF format
Requires LaTeX installation
pdf-engine
as neededChange YAML options
For PDF options, see here
revealjs
For RevealJS options, see here
Metadata (YAML)
Text (Markdown)
Code (R, Python, Julia, Observable)
Literate programming is natural language interspersed with programming code for the purpose of documentation, reproducibility and accessibility particularly relevant in data science.
---
key: value
---
format:
html:
smooth-scroll: true
description: "This report contains..."
description: |
This is
a multiline
string
description: >
This is
a multiline
string
items: [ 1, 2, 3, 4, 5 ]
names: [ "one", "two", "three" ]
names:
- "one"
- "two"
- "three"
items:
- things:
thing1: huey
things2: dewey
thing3: louie
- other things:
key: value
---
title: "Iris report"
author: "John Doe"
date: "4-Mar-2023"
format:
html:
toc: true
number-sections: true
execute:
echo: false
warning: false
---
## Iris
Let's explore the **iris** dataset.
### Table
```{r}
#| echo: true
iris[1:3,]
```
### Plot
```{r}
#| label: fig-hist-sepal
#| fig-cap: "Distribution of Sepal lengths."
#| fig-height: 3
hist(iris$Sepal.Length)
```
title: Report
subtitle: Topic
date: today
author: "John Doe"
format:
html:
toc: true
toc-depth: 3
number-sections: true
code-fold: true
df-print: paged
execute:
eval: true
echo: false
warning: false
message: false
freeze: true
Human readable markup
### Heading 3
#### Heading 4
*italic text*
**bold text**
`code text`
~~strikethrough~~
2^10^
2~10~
$2^{10}$
$2_{10}$
italic text
bold text
code text
strikethrough
210
210
\(2^{10}\)
\(2_{10}\)
$\sum\limits_{n=1}^{10} \frac{3}{2}\cdot n$
- bullet point
Link to [this](somewhere.com)
![](https://www.r-project.org/Rlogo.png)
![](https://www.r-project.org/Rlogo.png){width="50%"}
Today’s date is `r date()`
Today’s date is Mon Jun 10 07:34:32 2024
eval: false
to not evaluate a code chunkecho: false
to hide input codeoutput: true
to show output, asis
to skip stylingwarning: false
hides warninsmessage: false
hides messageserror: true
shows error message and continues code executioninclude: false
supresses all outputquarto::quarto_preview("report.qmd")
quarto preview report.qmd
quarto::quarto_render("report.qmd")
quarto render report.qmd
quarto render index.qmd
---
title: "My Document"
params:
alpha: 0.1
ratio: 0.1
---
quarto render document.qmd -P alpha:0.2 -P ratio:0.3
For more parameter options, see here
_quarto.yml
project:
output-dir: _output
toc: true
number-sections: true
format:
html:
css: styles.css
pdf:
documentclass: report
margin-left: 30mm
_metadata.yml
format:
revealjs:
menu: false
progress: false
search: false
quarto render
Interactive documentation
Quarto supports OJS for interactive visualizations in the browser
ojsdata = transpose(ojsd)
viewof x = Inputs.select(Object.keys(ojsdata[0]), {value: "sepal_length", multiple: false, label: "X axis"})
viewof y = Inputs.select(Object.keys(ojsdata[0]), {value: "sepal_width", multiple: false, label: "Y axis"})
Plot.plot({
marks: [
Plot.dot(ojsdata, {
x: x, y: y, fill: "species",
title: (d) => `${d.species} \n Petal length: ${d.petal_length} \n Sepal length: ${d.sepal_length}`})
],
grid: true
})
Quarto supports directly publishing to several popular services
quarto publish quarto-pub
_publish.yml
stores information- source: project
quarto-pub:
- id: "5f3abafe-68f9-4c1d-835b-9d668b892001"
url: "https://njones.quarto.pub/blog"
Publishing documentation
> quarto --help
Commands:
render - Render files or projects to various document types.
preview - Render and preview a document or website project.
serve - Serve a Shiny interactive document.
create - Create a Quarto project or extension
create-project - Create a project for rendering multiple documents
convert - Convert documents to alternate representations.
pandoc - Run the version of Pandoc embedded within Quarto.
run - Run a TypeScript, R, Python, or Lua script.
add - Add an extension to this folder or project
install - Installs an extension or global dependency.
publish - Publish a document or project. Available providers include:
check - Verify correct functioning of Quarto installation.
help - Show this help or the help of a sub-command.
> quarto --version
1.4.549
Getting to know Quarto, Julia Müller, R-Ladies Freiburg 2022
Welcome to Quarto, Tom Mock, Posit Meetup 2023
_
platform x86_64-pc-linux-gnu
os linux-gnu
major 4
minor 3.2
2024 • SciLifeLab • NBIS • RaukR
toc_depth
becomes toc-depth
number_sections
becomes number-sections
code_folding
becomes code-fold
#| echo: false
rather than r{echo=FALSE}
:::
notationRmd | Quarto |
---|---|
html_document | html |
pdf_document | |
word_document | docx |
beamer_presentation | beamer |
powerpoint_presentation | pptx |
revealjs | revealjs |
xaringan | |
distill/tufte | quarto article layout |
html_document2 | quarto crossref |
pdf_document2 | quarto crossref |
word_document2 | quarto crossref |
blogdown/distill | quarto website/quarto blog |
bookdown | quarto books |
shiny documents | quarto interactive documents |
pagedown | |
rticles | |
flexdashboard |