/
how-to-start.Rmd
68 lines (57 loc) · 1.33 KB
/
how-to-start.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: "How to Start"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{How to Start}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# Identify the Experimental Design
The function `check_design_met` helps us to check the quality of the data and
also to identify the experimental design of the trials. This works as a quality
check or quality control before we fit any model.
```{r setup}
library(agriutilities)
library(agridat)
data(besag.met)
dat <- besag.met
results <- check_design_met(
data = dat,
genotype = "gen",
trial = "county",
traits = "yield",
rep = "rep",
block = "block",
col = "col",
row = "row"
)
```
```{r}
print(results)
```
# Single Trial Analysis
The results of the previous function are used in `single_trial_analysis()` to
fit single trial models.
```{r}
obj <- single_trial_analysis(results, progress = FALSE)
print(obj)
```
# Multi-Environmental Trial Analysis
The results of the previous function are used in `met_analysis()` to
fit multi-environmental trial models.
```{r, eval=FALSE}
met_results <- met_analysis(obj)
print(met_results)
```
```{r, echo=FALSE}
if (requireNamespace("asreml", quietly = TRUE)) {
met_results <- met_analysis(obj)
print(met_results)
}
```