-
Notifications
You must be signed in to change notification settings - Fork 21
/
README.Rmd
161 lines (106 loc) · 5.83 KB
/
README.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
library(FielDHub)
knitr::opts_chunk$set(
collapse = TRUE,
comment = NA,
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<br>
# FielDHub <img src='man/figures/icon.gif' width = "140px" align="right"/>
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/FielDHub)](https://cran.r-project.org/web//packages/FielDHub/)
[![R-CMD-check](https://github.com/DidierMurilloF/FielDHub/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/DidierMurilloF/FielDHub/actions/workflows/R-CMD-check.yaml)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![cranlogs](https://cranlogs.r-pkg.org/badges/FielDHub)](https://cranlogs.r-pkg.org/badges/FielDHub)
[![cranlogs](https://cranlogs.r-pkg.org/badges/grand-total/FielDHub)](https://cranlogs.r-pkg.org/badges/grand-total/FielDHub)
<!-- badges: end -->
## A Shiny App for Design of Experiments in Life Sciences
## Installation
### From CRAN
``` r
install.packages("FielDHub")
```
### From GitHub
``` r
remotes::install_github("DidierMurilloF/FielDHub")
```
## FielDHub Paper
[![DOI](https://joss.theoj.org/papers/10.21105/joss.03122/status.svg)](https://doi.org/10.21105/joss.03122)
## Overview
A shiny design of experiments (DOE) app that aids in the creation of traditional, un-replicated, augmented and partially-replicated designs applied to agriculture, plant breeding, forestry, animal and biological sciences.
For more details and examples of all functions present in the FielDHub package. Please, go to <https://didiermurillof.github.io/FielDHub/reference/index.html>.
<img src='man/figures/FielDHub_Infographic.jpg' align="center"/>
## Usage
This is a basic example which shows you how to launch the app:
``` r
library(FielDHub)
run_app()
```
### Diagonal Arrangement Example
A project needs to test 280 genotypes in a field containing 16 rows and 20 columns of plots. In this example, these 280 genotypes are divided among three different experiments. In addition, four checks are included in a systematic diagonal arrangement across experiments to fill 40 plots representing 12.5% of the total number of experimental plots. An option to include filler plots is also available for fields where the number of experimental plots does not equal the number of available field plots.
<img src='man/figures/DExample.PNG' align="center"/>
The figure above shows a map of an experiment randomized as a Decision Block Unreplicated Design with Checks on Diagonals. Yellow, gray, and green shade the blocks of unreplicated experiments, while distinctively colored check plots are replicated throughout the field in a systematic diagonal arrangement.
To illustrate using FielDHub to build experimental designs through R code, the design produced in the R Shiny interface described above can also be created using the function `diagonal_arrangement()` in the R script below. Note, that to obtain identical results, users must include the same seed number in the script as was used in the Shiny app. In this case, the seed number is 1249.
```{r}
diagonal <- diagonal_arrangement(
nrows = 16,
ncols = 20,
lines = 280,
checks = 4,
plotNumber = 101,
splitBy = "row",
seed = 1249,
kindExpt = "DBUDC",
blocks = c(100, 100, 80)
)
```
Users can print the returned values from `diagonal_arrangement()` as follow,
```{r}
print(diagonal)
```
First 12 rows of the fieldbook,
```{r}
head(diagonal$fieldBook, 12)
```
Users can plot the layout design from `diagonal_arrangement()` using the function `plot()` as follows,
```{r, fig.align='center', fig.width=6.8, fig.height=4.7}
plot(diagonal)
```
The main difference between using the FielDHub Shiny app and using the standalone function `diagonal_arrangement()` is that the standalone function will allocate filler only if it is necessary, while in R Shiny, filler plots are generated automatically. In cases where users include fillers, either between or after experiments, the Shiny app is preferable for filling and visualizing all field plots.
### Partially Replicated Design Example
Partially replicated designs are commonly employed in early generation field trials. This type of design is characterized by replication of a portion of the entries, with the remaining entries only appearing once in the experiment. As an example, considered a field trial with 288 plots containing 75 entries appearing two times each, and 138 entries only appearing once. This field trials is arranged in a field of 16 rows by 18 columns.
<img src='man/figures/pREPExample.PNG' align="center"/>
In the figure above, green plots contain replicated entries, and yellow plots contain entries that only appear once.
Instead of using the Shiny FielDHub app, users can use the standalone FielDHub function `partially_replicated()`. The partially replicated layout described above can be produced through scripting as follows. As noted in the previous example, to obtain identical results between the script and the Shiny app, users need to use the same seed number, which, in this case, is 77.
```{r}
pREP <- partially_replicated(
nrows = 16,
ncols = 18,
repGens = c(138,75),
repUnits = c(1,2),
planter = "serpentine",
plotNumber = 1,
exptName = "ExptA",
locationNames = "FARGO",
seed = 77
)
```
Users can print returned values from `partially_replicated()` as follows,
```{r}
print(pREP)
```
First 12 rows of the fieldbook,
```{r}
head(pREP$fieldBook, 12)
```
Users can plot the layout design from `partially_replicated()` using the function `plot()` as follows,
```{r, fig.align='center', fig.width=6.8, fig.height=4.7}
plot(pREP)
```
To see more examples, please go to <https://didiermurillof.github.io/FielDHub/reference/index.html>.