Le mot de la fin
today
Hello Quarto
share • collaborate • teach • reimagine
(un Notebook pour les gouverner tous)
Aurélie Mercadié
Christophe Regouby
camembr.quarto.pub/hello-quarto
artwork by allison horst
Une définition
Une définition
Le Notebook, c’est la rencontre entre
Quelques exemples
Quelques exemples
Quelques exemples
::: :::
Quelques exemples
tout un écosystème…
Quarto unifie et étend
l’écosystème R Markdown
Quarto unifie et étend
l’écosystème R Markdown
unifie les fans de R Markdown
étend l’écosysteme à ceux qui ne connaissent pas R Markdown
Quarto se présente comme le nouveau système open-source
de publication d’articles scientifiques and techniques
Quarto se présente comme le nouveau système open-source
de publication d’articles scientifiques and techniques
dans le but de rendre le process de création
et de collaboration radicalement plus simple
Consistent implementation of attractive and handy features across outputs: tabsets, code-folding, syntax highlighting, etc.
More accessible defaults as well as better support for accessibility
Guardrails, particularly helpful for new learners: YAML completion, informative syntax errors, etc.
Support for other languages like Python, Julia, Observable, and more via Jupyter engine for executable code chunks.
Tooling that makes it easy to share what you do
with the world on the web is incredibly useful
It’s useful not just to you, but to the world
as it facilitates open sharing of knowledge
for learning and for reuse
Many Data scientists
use Python
😬
_quarto.yml
contents:
- section: in-development/index.qmd
contents:
- in-development/earthdata-access-demo.ipynb
- in-development/nsidc/icesat2-cmr-onprem-vs-cloud.ipynb
- in-development/lpdaac/lpdaac_ecostress_lste_kerchunk.ipynb
- in-development/matlab-aws.qmd
- in-development/earthdata-python-r-handoff.rmd
- section: contributing/onboarding.qmd
contents:
- contributing/quarto-website-tutorial.md
Suivre les instructions de Quarto.org.
quarto
Quarto peut s’utiliser en dehors de tout IDE, directement en ligne de commande
Une fois l’installation faite, comment lancer Quarto?
Une fois l’installation faite, comment lancer Quarto?
Une fois l’installation faite, comment lancer Quarto?
Une fois l’installation faite, comment lancer Quarto?
Que peut-on faire en Quarto ?
Que peut-on faire en Quarto ?
Quarto rend possible de passer de l’un à l’autre sans (presque) aucune modification dans le code!
Quoi de plus que dans Rmarkdown (HTML) ?
margin
: Mettre des figures à côté (et non plus juste en dessous) du code
columns
: arranger plus ou moins la place prise par l’objet en fonction du bloc
Possible de copier-coller une image (s’enregistre automatiquement dans un dossier images
)
Ainsi que du texte formaté (Quarto va conserver ce format).
Les trucs un peu gadget (mais quand même cool!) :
.ppt
Au-revoir les captures écran pour intégrer les graphiques et tableaux depuis R dans les présentations!
Quoi de plus que dans RMarkdown ?
Faire apparaître au fur et à mesure le code pour pouvoir le commenter plus facilement
# Most basic bubble plot
data %>%
arrange(desc(pop)) %>%
mutate(country = factor(country, country)) %>%
ggplot(aes(x=gdpPercap, y=lifeExp, size=pop, fill=continent)) +
geom_point(alpha=0.5, shape=21, color="black") +
scale_size(range = c(.1, 24), name="Population (M)") +
scale_fill_viridis(discrete=TRUE, guide=FALSE, option="A") +
theme_ipsum() +
theme(legend.position="bottom") +
ylab("Life Expectancy") +
xlab("Gdp per Capita") +
theme(legend.position = "none")
chalkboard
Pour en savoir plus: chalkboard
$ quarto install extension quarto-ext/pointer
Raccourci = Touche q
pour switcher entre le curseur et le pointeur.
Pas possible ?! Ok, essayons de monter un site web…
quarto publish
.qmd
et .ipynb
)Quarto est polyglote
Quarto est polyglote
Quarto permet d’exécuter du code
python,
R
Observable.hq
Julia …
dans le même notebook
en partageant les données
python
R
Observable.js
```{ojs}
//| echo: true
render(mySVG)
xProperty = 'flipper_length_mm'
yProperty = 'bill_length_mm'
function render(div) {
// draw on the SVG with D3
const selection = d3.select(div).select('svg');
const xExtent = d3.extent(rpingouin, d => d[xProperty]);
const x = d3.scaleLinear().domain(xExtent).range([30,width-30]);
const xAxis = d3.axisBottom(x);
selection.select("#xAxis")
.call(xAxis);
const yExtent = d3.extent(rpingouin, d => d[yProperty]);
const y = d3.scaleLinear().domain(yExtent).range([30,height-30]);
const yAxis = d3.axisLeft(y);
selection.select("#yAxis")
.call(yAxis);
const colorScale = d3.scaleOrdinal(d3.schemeCategory10);
selection.selectAll('circle')
.data(rpingouin.filter(d => d[xProperty] !== "NA"))
.join('circle')
.attr('r', 15)
.style('opacity', 0.2)
.style('fill', d => colorScale(d.species))
.transition()
.duration(3000)
.attr('cx', d => x(d[xProperty]) )
.attr('cy', d => y(d[yProperty]) );
const legend = swatches({color: colorScale});
d3.select(div).select("#legend")
.append(() => legend);
}
mySVG = html`<div style="width:${width}px; height:${height+50}px">
<div id="legend"></div>
<svg width=${width} height=${height}>
<circle r=50 cx=100 cy=100 fill="seagreen"></circle>
<g id="xAxis" transform="translate(0,${height-20})"></g>
<g id="yAxis" transform="translate(25,0)"></g>
</svg>
</div>
```
::: {style=“margin-top: 50px; font-size: 1.5em; color: #75AADB;”} ” Yes but I have so many of the following notebooks already ”
flowchart LR B[.Rmd notebook] --fas:fa-magic--> Q(Quarto Notebook) A[fa:fa-python .ipynb notebook] --fas:fa-magic--> Q(Quarto Notebook) D[Observable.hq notebook] --fas:fa-magic--> Q(Quarto Notebook) C[LaTeX] --fas:fa-magic--> Q(Quarto Notebook)
Rmd migration
in 2.5 sec
Rmd migration
in 7.5 sec
New documents :
:::
install ohq2quarto from github: Save an Observable HQ Notebook to a Quarto project
step 1 : use the import command
WiP
(more at the post-event bar)
.Rmd
\(\rightarrow\) .qmd
simple et lecture de .Rmd
via Quarto CLI possibleCTRL + espace
) et pour les chunk options: pareil, pratique quand on a un trou de mémoire (ou qu’on veut savoir toutes les options disponibles)Merci !
Pick up where we left off: github.com/mine-cetinkaya-rundel/hello-quarto-demo
rstudio::conf(2022) – Quarto deep dive:
Video: Openscapes: Hello Quarto with NASA Openscapes, RLadies Santa Barbara, and JJ Allaire
Quarto documentation: quarto.org
Quarto gallery: quarto.org/docs/gallery
Quarto tip a day: rstd.io/quartotip
Demo: JupyterLab JupyterHub managed by 2i2c https://2i2c.org
Other Rey with Quarto, throwback to https://jules32.github.io/useR-2019-keynote
Photo credit for Holland Stam: https://undergraduateresearch.duke.edu/news/data-scraping-art-history-survey-texts
📦 arthistory: https://saralemus7.github.io/arthistory
FayLab Manual
Quarto Mosaic
See also: 3 takeaways for planning for the year of open science
pas posible pour les slides…
problème pour la faire fonctionner en revealjs et html…
solution pour publier des sites web, proposée par Quarto (Posit)
Probablement d’autres aspects sympas, mais pas d’expérience sur ces formats.