2.3 Quarto tables, figures, and stats

Open the slides in a new tab here.

Exercises

Return to your quarto document with the tables.

  1. Choose a table to label and caption, and then write a sentence that cross-references it (e.g., Table 1 shows the descriptive statistics)
  2. Add a chunk where you calculate the mean number of hours of sleep on weekends (you can use the mean() function). Have the code print that output.
  3. Now, store that value as an object in the chunk. Add it as inline text.
  4. Finally, calculate the statistic directly as inline text.
  5. Change the means to medians and re-render.

Exercises part 2

  1. Add a chunk with the table1 table from the slides. Practice extracting the output using inline_text() as in the slides.
  2. Edit or create a new table that has the median hours of sleep on weekends in it (in the overall sample).
  3. From that table, pull out the that value and include in the text using inline_text().

Resources