Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.

Running Code

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

Code
#| output: false
sza<-gt::sza
library(gt)
Warning: package 'gt' was built under R version 4.2.3
Code
sza1<-sza |>
  dplyr::filter(latitude == 20 & tst <= "1200") |>
  dplyr::select(-latitude) |>
  dplyr::filter(!is.na(sza)) |>
  dplyr::mutate(saa = 90 - sza) |>
  dplyr::select(-sza) |>
  tidyr::pivot_wider(
    names_from = tst,
    values_from = saa,
    names_sort = TRUE
  ) 

sza1%>%
  gt::gt(rowname_col = "month") |>
  gt::tab_header(
    title = "Solar Altitude Angles",
    subtitle = "Average values every half hour from 05:30 to 12:00"
  ) |>
  gt::cols_nanoplot(
    columns = matches("0"),
    plot_type = "line",
    missing_vals = "zero",
    new_col_name = "saa",
    plot_height = "2.5em",
    
    # options = gt::nanoplot_options(
    #   data_bar_stroke_color = "GoldenRod",
    #   data_bar_fill_color = "DarkOrange"
    # )
  ) |>
  # gt::cols_hide(columns = matches("0")) |>
  gt::tab_options(
    table.width = gt::px(400),
    column_labels.hidden = FALSE
  ) |>
  gt::cols_align(
    align = "center",
    columns = everything()
  ) |>
 gt:: tab_source_note(
    source_note = "The solar altitude angle is the complement to
    the solar zenith angle. TMYK."
  )
Solar Altitude Angles
Average values every half hour from 05:30 to 12:00
0530 0600 0630 0700 0730 0800 0830 0900 0930 1000 1030 1100 1130 1200 saa
jan NA NA NA 5.1 11.3 17.3 23.9 28.5 33.5 37.9 41.7 44.5 46.4 47.0
47.0 0 0 0 0 5.10 11.3 17.3 23.9 28.5 33.5 37.9 41.7 44.5 46.4 47.0
feb NA NA 1.1 7.5 14.2 20.4 26.7 32.3 37.8 42.6 46.9 50.0 52.2 52.8
52.8 0 0 0 1.10 7.50 14.2 20.4 26.7 32.3 37.8 42.6 46.9 50.0 52.2 52.8
mar NA NA 4.3 11.2 18.0 24.8 31.4 37.7 43.8 49.5 54.5 58.6 61.4 62.3
62.3 0 0 0 4.30 11.2 18.0 24.8 31.4 37.7 43.8 49.5 54.5 58.6 61.4 62.3
apr NA 1.5 8.5 15.6 22.6 29.7 36.6 43.5 50.3 56.8 63.1 68.7 72.8 74.5
74.5 0 0 1.50 8.50 15.6 22.6 29.7 36.6 43.5 50.3 56.8 63.1 68.7 72.8 74.5
may NA 5.0 11.8 18.8 25.7 32.8 39.8 46.8 53.9 60.9 63.9 74.8 81.2 85.0
85.0 0 0 5.00 11.8 18.8 25.7 32.8 39.8 46.8 53.9 60.9 63.9 74.8 81.2 85.0
jun 0.8 7.3 14.0 20.7 27.5 34.3 41.2 48.1 55.0 61.9 68.9 75.8 82.7 88.0
88.0 0.80 0.80 7.30 14.0 20.7 27.5 34.3 41.2 48.1 55.0 61.9 68.9 75.8 82.7 88.0
jul 1.2 7.7 14.3 20.9 27.7 34.5 41.3 48.2 55.0 61.9 68.8 75.7 82.3 86.9
86.9 1.20 1.20 7.70 14.3 20.9 27.7 34.5 41.3 48.2 55.0 61.9 68.8 75.7 82.3 86.9
aug NA 6.2 12.9 19.8 26.7 33.6 40.6 47.6 54.6 61.7 68.7 75.7 82.7 88.1
88.1 0 0 6.20 12.9 19.8 26.7 33.6 40.6 47.6 54.6 61.7 68.7 75.7 82.7 88.1
sep NA 2.8 9.8 16.8 23.9 30.9 37.9 44.9 51.9 58.7 65.3 71.4 76.3 78.4
78.4 0 0 2.80 9.80 16.8 23.9 30.9 37.9 44.9 51.9 58.7 65.3 71.4 76.3 78.4
oct NA NA 5.9 12.9 19.8 26.7 33.5 40.1 46.5 52.5 58.0 62.6 65.7 66.9
66.9 0 0 0 5.90 12.9 19.8 26.7 33.5 40.1 46.5 52.5 58.0 62.6 65.7 66.9
nov NA NA 2.2 8.7 15.5 21.7 28.2 34.0 39.8 44.7 49.3 52.6 54.9 55.6
55.6 0 0 0 2.20 8.70 15.5 21.7 28.2 34.0 39.8 44.7 49.3 52.6 54.9 55.6
dec NA NA NA 5.7 12.0 18.2 23.9 29.5 34.4 39.1 42.8 45.8 47.6 48.2
48.2 0 0 0 0 5.70 12.0 18.2 23.9 29.5 34.4 39.1 42.8 45.8 47.6 48.2
The solar altitude angle is the complement to the solar zenith angle. TMYK.
Code
# https://rdrr.io/github/rstudio/gt/man/cols_nanoplot.html

You can add options to executable code like this