2.2 Quarto options

Open the slides in a new tab here.

Exercises

  1. Download this quarto document with some {gtsummary} tables from yesterday.
  2. Render the document and examine it. For this first set of exercises, don’t make any changes to the code, only the options.
  3. I don’t like seeing the output from the first chunk, where the packages are loaded. Use an option that makes it so that we don’t see this chunk’s output.
  4. Let’s not print the code from creating the tables. Using an option for the whole document, make it so that we don’t see the code from any of the chunks.
  5. Play around with themes!

Exercises part 2

  1. Create an new chunk and paste in this code:
tbl_summary(
  NLSY,
  by = sex_cat,
  include = c(sex_cat, race_eth_cat, region_cat,
              eyesight_cat, glasses, age_bir))

Try to render it. There’s an error in the code! Play around with eval: and error: chunk and document options to help you b) render the document despite the error and b) find the error. Then fix the error and re-render. 5. Add some text about the data (you can copy and paste from the website) to the document above the code chunks.

Resources

Additional resources for R Markdown will have a lot of overlap: