Today I learned something simple and cool.
I can use R and Python in the same document with Quarto. To post using different engines, I just need to use the engine option in the code chunk.
For example, to use R, I just need to use engine = "r" in the yaml of the post. To use Python, I just need to use engine = "python".
For R:
execute:
engine: "r"
For Python:
execute:
engine: "python"