In your Quarto document, you had a chunk:
#| echo: false tells knitr not to show the code within that chunk
Without the | this would just be a comment, and spacing/position (at the top of the chunk) is important!
Some of the ones I find myself using most often:
#| eval: false: Don’t evaluate this chunk! Really helpful if you’re trying to isolate an error, or have a chunk that takes a long time#| error: true: Render this even if the chunk causes an error#| cache: true: Store the results of this chunk so that it doesn’t need to re-run every time, as long as there are no changes#| warning: false: Don’t print warnings#| message: false: Don’t print messagesYou can tell the entire document not to evaluate or print code (so just include the text!) at the top:
my-document.qmd
Careful! YAML is really picky about spacing, so I recommend copying and pasting from an example you know works.
Sometimes it can be hard to pinpoint errors during the rendering process.
When people are starting out with quarto, I often recommend setting the whole document to
But then you have to remember to read the document for errors!
Rendering starts a fresh R session. Your document has to build using only what’s in it – not the objects sitting in your environment.
Run the chunks top to bottom as you go, but also stop to render occasionally to make sure everything is working.
Tip
This is the single best check on any code, whether you’ve written it, but especially if you’ve copied it from somewhere else, including another file or elsewhere in the same script.
There are lots of different options for the document
html: moves to a new indented line and the options are indented 2 more spacesDownload the quarto document with some {gtsummary} tables from yesterday