40 + 2
[1] 42
Just like R Markdown files, Quarto files allow for a single document which includes code, text, images, and more.
The text is rendered using markdown format, which means you don’t see the formatted output until you render the file. However, Quarto allows you to switch between a source
and visual
editor, which allows you to see the directly rendered output - try it now.
You can create a section of the document for code using this format. The code will run and output directly to the text below. Not only is this useful for preparing a presentation, but might also be more preferable way to run the code for you as you organise your analysis.
40 + 2
[1] 42
You can control whether the code cell is shown or not using the code cell options. One common use is to hide the code and only show the output. In Quarto, these options can be added to the cell using commands like this. While we see the code in the markdown file, only the output is shown in the rendered file.
[1] 4
You can choose from a bunch of default themes
To change a theme, add a theme option to the header of the document:
---
title: "sample-quarto-document"
format: html
theme: sketchy
---