The cells_column_labels() function
Use sza to create a gt table. Add footnotes to the column labels with tab_footnote() and cells_column_labels() in locations.
sza |>
dplyr::filter(
latitude == 20 & month == "jan" &
!is.na(sza)
) |>
dplyr::select(-latitude, -month) |>
gt() |>
tab_footnote(
footnote = "True solar time.",
locations = cells_column_labels(
columns = tst
)
) |>
tab_footnote(
footnote = "Solar zenith angle.",
locations = cells_column_labels(
columns = sza
)
)
| tst |
sza |
| 0700 |
84.9 |
| 0730 |
78.7 |
| 0800 |
72.7 |
| 0830 |
66.1 |
| 0900 |
61.5 |
| 0930 |
56.5 |
| 1000 |
52.1 |
| 1030 |
48.3 |
| 1100 |
45.5 |
| 1130 |
43.6 |
| 1200 |
43.0 |