My idea is to keep a more systematic collection of things I learned (TIL).
I was inspired by posts of Simon Wilson and Peter Baumgartner that documented things they have learned.
So here is an initial version and today the TIL has been Quarto.
Here is an example of integrating Tidyverse-R code.
library(tidyverse)
<- as_tibble(datasets::mtcars)
mtcars
ggplot(mtcars, aes(x = hp, y = mpg)) +
geom_point(aes(color = factor(cyl))) +
geom_smooth()
Here is an example of integrating Python code.
import statsmodels.api as sm
import pandas as pd
= sm.datasets.get_rdataset('mtcars').data
mtcars
= "hp", y = "mpg", kind = "scatter") mtcars.plot(x
Some background
Setting up a blog in Quarto was easy and well documented. So I started quickly.
Getting the right Python version running in Quarto was quite a challenge. At the end, the documented recommendation to work with a virtual environment in an env
folder worked. It took me some time to get there.
It only worked temporarily and I will try to run Python in Quarto again at some later point.
Afterwards
It turned out that the particular challenge was having a page with R and Python.
For Python pages a header option was missing. jupyter: python3
solved the Python challenge that took quite some time.
Rendering a Quarto document with R and Python was only possible with a version Docker on the computer.