R/design_experiment.R
design_experiment.Rd
design_experiment
provides experimental design for the different situations corresponding to
the choosen family of analysis
design_experiment(expe.type, location = "location", year = "2016", germplasm, controls, nb.controls.per.block, nb.blocks, nb.cols, return.format = "standard", allow_XXXX = TRUE)
expe.type | The type of experiment to settle "satellite-farm", "regional-farm", "row-column", "fully-repicated", "IBD". See details for more information. |
---|---|
location | Name of the location. |
year | Year of the experiment. |
germplasm | Vector with the names of the germplasm. |
controls | Vector with names of controls. |
nb.controls.per.block | Number of controls per blocks. |
nb.blocks | Number of blocks. For expe.type = "IBD", it corresponds to the number of locations. |
nb.cols | Number of columns in the design. The number of rows is computed automaticaly. |
return.format | "standard" or "shinemas". See details for more information. |
allow_XXXX | TRUE or FALSE. Allow to have XXXX placed in stead of germplasm in order to fill the design. |
The function returns a list with
data.frame : A data frame according to return.format
design : An image of the experimental design
regarding return.format :
"standard" return a data frame with the following columns : "location", "year", "germplasm", "block", "X" and "Y".
"shinemas" for SHiNeMaS reproduction template file. It returns a data frame with the following columns :"project", "sown_year", "harvested_year", "id_seed_lot_sown", "intra_selection_name", "etiquette", "split", "quantity_sown", "quantity_harvested", "block", "X" and "Y".
Note that an efficient R package to design experiment is DiGGer, see http://www.austatgen.org/software/ for mor details. Unfortunately, the lience of the package did not allow us to fork the code.
In this function, the code is based on the following algorithms:
"satellite-farm"
randomize the germplasm
get the data frame with one block, two columns and one control in each column
randomize the columns
"regional-farm"
randomize the germplasm
get the data frame with blocks, columns and controls in each block
arrange at least one control per row
for each row, put control in different column
randomize rows and columns
check that controls do not touch each other
check number of controls in col and row and send a warning message if control are missing in rows or columns
"row-column" Note that expe.type = "row-column" is particular case of expe.type = "regional-farm" where the number of controls must be at least the number of columns or rows.
randomize the germplasm
get the data frame with blocks, columns and controls in each block
arrange at least one control per row
for each row, put control in different column
randomize rows and columns
check that controls do not touch each other
check number of controls in col and row and send a stop message if control are missing in rows or columns
"fully-repicated"
randomize the germplasm
get the data frame with blocks, columns and germplasm in each block
arrange randomization so that no germplasm can be in the same column between blocks
"IBD"
the randomization is based on the ibd function in the ibd package. See ?ibd
for more information
See exampels in the book : here.