## ----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)


## ----data---------------------------------------------------------------------
head(PartialDiallelData)
with(data = PartialDiallelData, expr = table(Cross1, Cross2))[1:3, ]


## ----analysis-----------------------------------------------------------------
p <-
  PartialDiallel(
      y      = y
    , Rep    = Rep
    , Cross1 = Cross1
    , Cross2 = Cross2
    , data   = PartialDiallelData
    )
knitr::kable(x = p$ANOVA, digits = 4)
knitr::kable(x = p$Genetic.Components, digits = 4)


## ----effects------------------------------------------------------------------
round(x = p$General, digits = 3)
plot(p)


## ----sca, fig.height = 5------------------------------------------------------
plot(p, which = "sca")

