R is for
Authoring!!

OOH Session #104…
Layouts

Open Office Hours
(November 13, 2025)

  • Recap session #103
  • Today’s topic(s):
  • Shared problem-solving

Recap of Session
#103:

Knitting Kables

```{r}
#| label: tbl-mtcars
#| tbl-cap: mtcars vars (trunc)
#| output-location: column

knitr::kable(
  mtcars[1:3, 1:2],
    col.names=c("MPG",
                "CYL",
                "DISP")
  )
```
1
Duplicate of actual object names (only changed capitalization) just to highlight useful col.names parameter
Table 1: mtcars vars (trunc)
MPG CYL DISP
Mazda RX4 21.0 6
Mazda RX4 Wag 21.0 6
Datsun 710 22.8 4
```{r}
#| label: tbl-teeth
#| tbl-cap: ToothGrowth vars (trunc)
#| output-location: column

library(kableExtra)

kbl(
  ToothGrowth[29:31, ]) %>%
  kable_classic() %>%
  row_spec(2, background="#bada55") %>%
  add_header_above(c(" "=1,
                     "Three Vars:"=3))
```
1
Souped up knitr::kable intended to better fit with kableExtra’s piping
Table 2: ToothGrowth vars (trunc)
Three Vars:
len supp dose
29 23.3 VC 2.0
30 29.5 VC 2.0
31 15.2 OJ 0.5

Today…

Layouts

Session Info (November 13, 2025) Rendering:

R version 4.5.0 (2025-04-11 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] kableExtra_1.4.0

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5        svglite_2.2.1      cli_3.6.5          knitr_1.50        
 [5] rlang_1.1.6        xfun_0.52          stringi_1.8.7      textshaping_1.0.0 
 [9] jsonlite_2.0.0     glue_1.8.0         htmltools_0.5.8.1  scales_1.4.0      
[13] rmarkdown_2.29     evaluate_1.0.5     fastmap_1.2.0      yaml_2.3.10       
[17] lifecycle_1.0.4    stringr_1.5.1      compiler_4.5.0     RColorBrewer_1.1-3
[21] rstudioapi_0.17.1  systemfonts_1.2.3  farver_2.1.2       digest_0.6.37     
[25] viridisLite_0.4.2  R6_2.6.1           magrittr_2.0.3     tools_4.5.0       
[29] xml2_1.4.0