## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(collapse = FALSE, comment = "", fig.width = 7, fig.height = 4.2,
                      dev = if (knitr::is_latex_output()) "cairo_pdf" else
                        if (requireNamespace("svglite", quietly = TRUE)) "svglite" else "png")
if (requireNamespace("DiallelAnalysisR", quietly = TRUE)) library(DiallelAnalysisR) else
  pkgload::load_all(export_all = FALSE, helpers = FALSE, quiet = TRUE)


## ----notation-----------------------------------------------------------------
nt <-
  da_notation(
      format = c("table", "path", "tex")[1]
    )
nt[, symbol := paste0("$", symbol, "$")]
nt[, argument := ifelse(test = nzchar(argument), yes = paste0("`", argument, "`"), no = "")]
knitr::kable(x = nt[, .(symbol, kind, meaning, argument)])


## ----ems----------------------------------------------------------------------
P <- 8
rbind(
    Method1 = c(gca = 2 * P, sca_in_gca = 2 * (P - 1) / P, sca = 2 * (P^2 - P + 1) / P^2)
  , Method2 = c(P + 2, 1, 1)
  , Method3 = c(2 * (P - 2), 2, 2)
  , Method4 = c(P - 2, 1, 1)
  )

