2.3 Quarto tables, figures, and stats
Open the slides in a new tab here.
Exercises
Return to your quarto document with the tables.
- Choose a table to label and caption, and then write a sentence that cross-references it (e.g., Table 1 shows the descriptive statistics)
- 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. - Now, store that value as an object in the chunk. Add it as inline text.
- Finally, calculate the statistic directly as inline text.
- Change the means to medians and re-render.
Exercises part 2
- Add a chunk with the
table1
table from the slides. Practice extracting the output usinginline_text()
as in the slides. - Edit or create a new table that has the median hours of sleep on weekends in it (in the overall sample).
- From that table, pull out the that value and include in the text using
inline_text()
.