[This article was first published on
r.iresmi.net , and kindly contributed to
R-bloggers ]. (You can report issue about the content on this page
here )
Want to share your content on R-bloggers?
click here if you have a blog, or
here if you don't.
webr allows R to run in the browser. Let’s play!
Add webr to your quarto environment, in the terminal:
quarto add coatless/quarto-webr
Then, in the YAML header, add:
engine: knitr
filters:
- "webr"
webr:
packages:
- "ggplot2"
- "dplyr"
- "duckdb"
- "glue"
- "ggokabeito"
Now enclose your chunks with {webr-r} instead of {r}.
{dplyr} is a large package, so installing/loading it can take a little time…
Please enable JavaScript to experience the dynamic code cell content on this page.
… should work.
However we can’t INSTALL (yet) a DuckDB extension:
Please enable JavaScript to experience the dynamic code cell content on this page.
So we download and use a local copy of the popular french baby names:
Please enable JavaScript to experience the dynamic code cell content on this page.
How does it look like?
Please enable JavaScript to experience the dynamic code cell content on this page.
Get the 2022 top 9 most popular names and check their past evolution:
Please enable JavaScript to experience the dynamic code cell content on this page.
Please enable JavaScript to experience the dynamic code cell content on this page.
Some were already very popular a long time ago. Half are recent. Names are now much more diluted.
Continue reading :
Playing with webr