├── .github ├── .gitignore └── workflows │ ├── R-CMD-check.yaml │ └── pkgdown.yaml ├── vignettes ├── .gitignore ├── fieldhub-0-1-0.md ├── fieldhub-1-2-0.md ├── methods.Rmd ├── references.bib └── news │ └── fieldhub-0-1-0.Rmd ├── LICENSE ├── tests ├── testthat.R ├── spelling.R └── testthat │ ├── test-golem-recommended.R │ ├── test_compute_index_ranges.R │ ├── test_swap_functions.R │ └── test_RCBD_layouts.R ├── FielDHub_Overview.png ├── inst ├── app │ └── www │ │ ├── ana.jpg │ │ ├── johan.jpg │ │ ├── baner46.jpg │ │ ├── drone1.jpg │ │ ├── favicon.ico │ │ ├── matthew.jpg │ │ ├── richard.jpg │ │ ├── Salvador.jpg │ │ ├── ndsulogo.jpg │ │ ├── DidierMurillo.jpg │ │ ├── corner.js │ │ ├── mobile.css │ │ ├── shinybusy.js │ │ └── home.html ├── golem-config.yml └── WORDLIST ├── man ├── figures │ ├── icon.gif │ ├── DExample.jpg │ ├── prep_shiny.jpg │ ├── multiple_expts.jpg │ ├── FielDHub_Infographic.jpg │ ├── README-unnamed-chunk-5-1.png │ └── README-unnamed-chunk-9-1.png ├── run_app.Rd ├── print.fieldLayout.Rd ├── print.summary.FielDHub.Rd ├── summary.FielDHub.Rd ├── print.FielDHub.Rd ├── plot.FielDHub.Rd ├── split_families.Rd ├── do_optim.Rd ├── swap_pairs.Rd ├── CRD.Rd ├── sparse_allocation.Rd ├── incomplete_blocks.Rd ├── latin_square.Rd ├── square_lattice.Rd ├── rectangular_lattice.Rd ├── alpha_lattice.Rd ├── RCBD.Rd ├── split_plot.Rd ├── full_factorial.Rd ├── strip_plot.Rd ├── split_split_plot.Rd └── RCBD_augmented.Rd ├── data ├── Strip_Plot.csv ├── Bad_format_NO_csv.xlsx ├── Full_Factorial.csv ├── Split_Plot.csv ├── Split_Split_Plot.csv ├── Latin_Square.csv ├── RCBD_12_Treatments.csv ├── CRD_11_Treatments.csv ├── CRD_Unbalanced_reps.csv ├── IBD.csv ├── Lattice_Rectangular_42_Treatments.csv ├── Augmented_RCBD_50_Treatments.csv ├── Row_Column_56_Treatments.csv ├── Lattice_Square_64_Treatments.csv ├── Lattice_Alpha_56_Treatments.csv ├── example_matrix_for_testing.csv ├── Diagonal_135_treatments_5_checks.csv ├── Diagonal_Multiple_12x13_1.csv ├── Diagonal_Multiple_12x13_2.csv ├── entry_list_180_trts.csv ├── entry_list_176_trts_1.csv ├── entry_list_176_trts_2.csv ├── Diagonal_188_treatments_4_checks.csv ├── Diagonal_240_treatments_4_checks_same_entries.csv ├── Augmented_RCBD_220_Treatments.csv ├── Bad_format_duplicated_entries.csv ├── Optim_1_15x16.csv ├── Diagonal_Single_14x20.csv ├── pREPS_1_16x20.csv ├── Optim_2_15x16.csv ├── pREPS_2_16x20.csv ├── Diagonal_258_treatments_4_checks.csv ├── Diagonal_Single_15x20.csv ├── Diagonal_260_treatments_4_checks.csv └── Diagonal_260_treatments_4_checks2.csv ├── .dockerignore ├── joss ├── Example_FielDHub4.png ├── FielDHub_Overview_Map.png └── paper.bib ├── .travis.yml ├── R ├── utils_continue_plot_Cart.R ├── utils_continue_plot_Serp.R ├── utils_infoPrint.R ├── run_app.R ├── app_config.R ├── utils_load_file.R ├── utils_get_single_random.R ├── utils_ARCBD_name.R ├── golem_utils_server.R ├── utils_ARCBD_plot_number.R ├── globals.R ├── utils_export_layout.R ├── app_server.R ├── utils_get_random_stacked.R ├── utils_check_input.R ├── utils_automatically_cuts.R ├── utils_get_DBrandom.R ├── utils_ibd_plot_numbers.R ├── ibd_reorder_treatments.R ├── utils_factor_subsets.R └── utils_row_col_optimization.R ├── cran-comments.md ├── app.R ├── dev ├── run_dev.R ├── 03_deploy.R └── 01_start.R ├── FielDHub.Rproj ├── .Rbuildignore ├── LICENSE.md ├── .gitignore ├── NAMESPACE ├── Dockerfile ├── pkgdown └── _pkgdown.yml └── DESCRIPTION /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2021 2 | COPYRIGHT HOLDER: North Dakota State University (NDSU) 3 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(FielDHub) 3 | 4 | test_check("FielDHub") 5 | -------------------------------------------------------------------------------- /FielDHub_Overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/FielDHub_Overview.png -------------------------------------------------------------------------------- /inst/app/www/ana.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/ana.jpg -------------------------------------------------------------------------------- /inst/app/www/johan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/johan.jpg -------------------------------------------------------------------------------- /man/figures/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/man/figures/icon.gif -------------------------------------------------------------------------------- /data/Strip_Plot.csv: -------------------------------------------------------------------------------- 1 | HPLOTS,VPLOTS 2 | A,alpha 3 | B,beta 4 | C,gamma 5 | D,delta 6 | E, 7 | F, 8 | G, 9 | -------------------------------------------------------------------------------- /inst/app/www/baner46.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/baner46.jpg -------------------------------------------------------------------------------- /inst/app/www/drone1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/drone1.jpg -------------------------------------------------------------------------------- /inst/app/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/favicon.ico -------------------------------------------------------------------------------- /inst/app/www/matthew.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/matthew.jpg -------------------------------------------------------------------------------- /inst/app/www/richard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/richard.jpg -------------------------------------------------------------------------------- /man/figures/DExample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/man/figures/DExample.jpg -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .RData 2 | .Rhistory 3 | .git 4 | .gitignore 5 | manifest.json 6 | rsconnect/ 7 | Rproj.user 8 | -------------------------------------------------------------------------------- /data/Bad_format_NO_csv.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/data/Bad_format_NO_csv.xlsx -------------------------------------------------------------------------------- /inst/app/www/Salvador.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/Salvador.jpg -------------------------------------------------------------------------------- /inst/app/www/ndsulogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/ndsulogo.jpg -------------------------------------------------------------------------------- /joss/Example_FielDHub4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/joss/Example_FielDHub4.png -------------------------------------------------------------------------------- /man/figures/prep_shiny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/man/figures/prep_shiny.jpg -------------------------------------------------------------------------------- /inst/app/www/DidierMurillo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/inst/app/www/DidierMurillo.jpg -------------------------------------------------------------------------------- /joss/FielDHub_Overview_Map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/joss/FielDHub_Overview_Map.png -------------------------------------------------------------------------------- /man/figures/multiple_expts.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/man/figures/multiple_expts.jpg -------------------------------------------------------------------------------- /data/Full_Factorial.csv: -------------------------------------------------------------------------------- 1 | FACTOR,LEVEL 2 | A,a0 3 | A,a1 4 | A,a2 5 | B,b0 6 | B,b1 7 | C,c0 8 | C,c1 9 | C,c2 10 | C,c3 11 | -------------------------------------------------------------------------------- /man/figures/FielDHub_Infographic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/man/figures/FielDHub_Infographic.jpg -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r 2 | 3 | language: R 4 | cache: packages 5 | -------------------------------------------------------------------------------- /data/Split_Plot.csv: -------------------------------------------------------------------------------- 1 | WHOLPHOT,SUBPLOT 2 | A,B1 3 | B,B2 4 | C,B3 5 | ,B4 6 | ,B5 7 | ,B6 8 | ,B7 9 | ,B8 10 | ,B9 11 | ,B10 12 | -------------------------------------------------------------------------------- /data/Split_Split_Plot.csv: -------------------------------------------------------------------------------- 1 | WHOLPHOT,SUBPLOT,SUB_SUBPLOT 2 | IRR_N,A,Bean1 3 | IRR_Y,B,Bean2 4 | ,C,Bean3 5 | ,,Bean4 6 | ,,Bean5 7 | ,,Bean6 8 | -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/man/figures/README-unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-9-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DidierMurilloF/FielDHub/HEAD/man/figures/README-unnamed-chunk-9-1.png -------------------------------------------------------------------------------- /data/Latin_Square.csv: -------------------------------------------------------------------------------- 1 | ROW,COLUMN,TREATMENT 2 | week1,cow1,diet1 3 | week2,cow2,diet2 4 | week3,cow3,diet3 5 | week4,cow4,diet4 6 | week5,cow5,diet5 7 | -------------------------------------------------------------------------------- /data/RCBD_12_Treatments.csv: -------------------------------------------------------------------------------- 1 | TREATMENT 2 | alpha 3 | beta 4 | gamma 5 | delta 6 | epsilon 7 | omicron 8 | phi 9 | pi 10 | eta 11 | mu 12 | omega 13 | lambda 14 | -------------------------------------------------------------------------------- /R/utils_continue_plot_Cart.R: -------------------------------------------------------------------------------- 1 | continue_plot_Cart <- function(datos){ 2 | for (i in 1:nrow(datos)){ 3 | datos[i,] <- rev(datos[i, ]) 4 | } 5 | return(datos) 6 | } 7 | 8 | -------------------------------------------------------------------------------- /data/CRD_11_Treatments.csv: -------------------------------------------------------------------------------- 1 | TREATMENT,REP 2 | alpha,4 3 | beta,4 4 | gamma,4 5 | delta,4 6 | epsilon,4 7 | omicron,4 8 | phi,4 9 | pi,4 10 | eta,4 11 | mu,4 12 | omega,4 13 | -------------------------------------------------------------------------------- /data/CRD_Unbalanced_reps.csv: -------------------------------------------------------------------------------- 1 | TREATMENT,REP 2 | alpha,4 3 | beta,4 4 | gamma,4 5 | delta,4 6 | epsilon,4 7 | omicron,4 8 | phi,4 9 | pi,4 10 | eta,1 11 | mu,5 12 | omega,4 13 | -------------------------------------------------------------------------------- /inst/app/www/corner.js: -------------------------------------------------------------------------------- 1 | $( document ).ready(function() { 2 | $( ".navbar .container-fluid" ).append( '' ); 3 | }); 4 | -------------------------------------------------------------------------------- /inst/golem-config.yml: -------------------------------------------------------------------------------- 1 | default: 2 | golem_name: FielDHub 3 | golem_version: 0.1.0 4 | app_prod: no 5 | production: 6 | app_prod: yes 7 | dev: 8 | golem_wd: !expr here::here() 9 | -------------------------------------------------------------------------------- /tests/spelling.R: -------------------------------------------------------------------------------- 1 | if(requireNamespace('spelling', quietly = TRUE)) 2 | spelling::spell_check_test(vignettes = TRUE, error = FALSE, 3 | skip_on_cran = TRUE) 4 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64 2 | Check: CRAN incoming feasibility, Result: Note_to_CRAN_maintainers 3 | Maintainer: 'Didier Murillo ' 4 | Package check result: OK 5 | 6 | No changes to worse in reverse depends. 7 | -------------------------------------------------------------------------------- /app.R: -------------------------------------------------------------------------------- 1 | # Launch the ShinyApp (Do not remove this comment) 2 | # To deploy, run: rsconnect::deployApp() 3 | # Or use the blue button on top of this file 4 | 5 | pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) 6 | options( "golem.app.prod" = TRUE) 7 | FielDHub::run_app() # add parameters here (if any) 8 | -------------------------------------------------------------------------------- /R/utils_continue_plot_Serp.R: -------------------------------------------------------------------------------- 1 | continue_plot_Serp <- function(datos){ 2 | if (nrow(datos) %% 2 == 0) { 3 | for (i in seq(2,nrow(datos),2)) { 4 | datos[i,] <- rev(datos[i, ]) 5 | } 6 | }else{ 7 | for (i in seq(1,nrow(datos),2)) { 8 | datos[i,] <- rev(datos[i, ]) 9 | } 10 | } 11 | return(datos) 12 | } -------------------------------------------------------------------------------- /R/utils_infoPrint.R: -------------------------------------------------------------------------------- 1 | #' infoPrint 2 | #' 3 | #' @description A utils function 4 | #' 5 | #' @return The return value, if any, from executing the utility. 6 | #' 7 | #' @noRd 8 | infoPrint <- function(n, nr) { 9 | nhead <- min(n, nr) 10 | if (n < 0) { 11 | nhead_print <- nr + n 12 | }else { 13 | nhead_print <- nhead 14 | } 15 | return(nhead_print) 16 | } -------------------------------------------------------------------------------- /dev/run_dev.R: -------------------------------------------------------------------------------- 1 | # Set options here 2 | options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode 3 | 4 | # Detach all loaded packages and clean your environment 5 | golem::detach_all_attached() 6 | # rm(list=ls(all.names = TRUE)) 7 | 8 | # Document and reload your package 9 | golem::document_and_reload() 10 | 11 | # Run the application 12 | run_app() -------------------------------------------------------------------------------- /man/run_app.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_app.R 3 | \name{run_app} 4 | \alias{run_app} 5 | \title{Run the Shiny Application} 6 | \usage{ 7 | run_app(...) 8 | } 9 | \arguments{ 10 | \item{...}{Unused, for extensibility} 11 | } 12 | \value{ 13 | A shiny app object 14 | } 15 | \description{ 16 | Run the Shiny Application 17 | } 18 | -------------------------------------------------------------------------------- /FielDHub.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | ProjectId: ebb268b6-9f41-4fe0-aee9-2286cc906b17 3 | 4 | RestoreWorkspace: Default 5 | SaveWorkspace: Default 6 | AlwaysSaveHistory: Default 7 | 8 | EnableCodeIndexing: Yes 9 | UseSpacesForTab: Yes 10 | NumSpacesForTab: 2 11 | Encoding: UTF-8 12 | 13 | RnwWeave: Sweave 14 | LaTeX: pdfLaTeX 15 | 16 | BuildType: Package 17 | PackageUseDevtools: Yes 18 | PackageInstallArgs: --no-multiarch --with-keep.source 19 | -------------------------------------------------------------------------------- /data/IBD.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 2,texas 3 | 3,alabama 4 | 4,arkansas 5 | 5,michael 6 | 6,ndsu 7 | 7,Dean Bresciani 8 | 8,gregor 9 | 9,alice 10 | 10,triple 11 | 11,number 12 | 12,world 13 | 13,how 14 | 14,serpent 15 | 15,north 16 | 16,east 17 | 17,south 18 | 18,west 19 | 19,neophyte 20 | 20,pagan 21 | 21,light 22 | 22,pudding 23 | 23,more 24 | 24,simulate 25 | 25,pencil 26 | 26,paper 27 | 27,wastebasket 28 | 28,triangle 29 | 29,square 30 | 30,circle 31 | 31,line 32 | 32,point 33 | 33,plane 34 | -------------------------------------------------------------------------------- /inst/app/www/mobile.css: -------------------------------------------------------------------------------- 1 | /* Showcase */ 2 | #showcase { 3 | height: 100%; 4 | } 5 | 6 | #showcase .showcase-content { 7 | padding-top: 70px; 8 | padding-bottom: 30px; 9 | } 10 | 11 | /* Home Info */ 12 | /* 13 | #home-info { 14 | height: 550px; 15 | } 16 | 17 | #home-info .info-img { 18 | display: none; 19 | } 20 | 21 | #home-info .info-content { 22 | float: none; 23 | width: 100%; 24 | } 25 | */ 26 | /* Boxes */ 27 | .box { 28 | float: none; 29 | width: 100%; 30 | } -------------------------------------------------------------------------------- /inst/app/www/shinybusy.js: -------------------------------------------------------------------------------- 1 | $(document).on("shiny:busy", function() { 2 | var inputs = document.getElementsByTagName("button", "select"); 3 | console.log(inputs); 4 | for (var i = 0; i < inputs.length; i++) { 5 | inputs[i].disabled = true; 6 | } 7 | }); 8 | 9 | $(document).on("shiny:idle", function() { 10 | var inputs = document.getElementsByTagName("button", "select"); 11 | console.log(inputs); 12 | for (var i = 0; i < inputs.length; i++) { 13 | inputs[i].disabled = false; 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /tests/testthat/test-golem-recommended.R: -------------------------------------------------------------------------------- 1 | test_that("app ui", { 2 | ui <- app_ui() 3 | golem::expect_shinytaglist(ui) 4 | fmls <- formals(app_ui) 5 | for (i in c("request")){ 6 | expect_true(i %in% names(fmls)) 7 | } 8 | }) 9 | 10 | test_that("app server", { 11 | server <- app_server 12 | expect_type(server, "closure") 13 | fmls <- formals(app_server) 14 | for (i in c("input", "output", "session")){ 15 | expect_true(i %in% names(fmls)) 16 | } 17 | }) 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /R/run_app.R: -------------------------------------------------------------------------------- 1 | #' Run the Shiny Application 2 | #' 3 | #' @return A shiny app object 4 | #' @param ... Unused, for extensibility 5 | #' 6 | #' @export 7 | #' @importFrom shiny shinyApp 8 | #' @importFrom golem with_golem_options 9 | 10 | run_app <- function( 11 | ..., 12 | launch.browser = TRUE 13 | ) { 14 | options(shiny.maxRequestSize = 100 * 1024^2) 15 | with_golem_options( 16 | app = shinyApp( 17 | options = list(launch.browser = launch.browser), 18 | ui = app_ui, 19 | server = app_server 20 | ), 21 | golem_opts = list() 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /man/print.fieldLayout.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_S3_methods.R 3 | \name{print.fieldLayout} 4 | \alias{print.fieldLayout} 5 | \title{Print a \code{fieldLayout} plot object} 6 | \usage{ 7 | \method{print}{fieldLayout}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{a plot object inheriting from class fieldLayout.} 11 | 12 | \item{...}{unused, for extensibility.} 13 | } 14 | \value{ 15 | a plot object inheriting from class \code{fieldLayout}. 16 | } 17 | \description{ 18 | Prints a plot object of class \code{fieldLayout}. 19 | } 20 | \author{ 21 | Didier Murillo [aut] 22 | } 23 | -------------------------------------------------------------------------------- /data/Lattice_Rectangular_42_Treatments.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,GYT-01 3 | 2,GYT-02 4 | 3,GYT-03 5 | 4,GYT-04 6 | 5,GYT-05 7 | 6,GYT-06 8 | 7,GYT-07 9 | 8,GYT-08 10 | 9,GYT-09 11 | 10,GYT-10 12 | 11,GYT-11 13 | 12,GYT-12 14 | 13,GYT-13 15 | 14,GYT-14 16 | 15,GYT-15 17 | 16,GYT-16 18 | 17,GYT-17 19 | 18,GYT-18 20 | 19,GYT-19 21 | 20,GYT-20 22 | 21,GYT-21 23 | 22,GYT-22 24 | 23,GYT-23 25 | 24,GYT-24 26 | 25,GYT-25 27 | 26,GYT-26 28 | 27,GYT-27 29 | 28,GYT-28 30 | 29,GYT-29 31 | 30,GYT-30 32 | 31,GYT-31 33 | 32,GYT-32 34 | 33,GYT-33 35 | 34,GYT-34 36 | 35,GYT-35 37 | 36,GYT-36 38 | 37,GYT-37 39 | 38,GYT-38 40 | 39,GYT-39 41 | 40,GYT-40 42 | 41,GYT-41 43 | 42,GYT-42 44 | -------------------------------------------------------------------------------- /inst/WORDLIST: -------------------------------------------------------------------------------- 1 | ARCBD 2 | Acknowledgements 3 | CIAT 4 | CMD 5 | CRD 6 | Changelog 7 | Coombes 8 | Cullis 9 | DOI 10 | Edmondson 11 | Expt 12 | Expts 13 | Federer 14 | FielDHub's 15 | IBD 16 | IBlock 17 | JABES 18 | LeBauer 19 | Lifecycle 20 | María 21 | MultiPrep 22 | NDSU 23 | Oliveira 24 | PYT 25 | RCB 26 | RCBD 27 | RCD 28 | RRCD 29 | RowColD 30 | SPD 31 | SSPD 32 | Soneson 33 | Stefanova 34 | Summarise 35 | Thiago 36 | UI 37 | UX 38 | Un 39 | Unreplicated 40 | approximatelly 41 | blocksdesign 42 | cranlogs 43 | de 44 | doi 45 | dropdown 46 | extensibility 47 | fieldLayout 48 | fieldbook 49 | hirizontal 50 | https 51 | indexable 52 | priori 53 | suboptimal 54 | un 55 | unreplicated 56 | -------------------------------------------------------------------------------- /vignettes/fieldhub-0-1-0.md: -------------------------------------------------------------------------------- 1 | # FielDHub 0.1.0 2 | 3 | * Added capability for making randomizations across **multiple locations** in unreplicated designs, partially replicated designs, lattice designs, RCBD, factorial, split-plot, split-split-plot, strip-plot, IBD, and RCD experiments. 4 | 5 | * Added capability for **heatmap visualization** of simulated data on all designs. 6 | 7 | * Added buttons to **copy and save design output to excel**. 8 | 9 | * Added **list of options for dimensions of field** on unreplicated and partially replicated designs. 10 | 11 | * Added **vignettes and help documents** for all designs. 12 | 13 | * Added **filters and search** for field book tables. 14 | 15 | -------------------------------------------------------------------------------- /man/print.summary.FielDHub.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_S3_methods.R 3 | \name{print.summary.FielDHub} 4 | \alias{print.summary.FielDHub} 5 | \title{Print the summary of a \code{FielDHub} object} 6 | \usage{ 7 | \method{print}{summary.FielDHub}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{an object inheriting from class \code{FielDHub}} 11 | 12 | \item{...}{Unused, for extensibility} 13 | } 14 | \value{ 15 | an object inheriting from class \code{FielDHub} 16 | } 17 | \description{ 18 | Print summary information on the design parameters, and 19 | data frame structure 20 | } 21 | \author{ 22 | Thiago de Paula Oliveira, 23 | \email{thiago.paula.oliveira@alumni.usp.br} [aut], 24 | Didier Murillo [aut] 25 | } 26 | -------------------------------------------------------------------------------- /data/Augmented_RCBD_50_Treatments.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,CH-01 3 | 2,CH-02 4 | 3,CH-03 5 | 4,CH-04 6 | 5,GYT-05 7 | 6,GYT-06 8 | 7,GYT-07 9 | 8,GYT-08 10 | 9,GYT-09 11 | 10,GYT-10 12 | 11,GYT-11 13 | 12,GYT-12 14 | 13,GYT-13 15 | 14,GYT-14 16 | 15,GYT-15 17 | 16,GYT-16 18 | 17,GYT-17 19 | 18,GYT-18 20 | 19,GYT-19 21 | 20,GYT-20 22 | 21,GYT-21 23 | 22,GYT-22 24 | 23,GYT-23 25 | 24,GYT-24 26 | 25,GYT-25 27 | 26,GYT-26 28 | 27,GYT-27 29 | 28,GYT-28 30 | 29,GYT-29 31 | 30,GYT-30 32 | 31,GYT-31 33 | 32,GYT-32 34 | 33,GYT-33 35 | 34,GYT-34 36 | 35,GYT-35 37 | 36,GYT-36 38 | 37,GYT-37 39 | 38,GYT-38 40 | 39,GYT-39 41 | 40,GYT-40 42 | 41,GYT-41 43 | 42,GYT-42 44 | 43,GYT-43 45 | 44,GYT-44 46 | 45,GYT-45 47 | 46,GYT-46 48 | 47,GYT-47 49 | 48,GYT-48 50 | 49,GYT-49 51 | 50,GYT-50 52 | 51,GYT-51 53 | 52,GYT-52 54 | 53,GYT-53 55 | 54,GYT-54 56 | -------------------------------------------------------------------------------- /data/Row_Column_56_Treatments.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,GYT-01 3 | 2,GYT-02 4 | 3,GYT-03 5 | 4,GYT-04 6 | 5,GYT-05 7 | 6,GYT-06 8 | 7,GYT-07 9 | 8,GYT-08 10 | 9,GYT-09 11 | 10,GYT-10 12 | 11,GYT-11 13 | 12,GYT-12 14 | 13,GYT-13 15 | 14,GYT-14 16 | 15,GYT-15 17 | 16,GYT-16 18 | 17,GYT-17 19 | 18,GYT-18 20 | 19,GYT-19 21 | 20,GYT-20 22 | 21,GYT-21 23 | 22,GYT-22 24 | 23,GYT-23 25 | 24,GYT-24 26 | 25,GYT-25 27 | 26,GYT-26 28 | 27,GYT-27 29 | 28,GYT-28 30 | 29,GYT-29 31 | 30,GYT-30 32 | 31,GYT-31 33 | 32,GYT-32 34 | 33,GYT-33 35 | 34,GYT-34 36 | 35,GYT-35 37 | 36,GYT-36 38 | 37,GYT-37 39 | 38,GYT-38 40 | 39,GYT-39 41 | 40,GYT-40 42 | 41,GYT-41 43 | 42,GYT-42 44 | 43,GYT-43 45 | 44,GYT-44 46 | 45,GYT-45 47 | 46,GYT-46 48 | 47,GYT-47 49 | 48,GYT-48 50 | 49,GYT-49 51 | 50,GYT-50 52 | 51,GYT-51 53 | 52,GYT-52 54 | 53,GYT-53 55 | 54,GYT-54 56 | 55,GYT-55 57 | 56,GYT-56 58 | -------------------------------------------------------------------------------- /R/app_config.R: -------------------------------------------------------------------------------- 1 | #' Access files in the current app 2 | #' 3 | #' @param ... Character vector specifying directory and or file to 4 | #' point to inside the current package. 5 | #' 6 | #' @noRd 7 | app_sys <- function(...){ 8 | system.file(..., package = "FielDHub") 9 | } 10 | 11 | 12 | #' Read App Config 13 | #' 14 | #' @param value Value to retrieve from the config file. 15 | #' @param config R_CONFIG_ACTIVE value. 16 | #' @param use_parent Logical, scan the parent directory for config file. 17 | #' 18 | #' @importFrom config get 19 | #' 20 | #' @noRd 21 | get_golem_config <- function( 22 | value, 23 | config = Sys.getenv("R_CONFIG_ACTIVE", "default"), 24 | use_parent = TRUE 25 | ){ 26 | config::get( 27 | value = value, 28 | config = config, 29 | # Modify this if your config file is somewhere else: 30 | file = app_sys("golem-config.yml"), 31 | use_parent = use_parent 32 | ) 33 | } 34 | 35 | -------------------------------------------------------------------------------- /R/utils_load_file.R: -------------------------------------------------------------------------------- 1 | #' @importFrom utils read.csv 2 | load_file <- function(name, path, sep, check = FALSE, design = NULL) { 3 | 4 | ext <- tools::file_ext(name) 5 | bad_format <- FALSE 6 | duplicated_vals <- FALSE 7 | if (all(c("csv", "CSV") != ext)) { 8 | bad_format = TRUE 9 | return(list(bad_format = bad_format)) 10 | } else { 11 | dataUp <- read.csv(path, 12 | header = TRUE, 13 | sep = sep, 14 | na.strings = c("", " ","NA")) 15 | dataUp <- as.data.frame(dataUp) 16 | if (check) { 17 | if (!is.null(check_input(design, dataUp))) { 18 | if (!check_input(design, dataUp)) { 19 | duplicated_vals = TRUE 20 | return(list(duplicated_vals = duplicated_vals)) 21 | } else return(list(dataUp = dataUp)) 22 | } else return(list(missing_cols = TRUE)) 23 | } else return(list(dataUp = dataUp)) 24 | } 25 | } -------------------------------------------------------------------------------- /man/summary.FielDHub.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_S3_methods.R 3 | \name{summary.FielDHub} 4 | \alias{summary.FielDHub} 5 | \title{Summary a \code{FielDHub} object} 6 | \usage{ 7 | \method{summary}{FielDHub}(object, ...) 8 | } 9 | \arguments{ 10 | \item{object}{an object inheriting from class 11 | \code{FielDHub}} 12 | 13 | \item{...}{Unused, for extensibility} 14 | } 15 | \value{ 16 | an object inheriting from class \code{summary.FielDHub} 17 | } 18 | \description{ 19 | Summarise information on the design parameters, and data 20 | frame structure 21 | } 22 | \examples{ 23 | # Example 1: Generates a CRD design with 5 treatments and 5 reps each. 24 | crd1 <- CRD(t = 5, reps = 5, plotNumber = 101, 25 | seed = 1985, locationName = "Fargo") 26 | crd1$infoDesign 27 | summary(crd1) 28 | 29 | } 30 | \author{ 31 | Thiago de Paula Oliveira, 32 | \email{thiago.paula.oliveira@alumni.usp.br} 33 | } 34 | -------------------------------------------------------------------------------- /data/Lattice_Square_64_Treatments.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,GYT-01 3 | 2,GYT-02 4 | 3,GYT-03 5 | 4,GYT-04 6 | 5,GYT-05 7 | 6,GYT-06 8 | 7,GYT-07 9 | 8,GYT-08 10 | 9,GYT-09 11 | 10,GYT-10 12 | 11,GYT-11 13 | 12,GYT-12 14 | 13,GYT-13 15 | 14,GYT-14 16 | 15,GYT-15 17 | 16,GYT-16 18 | 17,GYT-17 19 | 18,GYT-18 20 | 19,GYT-19 21 | 20,GYT-20 22 | 21,GYT-21 23 | 22,GYT-22 24 | 23,GYT-23 25 | 24,GYT-24 26 | 25,GYT-25 27 | 26,GYT-26 28 | 27,GYT-27 29 | 28,GYT-28 30 | 29,GYT-29 31 | 30,GYT-30 32 | 31,GYT-31 33 | 32,GYT-32 34 | 33,GYT-33 35 | 34,GYT-34 36 | 35,GYT-35 37 | 36,GYT-36 38 | 37,GYT-37 39 | 38,GYT-38 40 | 39,GYT-39 41 | 40,GYT-40 42 | 41,GYT-41 43 | 42,GYT-42 44 | 43,GYT-43 45 | 44,GYT-44 46 | 45,GYT-45 47 | 46,GYT-46 48 | 47,GYT-47 49 | 48,GYT-48 50 | 49,GYT-49 51 | 50,GYT-50 52 | 51,GYT-51 53 | 52,GYT-52 54 | 53,GYT-53 55 | 54,GYT-54 56 | 55,GYT-55 57 | 56,GYT-56 58 | 57,GYT-57 59 | 58,GYT-58 60 | 59,GYT-59 61 | 60,GYT-60 62 | 61,GYT-61 63 | 62,GYT-62 64 | 63,GYT-63 65 | 64,GYT-64 66 | -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^renv$ 2 | ^renv\.lock$ 3 | ^.*\.Rproj$ 4 | ^\.Rproj\.user$ 5 | ^data-raw$ 6 | dev_history.R 7 | ^dev$ 8 | ^data$ 9 | ^examples$ 10 | $run_dev.* 11 | ^LICENSE\.md$ 12 | ^README\.Rmd$ 13 | ^CODE_OF_CONDUCT\.md$ 14 | ^app\.R$ 15 | ^rsconnect$ 16 | ^\.travis\.yml$ 17 | ^\.github$ 18 | ^docs$ 19 | ^joss$ 20 | ^FielDHub_Overview\.png$ 21 | ^Example_FielDHub4.png$ 22 | ^pREPExample\.PNG$ 23 | ^DExample.PNG$ 24 | ^CONTRIBUTING\.md$ 25 | ^rsconnect$ 26 | ^Dockerfile$ 27 | ^\.dockerignore$ 28 | ^doc$ 29 | ^Meta$ 30 | ^00_pkg_src 2$ 31 | ^_pkgdown\.yml$ 32 | ^pkgdown$ 33 | ^NEWS\.Rmd$ 34 | ^index\.md$ 35 | ^index\.Rmd$ 36 | ^cran-comments\.md$ 37 | ^vignettes/crd\.Rmd$ 38 | ^vignettes/methods\.Rmd$ 39 | ^vignettes/latin_square\.Rmd$ 40 | ^vignettes/strip_plot\.Rmd$ 41 | ^vignettes/split_split_plot\.Rmd$ 42 | ^vignettes/incomplete_blocks\.Rmd$ 43 | ^vignettes/rectangular_lattice\.Rmd$ 44 | ^vignettes/square_lattice\.Rmd$ 45 | ^vignettes/sparse_allocation\.Rmd$ 46 | ^vignettes/optimized_arrangement\.Rmd$ 47 | 48 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. 2 | # https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | pull_request: 9 | branches: 10 | - main 11 | - master 12 | 13 | name: R-CMD-check 14 | 15 | jobs: 16 | R-CMD-check: 17 | runs-on: macOS-latest 18 | env: 19 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 20 | steps: 21 | - uses: actions/checkout@v2 22 | - uses: r-lib/actions/setup-r@v2 23 | - uses: r-lib/actions/setup-pandoc@v1 24 | - name: Install dependencies 25 | run: | 26 | install.packages(c("remotes", "rcmdcheck")) 27 | remotes::install_deps(dependencies = TRUE) 28 | shell: Rscript {0} 29 | - name: Check 30 | run: | 31 | options(crayon.enabled = TRUE) 32 | rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") 33 | shell: Rscript {0} 34 | -------------------------------------------------------------------------------- /R/utils_get_single_random.R: -------------------------------------------------------------------------------- 1 | get_single_random <- function( 2 | n_rows = NULL, 3 | n_cols = NULL, 4 | matrix_checks = NULL, 5 | checks = NULL, 6 | data = NULL) { 7 | n_rows <- as.numeric(n_rows) 8 | n_cols <- as.numeric(n_cols) 9 | data_entries <- as.vector(data[,1]) 10 | data_entries_no_checks <- data_entries[!(data_entries %in% checks)] 11 | len_entries_to_random <- length(data_entries_no_checks) 12 | len_spots_to_fill <- sum(matrix_checks == 0) 13 | if (len_entries_to_random != len_spots_to_fill) { 14 | stop("data entries do not fit to the plot availables!!") 15 | } 16 | rand_entries <- sample(data_entries_no_checks) 17 | matrix_checks[matrix_checks == 0] <- rand_entries 18 | treatments_random <- sum(data_entries_no_checks %in% matrix_checks) 19 | if (treatments_random == len_entries_to_random) { 20 | matrix_checks_random_entries <- matrix_checks 21 | } else stop("Some entries are missing in the randomization!!") 22 | return(list(rand = matrix_checks_random_entries, 23 | Entries = rand_entries, 24 | Lines = len_entries_to_random)) 25 | } -------------------------------------------------------------------------------- /R/utils_ARCBD_name.R: -------------------------------------------------------------------------------- 1 | ARCBD_name <- function(Fillers = NULL, b = NULL, layout = NULL, name.expt = NULL, 2 | planter = NULL) { 3 | if (all(c("serpentine", "cartesian") != planter)) { 4 | stop("Input planter is unknown. Please, choose one: 'serpentine' or 'cartesian'.") 5 | } 6 | r_map <- layout 7 | nrows <- b 8 | ncols <- ncol(r_map) 9 | if (!is.null(name.expt)) { 10 | Name_expt <- name.expt 11 | }else Name_expt = paste0(rep("ARCBD", times = 1), 1) 12 | split_names <- matrix(data = Name_expt, ncol = ncols, nrow = nrows) 13 | if (Fillers > 0) { 14 | split_names1 <- matrix(data = Name_expt, ncol = ncols, nrow = nrows) 15 | if (nrows %% 2 == 0) { 16 | if(planter == "serpentine") { 17 | split_names1[1, 1:Fillers] <- "Filler" 18 | }else{ 19 | split_names1[1,((ncols + 1) - Fillers):ncols] <- "Filler" 20 | } 21 | }else{ 22 | split_names1[1,((ncols + 1) - Fillers):ncols] <- "Filler" 23 | } 24 | } 25 | if (Fillers == 0) { 26 | return(list(my_names = split_names)) 27 | }else { 28 | return(list(my_names = split_names, my_names_Filles = split_names1)) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2021 North Dakota State University (NDSU) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /man/print.FielDHub.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_S3_methods.R 3 | \name{print.FielDHub} 4 | \alias{print.FielDHub} 5 | \title{Print a \code{FielDHub} object} 6 | \usage{ 7 | \method{print}{FielDHub}(x, n, ...) 8 | } 9 | \arguments{ 10 | \item{x}{an object inheriting from class} 11 | 12 | \item{n}{a single integer. If positive or zero, size for the 13 | resulting object: number of elements for a vector (including 14 | lists), rows for a matrix or data frame or lines for a function. If 15 | negative, all but the n last/first number of elements of x.} 16 | 17 | \item{...}{further arguments passed to \code{\link{head}}.} 18 | } 19 | \value{ 20 | an object inheriting from class \code{FielDHub} 21 | } 22 | \description{ 23 | Prints information about any \code{FielDHub} function. 24 | } 25 | \examples{ 26 | # Example 1: Generates a CRD design with 5 treatments and 5 reps each. 27 | crd1 <- CRD(t = 5, reps = 5, plotNumber = 101, 28 | seed = 1985, locationName = "Fargo") 29 | crd1$infoDesign 30 | print(crd1) 31 | 32 | } 33 | \author{ 34 | Thiago de Paula Oliveira, 35 | \email{thiago.paula.oliveira@alumni.usp.br} [aut], 36 | Didier Murillo [aut] 37 | } 38 | -------------------------------------------------------------------------------- /dev/03_deploy.R: -------------------------------------------------------------------------------- 1 | # Building a Prod-Ready, Robust Shiny Application. 2 | # 3 | # README: each step of the dev files is optional, and you don't have to 4 | # fill every dev scripts before getting started. 5 | # 01_start.R should be filled at start. 6 | # 02_dev.R should be used to keep track of your development during the project. 7 | # 03_deploy.R should be used once you need to deploy your app. 8 | # 9 | # 10 | ###################################### 11 | #### CURRENT FILE: DEPLOY SCRIPT ##### 12 | ###################################### 13 | 14 | # Test your app 15 | 16 | ## Run checks ---- 17 | ## Check the package before sending to prod 18 | devtools::check() 19 | rhub::check_for_cran() 20 | 21 | # Deploy 22 | 23 | ## RStudio ---- 24 | ## If you want to deploy on RStudio related platforms 25 | golem::add_rstudioconnect_file() 26 | golem::add_shinyappsio_file() 27 | golem::add_shinyserver_file() 28 | 29 | ## Docker ---- 30 | ## If you want to deploy via a generic Dockerfile 31 | # golem::add_dockerfile() 32 | golem::add_dockerfile_with_renv() 33 | 34 | ## If you want to deploy to ShinyProxy 35 | golem::add_dockerfile_shinyproxy() 36 | 37 | ## If you want to deploy to Heroku 38 | golem::add_dockerfile_heroku() 39 | -------------------------------------------------------------------------------- /data/Lattice_Alpha_56_Treatments.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,Gen-01 3 | 2,Gen-02 4 | 3,Gen-03 5 | 4,Gen-04 6 | 5,Gen-05 7 | 6,Gen-06 8 | 7,Gen-07 9 | 8,Gen-08 10 | 9,Gen-09 11 | 10,Gen-10 12 | 11,Gen-11 13 | 12,Gen-12 14 | 13,Gen-13 15 | 14,Gen-14 16 | 15,Gen-15 17 | 16,Gen-16 18 | 17,Gen-17 19 | 18,Gen-18 20 | 19,Gen-19 21 | 20,Gen-20 22 | 21,Gen-21 23 | 22,Gen-22 24 | 23,Gen-23 25 | 24,Gen-24 26 | 25,Gen-25 27 | 26,Gen-26 28 | 27,Gen-27 29 | 28,Gen-28 30 | 29,Gen-29 31 | 30,Gen-30 32 | 31,Gen-31 33 | 32,Gen-32 34 | 33,Gen-33 35 | 34,Gen-34 36 | 35,Gen-35 37 | 36,Gen-36 38 | 37,Gen-37 39 | 38,Gen-38 40 | 39,Gen-39 41 | 40,Gen-40 42 | 41,Gen-41 43 | 42,Gen-42 44 | 43,Gen-43 45 | 44,Gen-44 46 | 45,Gen-45 47 | 46,Gen-46 48 | 47,Gen-47 49 | 48,Gen-48 50 | 49,Gen-49 51 | 50,Gen-50 52 | 51,Gen-51 53 | 52,Gen-52 54 | 53,Gen-53 55 | 54,Gen-54 56 | 55,Gen-55 57 | 56,Gen-56 58 | 57,Gen-57 59 | 58,Gen-58 60 | 59,Gen-59 61 | 60,Gen-60 62 | 61,Gen-61 63 | 62,Gen-62 64 | 63,Gen-63 65 | 64,Gen-64 66 | 65,Gen-65 67 | 66,Gen-66 68 | 67,Gen-67 69 | 68,Gen-68 70 | 69,Gen-69 71 | 70,Gen-70 72 | 71,Gen-71 73 | 72,Gen-72 74 | 73,Gen-73 75 | 74,Gen-74 76 | 75,Gen-75 77 | 76,Gen-76 78 | 77,Gen-77 79 | 78,Gen-78 80 | 79,Gen-79 81 | 80,Gen-80 -------------------------------------------------------------------------------- /R/golem_utils_server.R: -------------------------------------------------------------------------------- 1 | #' Inverted versions of in, is.null and is.na 2 | #' 3 | #' @noRd 4 | #' 5 | #' @examples 6 | #' 1 %not_in% 1:10 7 | #' not_null(NULL) 8 | `%not_in%` <- Negate(`%in%`) 9 | 10 | not_null <- Negate(is.null) 11 | 12 | not_na <- Negate(is.na) 13 | 14 | #' Removes the null from a vector 15 | #' 16 | #' @noRd 17 | #' 18 | #' @example 19 | #' drop_nulls(list(1, NULL, 2)) 20 | drop_nulls <- function(x){ 21 | x[!sapply(x, is.null)] 22 | } 23 | 24 | #' If x is `NULL`, return y, otherwise return x 25 | #' 26 | #' @param x,y Two elements to test, one potentially `NULL` 27 | #' 28 | #' @noRd 29 | #' 30 | #' @examples 31 | #' NULL %||% 1 32 | "%||%" <- function(x, y){ 33 | if (is.null(x)) { 34 | y 35 | } else { 36 | x 37 | } 38 | } 39 | 40 | #' If x is `NA`, return y, otherwise return x 41 | #' 42 | #' @param x,y Two elements to test, one potentially `NA` 43 | #' 44 | #' @noRd 45 | #' 46 | #' @examples 47 | #' NA %||% 1 48 | "%|NA|%" <- function(x, y){ 49 | if (is.na(x)) { 50 | y 51 | } else { 52 | x 53 | } 54 | } 55 | 56 | #' Typing reactiveValues is too long 57 | #' 58 | #' @inheritParams reactiveValues 59 | #' @inheritParams reactiveValuesToList 60 | #' 61 | #' @noRd 62 | rv <- shiny::reactiveValues 63 | rvtl <- shiny::reactiveValuesToList 64 | 65 | -------------------------------------------------------------------------------- /vignettes/fieldhub-1-2-0.md: -------------------------------------------------------------------------------- 1 | # FielDHub 1.2.0 2 | 3 | * Added capability for making randomizations across **multiple locations** in unreplicated designs, partially replicated designs, lattice designs, RCBD, factorial, split-plot, split-split-plot, strip-plot, IBD, and RCD experiments. 4 | 5 | * Added capability for **heatmap visualization** of simulated data on all designs. 6 | 7 | * Added buttons to **copy and save design output to excel**. 8 | 9 | * Added **list of options for dimensions of field** on unreplicated and partially replicated designs. 10 | 11 | * Added **vignettes and help documents** for all designs. 12 | 13 | * Added **filters and search** for field book tables. 14 | 15 | * Updated graphic design on home page. 16 | 17 | * Separated unreplicated diagonal design into two modules, single diagonal and multiple diagonal. 18 | 19 | * Added run button to all designs. 20 | 21 | * Improved and standardized user experience in the app. 22 | 23 | * Improved error messages. 24 | 25 | * Added **field layout visualization** to all designs. 26 | 27 | * Added **multiple layout options** to all designs. 28 | 29 | * Added **plot order layout option** to lattice designs, CRD, factorial, split-plot, split-split-plot, IBD, and RCD. 30 | 31 | * Moved Augmented RCBD to Unreplicated Designs tab. 32 | 33 | -------------------------------------------------------------------------------- /man/plot.FielDHub.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_S3_methods.R 3 | \name{plot.FielDHub} 4 | \alias{plot.FielDHub} 5 | \title{Plot a \code{FielDHub} object} 6 | \usage{ 7 | \method{plot}{FielDHub}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{a object inheriting from class \code{FielDHub}} 11 | 12 | \item{...}{further arguments passed to utility function \code{plot_layout()}. 13 | \itemize{ 14 | \item \code{layout} a integer. Options available depend on the 15 | type of design and its characteristics 16 | \item \code{l} a integer to specify the location to plot. 17 | \item \code{planter} it can be \code{serpentine} or \code{cartesian}. 18 | \item \code{stacked} it can be \code{vertical} or \code{horizontal} stacked layout. 19 | }} 20 | } 21 | \value{ 22 | \itemize{ 23 | \item a plot object inheriting from class \code{fieldLayout} 24 | \item \code{field_book} a data frame with the fieldbook that includes the coordinates ROW and COLUMN. 25 | } 26 | } 27 | \description{ 28 | Draw a field layout plot for a \code{FielDHub} object. 29 | } 30 | \examples{ 31 | \dontrun{ 32 | # Example 1: Plot a RCBD design with 24 treatments and 3 reps. 33 | s <- RCBD(t = 24, reps = 3, plotNumber = 101, seed = 12) 34 | plot(s) 35 | } 36 | 37 | } 38 | \author{ 39 | Didier Murillo [aut] 40 | } 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # History files 2 | .Rhistory 3 | .Rapp.history 4 | 5 | # Session Data files 6 | .RData 7 | .RDataTmp 8 | 9 | # User-specific files 10 | .Ruserdata 11 | 12 | # Example code in package build process 13 | *-Ex.R 14 | 15 | # Output files from R CMD build 16 | /*.tar.gz 17 | 18 | # Output files from R CMD check 19 | /*.Rcheck/ 20 | 21 | # RStudio files 22 | .Rproj.user/ 23 | 24 | # produced vignettes 25 | vignettes/*.html 26 | vignettes/*.pdf 27 | 28 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 29 | .httr-oauth 30 | 31 | # knitr and R markdown default cache directories 32 | *_cache/ 33 | /cache/ 34 | 35 | # Temporary files created by R markdown 36 | *.utf8.md 37 | *.knit.md 38 | 39 | # R Environment Variables 40 | .Renviron 41 | 42 | # pkgdown site 43 | docs/ 44 | 45 | # translation temp files 46 | po/*~ 47 | 48 | # RStudio Connect folder 49 | rsconnect/ 50 | 51 | # General 52 | .DS_Store 53 | .AppleDouble 54 | .LSOverride 55 | 56 | # Icon must end with two \r 57 | Icon 58 | 59 | # Thumbnails 60 | ._* 61 | 62 | # Files that might appear in the root of a volume 63 | .DocumentRevisions-V100 64 | .fseventsd 65 | .Spotlight-V100 66 | .TemporaryItems 67 | .Trashes 68 | .VolumeIcon.icns 69 | .com.apple.timemachine.donotpresent 70 | 71 | # Directories potentially created on remote AFP share 72 | .AppleDB 73 | .AppleDesktop 74 | Network Trash Folder 75 | Temporary Items 76 | .apdisk 77 | inst/doc 78 | /doc/ 79 | /Meta/ 80 | docs 81 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown 13 | 14 | jobs: 15 | pkgdown: 16 | runs-on: ubuntu-latest 17 | # Only restrict concurrency for non-PR jobs 18 | concurrency: 19 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 20 | env: 21 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 22 | steps: 23 | - uses: actions/checkout@v2 24 | 25 | - uses: r-lib/actions/setup-pandoc@v2 26 | 27 | - uses: r-lib/actions/setup-r@v2 28 | with: 29 | use-public-rspm: true 30 | 31 | - uses: r-lib/actions/setup-r-dependencies@v2 32 | with: 33 | extra-packages: any::pkgdown, local::. 34 | needs: website 35 | 36 | - name: Build site 37 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 38 | shell: Rscript {0} 39 | 40 | - name: Deploy to GitHub pages 🚀 41 | if: github.event_name != 'pull_request' 42 | uses: JamesIves/github-pages-deploy-action@4.1.4 43 | with: 44 | clean: false 45 | branch: gh-pages 46 | folder: docs 47 | -------------------------------------------------------------------------------- /R/utils_ARCBD_plot_number.R: -------------------------------------------------------------------------------- 1 | ARCBD_plot_number <- function(plot.number = NULL, 2 | planter = "serpentine", 3 | b = NULL, 4 | name.expt = NULL, 5 | Fillers = NULL, 6 | nameEXPT = NULL) { 7 | if (all(c("serpentine", "cartesian") != planter)) { 8 | stop("Input planter choice is unknown. Please, choose one: 'serpentine' or 'cartesian'.") 9 | } 10 | datos_name <- nameEXPT 11 | nrows <- b 12 | ncols <- ncol(datos_name) 13 | datos_name = as.matrix(datos_name) 14 | movement_planter <- planter 15 | plot_n_start <- plot.number 16 | if (!is.null(name.expt)) { 17 | Name_expt <- name.expt 18 | }else Name_expt = paste0(rep("ARCBD", times = 1), 1) 19 | for (i in plot_n_start) { 20 | my_split_plot_nub <- plot_number( 21 | planter = planter, 22 | plot_number_start = i, 23 | layout_names = datos_name, 24 | expe_names = Name_expt, 25 | fillers = 0 26 | )[[1]] 27 | } 28 | 29 | plot_num1 <- my_split_plot_nub 30 | if (Fillers > 0) { 31 | if (nrows %% 2 == 0) { 32 | if(planter == "serpentine") { 33 | plot_num1[1, 1:Fillers] <- 0 34 | }else{ 35 | plot_num1[1,((ncols + 1) - Fillers):ncols] <- 0 36 | } 37 | }else { 38 | plot_num1[1,((ncols + 1) - Fillers):ncols] <- 0 39 | } 40 | } 41 | return(list(plot_num = plot_num1)) 42 | } 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /data/example_matrix_for_testing.csv: -------------------------------------------------------------------------------- 1 | "","V1","V2","V3","V4","V5","V6","V7","V8","V9","V10","V11","V12" 2 | "1","B1","1","B1","B1","B2","B2","B2","B2","B3","B3","B3","B3" 3 | "2","B1","B1","B1","B1","1","B2","B2","B2","B3","B3","B3","B3" 4 | "3","B1","B1","B1","B1","B2","B2","B2","1","B3","B3","B3","B3" 5 | "4","B1","B1","B1","B1","B2","B2","B2","B2","B3","B3","2","B3" 6 | "5","B1","B1","2","B1","B2","B2","B2","B2","B3","B3","B3","B3" 7 | "6","B1","B1","B1","B1","B2","3","B2","B2","B3","B3","B3","B3" 8 | "7","B1","B1","B1","B1","B2","B2","B2","B2","2","B3","B3","B3" 9 | "8","2","B1","B1","B1","B2","B2","B2","B2","B3","B3","B3","4" 10 | "9","B1","B1","B1","1","B2","B2","B2","B2","B3","B3","B3","B3" 11 | "10","B1","B1","B1","B1","B2","B2","2","B2","B3","B3","B3","B3" 12 | "11","B1","B1","B1","B1","B2","B2","B2","B2","B3","3","B3","B3" 13 | "12","B1","3","B1","B1","B2","B2","B2","B2","B3","B3","B3","B3" 14 | "13","B1","B1","B1","B1","3","B2","B2","B2","B3","B3","B3","B3" 15 | "14","B1","B1","B1","B1","B2","B2","B2","4","B3","B3","B3","B3" 16 | "15","B1","B1","B1","B1","B2","B2","B2","B2","B3","B3","1","B3" 17 | "16","B1","B1","4","B1","B2","B2","B2","B2","B3","B3","B3","B3" 18 | "17","B1","B1","B1","B1","B2","4","B2","B2","B3","B3","B3","B3" 19 | "18","B1","B1","B1","B1","B2","B2","B2","B2","3","B3","B3","B3" 20 | "19","4","B1","B1","B1","B2","B2","B2","B2","B3","B3","B3","1" 21 | "20","B1","B1","B1","3","B2","B2","B2","B2","B3","B3","B3","B3" 22 | "21","B1","B1","B1","B1","B2","B2","2","B2","B3","B3","B3","B3" 23 | "22","B1","B1","B1","B1","B2","B2","B2","B2","B3","4","B3","B3" 24 | -------------------------------------------------------------------------------- /R/globals.R: -------------------------------------------------------------------------------- 1 | utils::globalVariables(c("ENTRY", 2 | "IBLOCK", 3 | "REP", 4 | "ROW", 5 | "COLUMN", 6 | "TREATMENT", 7 | "LOCATION", 8 | "PLOT", 9 | "SQUARE", 10 | "SUB_PLOT", 11 | "SUB_SUB_PLOT", 12 | "TRT_COMB", 13 | "WHOLE_PLOT", 14 | "text", 15 | "BLOCK", 16 | "CHECKS", 17 | "EXPT", 18 | "Level_1", 19 | "Level_2", 20 | "dif", 21 | "treatments", 22 | "NAME", 23 | "REPS", 24 | "loc", 25 | "copies", 26 | ".", 27 | "Copies", 28 | "sparse_entry", 29 | "USER_ENTRY", 30 | "NAME.x", 31 | "NAME.y", 32 | "Times", 33 | "all_consecutive", 34 | "are_consecutive", 35 | "plots", "arcbd_plot", "new_order_treatments", 36 | "LABEL_TREATMENT", 37 | "Level", 38 | "Level_3", "ID", "YEAR")) 39 | -------------------------------------------------------------------------------- /tests/testthat/test_compute_index_ranges.R: -------------------------------------------------------------------------------- 1 | library(FielDHub) 2 | test_that("compute_index_ranges works correctly", { 3 | expect_equal(FielDHub:::compute_index_ranges(c(2, 3, 1)), list(from = c(1, 3, 6), to = c(2, 5, 6))) 4 | expect_equal(FielDHub:::compute_index_ranges(list(c(1, 2), c(3), c(4, 5, 6))), list(from = c(1, 3, 4), to = c(2, 3, 6))) 5 | expect_error(FielDHub:::compute_index_ranges("not a vector or list")) 6 | }) 7 | 8 | test_that("total_elements counts correctly", { 9 | expect_equal(FielDHub:::total_elements(list(1, 2, list(3, 4))), 4) 10 | expect_equal(FielDHub:::total_elements(list()), 0) 11 | expect_error(FielDHub:::total_elements("not a list")) 12 | }) 13 | 14 | test_that("split_matrix_into_blocks splits correctly", { 15 | mat <- matrix(1:12, nrow = 3, byrow = TRUE) 16 | blocks_by_row <- FielDHub:::split_matrix_into_blocks(mat, c(1, 2), byrow = TRUE) 17 | expect_equal(length(blocks_by_row), 2) 18 | expect_equal(blocks_by_row[[1]], matrix(1:4, nrow = 1)) 19 | expect_equal(blocks_by_row[[2]], matrix(5:12, nrow = 2, byrow = TRUE)) 20 | 21 | blocks_by_col <- FielDHub:::split_matrix_into_blocks(mat, c(2, 2), byrow = FALSE) 22 | expect_equal(length(blocks_by_col), 2) 23 | expect_equal(blocks_by_col[[1]], matrix(c(1, 2, 5, 6, 9, 10), ncol = 2, byrow = TRUE)) 24 | expect_equal(blocks_by_col[[2]], matrix(c(3, 4, 7, 8, 11, 12), ncol = 2, byrow = TRUE)) 25 | 26 | expect_error(FielDHub:::split_matrix_into_blocks(mat, c(1, 1), byrow = TRUE)) 27 | expect_error(FielDHub:::split_matrix_into_blocks(mat, c(2, 2), byrow = TRUE)) 28 | }) 29 | 30 | 31 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(plot,FielDHub) 4 | S3method(print,FielDHub) 5 | S3method(print,fieldLayout) 6 | S3method(print,summary.FielDHub) 7 | S3method(summary,FielDHub) 8 | export(CRD) 9 | export(RCBD) 10 | export(RCBD_augmented) 11 | export(alpha_lattice) 12 | export(diagonal_arrangement) 13 | export(do_optim) 14 | export(full_factorial) 15 | export(incomplete_blocks) 16 | export(latin_square) 17 | export(multi_location_prep) 18 | export(optimized_arrangement) 19 | export(partially_replicated) 20 | export(rectangular_lattice) 21 | export(row_column) 22 | export(run_app) 23 | export(sparse_allocation) 24 | export(split_families) 25 | export(split_plot) 26 | export(split_split_plot) 27 | export(square_lattice) 28 | export(strip_plot) 29 | export(swap_pairs) 30 | import(shiny) 31 | importFrom(config,get) 32 | importFrom(dplyr,glimpse) 33 | importFrom(golem,activate_js) 34 | importFrom(golem,add_resource_path) 35 | importFrom(golem,bundle_resources) 36 | importFrom(golem,favicon) 37 | importFrom(golem,with_golem_options) 38 | importFrom(htmltools,HTML) 39 | importFrom(htmltools,tagAppendAttributes) 40 | importFrom(htmltools,tagList) 41 | importFrom(htmltools,tags) 42 | importFrom(shiny,NS) 43 | importFrom(shiny,column) 44 | importFrom(shiny,shinyApp) 45 | importFrom(shiny,tagList) 46 | importFrom(stats,aggregate) 47 | importFrom(stats,dist) 48 | importFrom(stats,na.omit) 49 | importFrom(stats,pnorm) 50 | importFrom(stats,qnorm) 51 | importFrom(stats,rnorm) 52 | importFrom(stats,runif) 53 | importFrom(stats,sd) 54 | importFrom(stats,setNames) 55 | importFrom(utils,capture.output) 56 | importFrom(utils,head) 57 | importFrom(utils,read.csv) 58 | importFrom(utils,str) 59 | importFrom(utils,tail) 60 | importFrom(utils,write.csv) 61 | -------------------------------------------------------------------------------- /vignettes/methods.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Methods in FielDHub" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{Methods in FielDHub} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | options(rmarkdown.html_vignette.check_title = FALSE) 12 | library(FielDHub) 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = NA, 16 | warning = FALSE, 17 | message = FALSE 18 | ) 19 | ``` 20 | 21 | There are three primitive functions included in FielDHub: `print()`, `summary()`, and `plot()`. 22 | 23 | Given an experiment simulation from FielDHub, we can use these functions to display different kinds of information about the experiment. In this example, we will use the following randomized complete block design: 24 | ```{r} 25 | experiment <- RCBD( 26 | t = 12, 27 | reps = 3, 28 | l = 2, 29 | plotNumber = c(1001, 2001), 30 | locationNames = c("A", "B"), 31 | seed = 123 32 | ) 33 | ``` 34 | 35 | # `print()` 36 | 37 | The `print()` function prints the design parameters of the experiment and the first 10 rows of the field book. The first 10 rows of the field book are saved if the output of this function is assigned to a variable. 38 | ```{r} 39 | print(experiment) 40 | ``` 41 | 42 | # `summary()` 43 | 44 | The `summary()` function outputs a list of the design parameters and the layout randomization with plot numbers. 45 | ```{r} 46 | summary(experiment) 47 | ``` 48 | 49 | # `plot()` 50 | 51 | The `plot()` function plots the field for the input design, as it would be displayed in FielDHub. This can also be saved to a variable. This function has parameters for location and layout, if applicable. 52 | 53 | ```{r, fig.align='center', fig.width=7, fig.height=5} 54 | plot(experiment, l = 2, layout = 2) 55 | ``` 56 | 57 |
58 |
59 |
60 | -------------------------------------------------------------------------------- /man/split_families.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_split_families.R 3 | \name{split_families} 4 | \alias{split_families} 5 | \title{Split a population of genotypes randomly into several locations.} 6 | \usage{ 7 | split_families(l = NULL, data = NULL) 8 | } 9 | \arguments{ 10 | \item{l}{Number of locations.} 11 | 12 | \item{data}{Data frame with the entry (ENTRY) and the labels of each treatment (NAME) 13 | and number of individuals per family group (FAMILY).} 14 | } 15 | \value{ 16 | A list with two elements. 17 | \itemize{ 18 | \item \code{rowsEachlist} is a table with a summary of cases. 19 | \item \code{data_locations} is a data frame with the entries for each location 20 | } 21 | } 22 | \description{ 23 | Split a population of genotypes randomly into several locations, with the 24 | aim of having approximatelly the same number of replicates of each genotype, line or 25 | treatment per location. 26 | } 27 | \examples{ 28 | # Example 1: Split a population of 3000 and 200 families into 8 locations. 29 | # Original dataset is been simulated. 30 | set.seed(77) 31 | N <- 2000; families <- 100 32 | ENTRY <- 1:N 33 | NAME <- paste0("SB-", 1:N) 34 | FAMILY <- vector(mode = "numeric", length = N) 35 | x <- 1:N 36 | for (i in x) { FAMILY[i] <- sample(1:families, size = 1, replace = TRUE) } 37 | gen.list <- data.frame(list(ENTRY = ENTRY, NAME = NAME, FAMILY = FAMILY)) 38 | head(gen.list) 39 | # Now we are going to use the split_families() function. 40 | split_population <- split_families(l = 8, data = gen.list) 41 | print(split_population) 42 | summary(split_population) 43 | head(split_population$data_locations,12) 44 | 45 | } 46 | \author{ 47 | Didier Murillo [aut], 48 | Salvador Gezan [aut], 49 | Ana Heilman [ctb], 50 | Thomas Walk [ctb], 51 | Johan Aparicio [ctb], 52 | Richard Horsley [ctb] 53 | } 54 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rstudio/r-base:4.1.1-focal 2 | 3 | LABEL maintainer "Didier Murillo " 4 | 5 | RUN apt-get update && apt-get install -y \ 6 | sudo \ 7 | pandoc \ 8 | pandoc-citeproc \ 9 | libcurl4-gnutls-dev \ 10 | libcairo2-dev \ 11 | libxt-dev \ 12 | libssl-dev \ 13 | libssh2-1-dev \ 14 | libv8-dev \ 15 | libpq-dev \ 16 | libudunits2-dev \ 17 | libgdal-dev \ 18 | gdal-bin \ 19 | libproj-dev \ 20 | proj-data \ 21 | proj-bin \ 22 | libgeos-dev \ 23 | git \ 24 | curl 25 | 26 | RUN echo 'options(repos = c(REPO_NAME = "https://packagemanager.rstudio.com/all/__linux__/focal/latest"))' > /root/.Rprofile 27 | 28 | # basic shiny functionality 29 | RUN R -q -e "install.packages(c('shiny', 'rmarkdown'))" 30 | 31 | # install remotes 32 | RUN R -e 'install.packages("remotes")' 33 | 34 | # install dependencies of the FielDHub app 35 | RUN R -q -e "install.packages('config')" 36 | RUN R -q -e "install.packages('golem')" 37 | RUN R -q -e "install.packages('htmltools')" 38 | RUN R -q -e "install.packages('DT')" 39 | RUN R -q -e "install.packages('shinythemes')" 40 | RUN R -q -e "install.packages('dplyr')" 41 | RUN R -q -e "install.packages('numbers')" 42 | RUN R -q -e "install.packages('blocksdesign')" 43 | RUN R -q -e "install.packages('shinycssloaders')" 44 | RUN R -q -e "install.packages('ggplot2')" 45 | RUN R -q -e "install.packages('plotly')" 46 | RUN R -q -e "install.packages('viridis')" 47 | RUN R -q -e "install.packages('shinyalert')" 48 | RUN R -q -e "install.packages('desplot')" 49 | RUN R -q -e "install.packages('shinyjs')" 50 | 51 | RUN mkdir /build_zone 52 | ADD . /build_zone 53 | WORKDIR /build_zone 54 | 55 | RUN R -e 'remotes::install_local(upgrade="never")' 56 | RUN rm -rf /build_zone 57 | 58 | EXPOSE 3838 59 | 60 | CMD R -e "options('shiny.port'=3838,shiny.host='0.0.0.0');FielDHub::run_app()" 61 | -------------------------------------------------------------------------------- /vignettes/references.bib: -------------------------------------------------------------------------------- 1 | @article{EdmondsonIBDs, 2 | author = {Edmondson, Rodney N.}, 3 | journal = {Journal of Agricultural, Biological and Environmental Statistics}, 4 | number = {25}, 5 | pages = {500–522}, 6 | title = {{Multi-level Block Designs for Comparative Experiments.}}, 7 | volume = {91}, 8 | url = {https://doi.org/10.1007/s13253-020-00416-0}, 9 | year = {2020} 10 | } 11 | @article{MontesinosLopezSparse, 12 | author = {Montesinos-Lopez, Osval Antonio and Montesinos-Lopez, Abelardo and Acosta, Ricardo and Varshney, Rajeev K. and Bentley, Alison and Crossa, Jose}, 13 | journal = {The Plant Genome}, 14 | number = {1}, 15 | pages = {e20194}, 16 | title = {{Using an incomplete block design to allocate lines to environments improves sparse genome-based prediction in plant breeding}}, 17 | volume = {15}, 18 | url = {https://doi.org/10.1002/tpg2.20194}, 19 | year = {2022} 20 | } 21 | @article{Cullis2006-pREP, 22 | author = {Cullis, B. R., et al.}, 23 | journal = {Journal of Agricultural, Biological, and Environmental Statistics}, 24 | number = {4}, 25 | pages = {381–393}, 26 | publisher = {Springer}, 27 | title = {{On the Design of Early Generation Variety Trials with Correlated Data}}, 28 | volume = {11}, 29 | year = {2006} 30 | } 31 | @Article{estefanova2011, 32 | author = {Clarke, G. Peter Y. and Stefanova, Katia T.}, 33 | title = {Optimal Design for Early-Generation Plant-Breeding Trials With Unreplicated or Partially Replicated Test Lines}, 34 | journal = {Australian \& New Zealand Journal of Statistics}, 35 | volume = {53}, 36 | number = {4}, 37 | pages = {461-480}, 38 | year={2011}, 39 | keywords = {error degrees of freedom, expected genetic gain, fixed and random effects, optimal design, shrinkage}, 40 | doi = {10.1111/j.1467-842X.2011.00642.x}, 41 | url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-842X.2011.00642.x} 42 | } -------------------------------------------------------------------------------- /R/utils_export_layout.R: -------------------------------------------------------------------------------- 1 | #' Function to export a formatted .csv table from data in the Fieldbook 2 | #' 3 | #' @param Fieldbook A list from a FielDHub design. 4 | #' @param selected A number, to select which location to view. 5 | #' @importFrom utils tail 6 | #' @noRd 7 | export_layout <- function(Fieldbook, selected, plotOn = FALSE) { 8 | 9 | dataIn <- Fieldbook 10 | 11 | locs <- levels(factor(dataIn$LOCATION)) 12 | 13 | df_site_one <- subset(dataIn, dataIn$LOCATION == locs[selected]) 14 | 15 | if (!plotOn) {if ("ENTRY" %in% colnames(dataIn)) { 16 | type="ENTRY" 17 | 18 | } else if("TREATMENT" %in% colnames(dataIn)) { 19 | type="TREATMENT" 20 | 21 | } else { 22 | type="TRT_COMB" 23 | }} else { 24 | type = "PLOT" 25 | } 26 | 27 | cols <- length(levels(factor(df_site_one$COLUMN))) 28 | rows <- length(levels(factor(df_site_one$ROW))) 29 | mtx <- matrix(nrow = rows, ncol = cols) 30 | # k <- rows 31 | 32 | for (i in 1:rows) { 33 | for (j in 1:cols) { 34 | mtx[i,j] <- subset(df_site_one, ROW == i & COLUMN == j)[[type]] 35 | } 36 | # k <- k - 1 37 | } 38 | df <- as.data.frame(mtx) 39 | 40 | leftHead <- c("Location",locs[selected],1:(nrow(mtx))) 41 | blanks <- as.data.frame(matrix("", ncol = ncol(mtx)), nrow = 2) 42 | col_labels <- as.data.frame(matrix(c(1:ncol(mtx)), 43 | ncol = ncol(mtx)), nrow = 1) 44 | 45 | names(blanks) <- names(df) 46 | names(col_labels) <- names(df) 47 | blanks2 <- rbind(blanks,col_labels) 48 | 49 | layout_entries3 <- rbind(blanks2, df) 50 | 51 | layout_entries2 <- cbind(leftHead, as.data.frame(layout_entries3)) 52 | layout_entries2 <- layout_entries2[order(nrow(layout_entries2):1),] 53 | layout_entries2 <- rbind(tail(layout_entries2, 2)[2:1, ], head(layout_entries2, -2)) 54 | rownames(layout_entries2) <- 1:(nrow(mtx) + 2) 55 | 56 | return(list(file = layout_entries2)) 57 | } -------------------------------------------------------------------------------- /R/app_server.R: -------------------------------------------------------------------------------- 1 | #' The application server-side 2 | #' 3 | #' @param input,output,session Internal parameters for {shiny}. 4 | #' DO NOT REMOVE. 5 | #' 6 | #' @author Didier Murillo [aut], 7 | #' Salvador Gezan [aut], 8 | #' Ana Heilman [ctb], 9 | #' Thomas Walk [ctb], 10 | #' Johan Aparicio [ctb], 11 | #' Richard Horsley [ctb] 12 | #' 13 | #' @import shiny 14 | #' @noRd 15 | app_server <- function( input, output, session ) { 16 | ################## Unreplicated Module ######################################### 17 | ### Diagonal Arrangement single 18 | mod_Diagonal_server("Diagonal_ui_1") 19 | ### Diagonal Arrangement multiple 20 | mod_diagonal_multiple_server("diagonal_multiple_ui_1") 21 | ### Optimized Arrangement 22 | mod_Optim_server("Optim_ui_1") 23 | ################## Augmented Designs ########################################### 24 | ### RCBD Augmented 25 | mod_RCBD_augmented_server("RCBD_augmented_ui_1") 26 | ################## Sparse Allocation ########################################### 27 | mod_sparse_allocation_server("sparse_allocation_ui_1") 28 | ################## Partially Replicated Module ################################# 29 | mod_pREPS_server("pREPS_ui_1") 30 | mod_multi_loc_preps_server("multi_loc_preps_ui_1") 31 | ################## Lattice Designs ############################################# 32 | ### Square Lattice 33 | mod_Square_Lattice_server("Square_Lattice_ui_1") 34 | ### Rectangular Lattice 35 | mod_Rectangular_Lattice_server("Rectangular_Lattice_ui_1") 36 | ### Alpha Lattice 37 | mod_Alpha_Lattice_server("Alpha_Lattice_ui_1") 38 | ################## Classic Designs ############################################# 39 | mod_CRD_server("CRD_ui_1") 40 | mod_RCBD_server("RCBD_ui_1") 41 | mod_LSD_server("LSD_ui_1") 42 | mod_FD_server("FD_ui_1") 43 | mod_SPD_server("SPD_ui_1") 44 | mod_SSPD_server("SSPD_ui_1") 45 | mod_IBD_server("IBD_ui_1") 46 | mod_RowCol_server("RowCol_ui_1") 47 | mod_STRIPD_server("STRIPD_ui_1") 48 | } 49 | -------------------------------------------------------------------------------- /data/Diagonal_135_treatments_5_checks.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,A 3 | 2,B 4 | 3,C 5 | 4,D 6 | 5,E 7 | 6,ND-06 8 | 7,ND-07 9 | 8,ND-08 10 | 9,ND-09 11 | 10,ND-10 12 | 11,ND-11 13 | 12,ND-12 14 | 13,ND-13 15 | 14,ND-14 16 | 15,ND-15 17 | 16,ND-16 18 | 17,ND-17 19 | 18,ND-18 20 | 19,ND-19 21 | 20,ND-20 22 | 21,ND-21 23 | 22,ND-22 24 | 23,ND-23 25 | 24,ND-24 26 | 25,ND-25 27 | 26,ND-26 28 | 27,ND-27 29 | 28,ND-28 30 | 29,ND-29 31 | 30,ND-30 32 | 31,ND-31 33 | 32,ND-32 34 | 33,ND-33 35 | 34,ND-34 36 | 35,ND-35 37 | 36,ND-36 38 | 37,ND-37 39 | 38,ND-38 40 | 39,ND-39 41 | 40,ND-40 42 | 41,ND-41 43 | 42,ND-42 44 | 43,ND-43 45 | 44,ND-44 46 | 45,ND-45 47 | 46,ND-46 48 | 47,ND-47 49 | 48,ND-48 50 | 49,ND-49 51 | 50,ND-50 52 | 51,ND-51 53 | 52,ND-52 54 | 53,ND-53 55 | 54,ND-54 56 | 55,ND-55 57 | 56,ND-56 58 | 57,ND-57 59 | 58,ND-58 60 | 59,ND-59 61 | 60,ND-60 62 | 61,ND-61 63 | 62,ND-62 64 | 63,ND-63 65 | 64,ND-64 66 | 65,ND-65 67 | 66,ND-66 68 | 67,ND-67 69 | 68,ND-68 70 | 69,ND-69 71 | 70,ND-70 72 | 71,ND-71 73 | 72,ND-72 74 | 73,ND-73 75 | 74,ND-74 76 | 75,ND-75 77 | 76,ND-76 78 | 77,ND-77 79 | 78,ND-78 80 | 79,ND-79 81 | 80,ND-80 82 | 81,ND-81 83 | 82,ND-82 84 | 83,ND-83 85 | 84,ND-84 86 | 85,ND-85 87 | 86,ND-86 88 | 87,ND-87 89 | 88,ND-88 90 | 89,ND-89 91 | 90,ND-90 92 | 91,ND-91 93 | 92,ND-92 94 | 93,ND-93 95 | 94,ND-94 96 | 95,ND-95 97 | 96,ND-96 98 | 97,ND-97 99 | 98,ND-98 100 | 99,ND-99 101 | 100,ND-100 102 | 101,ND-101 103 | 102,ND-102 104 | 103,ND-103 105 | 104,ND-104 106 | 105,ND-105 107 | 106,ND-106 108 | 107,ND-107 109 | 108,ND-108 110 | 109,ND-109 111 | 110,ND-110 112 | 111,ND-111 113 | 112,ND-112 114 | 113,ND-113 115 | 114,ND-114 116 | 115,ND-115 117 | 116,ND-116 118 | 117,ND-117 119 | 118,ND-118 120 | 119,ND-119 121 | 120,ND-120 122 | 121,ND-121 123 | 122,ND-122 124 | 123,ND-123 125 | 124,ND-124 126 | 125,ND-125 127 | 126,ND-126 128 | 127,ND-127 129 | 128,ND-128 130 | 129,ND-129 131 | 130,ND-130 132 | 131,ND-131 133 | 132,ND-132 134 | 133,ND-133 135 | 134,ND-134 136 | 135,ND-135 137 | 136,ND-136 138 | 137,ND-137 139 | 138,ND-138 140 | 139,ND-139 141 | 140,ND-140 142 | -------------------------------------------------------------------------------- /R/utils_get_random_stacked.R: -------------------------------------------------------------------------------- 1 | get_random_stacked <- function(stacked = "By Column", 2 | n_rows, 3 | n_cols, 4 | matrix_checks = NULL, 5 | Fillers = FALSE, 6 | checks = NULL, 7 | data = NULL, 8 | data_dim_each_block = NULL) { 9 | data_entries <- as.vector(data[,1]) 10 | data_entries_no_checks <- data_entries[!(data_entries %in% checks)] 11 | b <- length(data_dim_each_block) 12 | target <- rep(paste0("B", 1:b), times = data_dim_each_block) 13 | if (sum(matrix_checks == 0) != sum(data_dim_each_block)) { 14 | stop("Block dimensions do not fit to the matrix") 15 | } 16 | target <- rep(paste0("B", 1:b), times = data_dim_each_block) 17 | v <- 1 18 | for(j in 1:ncol(matrix_checks)) { 19 | for (i in nrow(matrix_checks):1) { 20 | if (matrix_checks[i,j] == 0){ 21 | matrix_checks[i,j] <- target[v] 22 | v <- v + 1 23 | }else{ 24 | matrix_checks[i,j] <- matrix_checks[i,j] 25 | v <- v 26 | } 27 | } 28 | } 29 | w_map_letters <- matrix_checks 30 | levels_target <- levels(as.factor(target)) 31 | split_entries <- split_vectors(data_entries_no_checks, data_dim_each_block) 32 | z <- 1 33 | for(k in 1:b){ 34 | matrix_checks[matrix_checks == levels_target[z]] <- sample(split_entries[[k]]) 35 | z <- z + 1 36 | } 37 | 38 | treatments_random <- sum(data_entries_no_checks %in% matrix_checks) 39 | len_entries_to_random <- length(data_entries_no_checks) 40 | if (treatments_random == len_entries_to_random) { 41 | matrix_checks_random_entries <- matrix_checks 42 | # print("Randomization was successful. It passed all tests! Great!!") 43 | # print(c(treatments_random, len_entries_to_random)) 44 | } else stop("Some entries are missing in the randomization!!") 45 | return(list(rand = matrix_checks_random_entries, 46 | Entries = split_entries, 47 | Lines = data_dim_each_block, 48 | w_map_letters = w_map_letters)) 49 | } 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /man/do_optim.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_do_optim.R 3 | \name{do_optim} 4 | \alias{do_optim} 5 | \title{Generate the sparse or p-rep allocation to multiple locations.} 6 | \usage{ 7 | do_optim( 8 | design = "sparse", 9 | lines, 10 | l, 11 | copies_per_entry, 12 | add_checks = FALSE, 13 | checks = NULL, 14 | rep_checks = NULL, 15 | force_balance = TRUE, 16 | seed, 17 | data = NULL 18 | ) 19 | } 20 | \arguments{ 21 | \item{design}{Type of experimental design. It can be \code{prep} or \code{sparse}} 22 | 23 | \item{lines}{Number of genotypes, experimental lines or treatments.} 24 | 25 | \item{l}{Number of locations or sites. By default \code{l = 1}.} 26 | 27 | \item{copies_per_entry}{Number of copies per plant. 28 | When design is \code{sparse} then \code{copies_per_entry} should be less than \code{l}} 29 | 30 | \item{add_checks}{Option to add checks. Optional if \code{design = "prep"}} 31 | 32 | \item{checks}{Number of genotypes checks.} 33 | 34 | \item{rep_checks}{Replication for each check.} 35 | 36 | \item{force_balance}{Get balanced unbalanced locations. By default \code{force_balance = TRUE}.} 37 | 38 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 39 | 40 | \item{data}{(optional) Data frame with 2 columns: \code{ENTRY | NAME }. ENTRY must be numeric.} 41 | } 42 | \value{ 43 | A list with three elements. 44 | \itemize{ 45 | \item \code{list_locs} is a list with each location list of entries. 46 | \item \code{allocation} is a matrix with the allocation of treatments. 47 | \item \code{size_locations} is a data frame with one column for each 48 | location and one row with the size of the location. 49 | } 50 | } 51 | \description{ 52 | Generate the sparse or p-rep allocation to multiple locations. 53 | } 54 | \examples{ 55 | sparse_example <- do_optim( 56 | design = "sparse", 57 | lines = 120, 58 | l = 4, 59 | copies_per_entry = 3, 60 | add_checks = TRUE, 61 | checks = 4, 62 | seed = 15 63 | ) 64 | } 65 | \references{ 66 | Edmondson, R.N. Multi-level Block Designs for Comparative Experiments. JABES 25, 67 | 500–522 (2020). https://doi.org/10.1007/s13253-020-00416-0 68 | } 69 | \author{ 70 | Didier Murillo [aut], 71 | Salvador Gezan [aut], 72 | Ana Heilman [ctb] 73 | } 74 | -------------------------------------------------------------------------------- /joss/paper.bib: -------------------------------------------------------------------------------- 1 | @Manual{agricolae_cit, 2 | title = {{agricolae}: Statistical Procedures for Agricultural Research}, 3 | author = {Felipe {de Mendiburu} and Muhammad Yaseen}, 4 | year = {2020}, 5 | note = {R package version 1.4.0}, 6 | url = {https://cran.r-project.org/package=agricolae}, 7 | } 8 | 9 | @Manual{blocksdesign_cit, 10 | title = {{blocksdesign}: Nested and Crossed Block Designs for Factorial and Unstructured 11 | Treatment Sets}, 12 | author = {R. N. Edmondson}, 13 | year = {2021}, 14 | note = {R package version 4.8}, 15 | url = {https://CRAN.R-project.org/package=blocksdesign}, 16 | } 17 | 18 | @Manual{golem_cit, 19 | title = {{golem}: A Framework for Robust Shiny Applications}, 20 | author = {Vincent Guyader and Colin Fay and Sébastien Rochette and Cervan Girard}, 21 | year = {2020}, 22 | note = {R package version 0.2.1}, 23 | url = {https://CRAN.R-project.org/package=golem}, 24 | } 25 | 26 | @Article{estefanova_cit, 27 | author = {Clarke, G. Peter Y. and Stefanova, Katia T.}, 28 | title = {Optimal Design for Early-Generation Plant-Breeding Trials With Unreplicated or Partially Replicated Test Lines}, 29 | journal = {Australian \& New Zealand Journal of Statistics}, 30 | volume = {53}, 31 | number = {4}, 32 | pages = {461-480}, 33 | year={2011}, 34 | keywords = {error degrees of freedom, expected genetic gain, fixed and random effects, optimal design, shrinkage}, 35 | doi = {10.1111/j.1467-842X.2011.00642.x}, 36 | url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-842X.2011.00642.x} 37 | } 38 | 39 | @book{Federer_cit, 40 | Author = {Federer, W. T.}, 41 | Publisher = {The Macmillan Company.}, 42 | Title = {{Experimental Design. Theory and Application. New York, USA.}}, 43 | Year = 1955 44 | } 45 | 46 | @Article{Cullis2006_cit, 47 | author = {B. R. Cullis and A. B. Smith and N. E. Coombes}, 48 | title = {On the design of early generation variety trials with correlated data.}, 49 | journal = {Journal of Agricultural, Biological, and Environmental Statistics}, 50 | volume = {11}, 51 | pages = {381-393}, 52 | year={2006}, 53 | keywords = {Genetic gain, Grid plot design, REML, optimal design, Spatial correlation}, 54 | doi = {10.1198/108571106X154443}, 55 | url = {https://doi.org/10.1198/108571106X154443} 56 | } 57 | -------------------------------------------------------------------------------- /dev/01_start.R: -------------------------------------------------------------------------------- 1 | # Building a Prod-Ready, Robust Shiny Application. 2 | # 3 | # README: each step of the dev files is optional, and you don't have to 4 | # fill every dev scripts before getting started. 5 | # 01_start.R should be filled at start. 6 | # 02_dev.R should be used to keep track of your development during the project. 7 | # 03_deploy.R should be used once you need to deploy your app. 8 | # 9 | # 10 | ######################################## 11 | #### CURRENT FILE: ON START SCRIPT ##### 12 | ######################################## 13 | 14 | ## Fill the DESCRIPTION ---- 15 | ## Add meta data about your application 16 | golem::fill_desc( 17 | pkg_name = "FielDHub", # The Name of the package containing the App 18 | pkg_title = "Shiny App", # The Title of the package containing the App 19 | pkg_description = "FielDHub: A Shiny App to Randomize Partially-Replicated/Unreplicated, 20 | Augmented and Classical Field Designs for Plant Breeding Trials.", # The Description of the package containing the App 21 | author_first_name = "Didier", # Your First Name 22 | author_last_name = "Murillo", # Your Last Name 23 | author_email = "didier.murilloflorez@ndsu.edu", # Your Email 24 | repo_url = NULL # The URL of the GitHub Repo (optional) 25 | ) 26 | 27 | ## Set {golem} options ---- 28 | golem::set_golem_options() 29 | 30 | ## Create Common Files ---- 31 | ## See ?usethis for more information 32 | usethis::use_mit_license(copyright_holder = "North Dakota State University (NDSU)") # You can set another license here 33 | usethis::use_readme_rmd( open = FALSE ) 34 | usethis::use_readme_md(open = FALSE) 35 | usethis::use_code_of_conduct() 36 | usethis::use_lifecycle_badge( "Experimental" ) 37 | usethis::use_news_md( open = FALSE ) 38 | 39 | ## Use git ---- 40 | usethis::use_git() 41 | 42 | ## Init Testing Infrastructure ---- 43 | ## Create a template for tests 44 | golem::use_recommended_tests() 45 | 46 | ## Use Recommended Packages ---- 47 | golem::use_recommended_deps() 48 | 49 | ## Favicon ---- 50 | # If you want to change the favicon (default is golem's one) 51 | golem::remove_favicon() 52 | golem::use_favicon() # path = "path/to/ico". Can be an online file. 53 | 54 | ## Add helper functions ---- 55 | golem::use_utils_ui() 56 | golem::use_utils_server() 57 | 58 | # You're now set! ---- 59 | 60 | # go to dev/02_dev.R 61 | rstudioapi::navigateToFile( "dev/02_dev.R" ) 62 | 63 | -------------------------------------------------------------------------------- /tests/testthat/test_swap_functions.R: -------------------------------------------------------------------------------- 1 | library(FielDHub) 2 | # Test pairs_distance function 3 | test_that("pairs_distance returns expected output", { 4 | # Test with a matrix that contains integers that appear two or more times 5 | X1 <- matrix(c(1, 2, 3, 4, 2, 2, 6, 1, 7, 8, 5, 9), ncol = 3) 6 | res1 <- pairs_distance(X1) 7 | expect_equal(ncol(res1), 8) 8 | expect_equal(nrow(res1), 4) 9 | expect_equal(sum(duplicated(res1[, 2:3])), 0) 10 | 11 | # Test with a matrix that contains only unique integers 12 | X2 <- matrix(1:9, ncol = 3) 13 | expect_error(pairs_distance(X2), "All elements in X appear only once") 14 | }) 15 | 16 | # create a test for the function 17 | test_that("pairs_distance() correctly calculates the distances between paired points", { 18 | # create a test input matrix 19 | X <- matrix(c(1, 2, 3, 4, 2, 5, 6, 1, 7, 8, 2, 9), ncol = 3) 20 | # call the function and save the output 21 | output <- pairs_distance(X) 22 | # check that the output is a data frame 23 | expect_s3_class(output, "data.frame") 24 | # check that the output has the correct number of rows and columns 25 | expect_equal(dim(output), c(4, 8)) 26 | # check that the output is sorted by distance 27 | expect_true(all(diff(output$DIST) >= 0)) 28 | # check that the output distances are calculated correctly 29 | expect_equal(round(output$DIST, 4), c(1.4142, 2.2361, 2.2361, 3.1623)) 30 | # check that the output point pairs are correct 31 | expect_equal(output$Pos1, c(2, 2, 5, 1)) 32 | expect_equal(output$Pos2, c(5, 11, 11, 8)) 33 | }) 34 | 35 | # Test swap_pairs function 36 | test_that("swap_pairs returns expected output", { 37 | # Test with a matrix that contains integers that appear two or more times 38 | set.seed(123) 39 | X1 <- matrix(sample(c(rep(1:10, 2), 11:50), replace = FALSE), ncol = 10) 40 | res1 <- swap_pairs(X1, starting_dist = 3, stop_iter = 100) 41 | expect_equal(dim(res1$optim_design), dim(X1)) 42 | expect_equal(length(res1$designs), length(res1$distances)) 43 | expect_equal(min(res1$pairwise_distance$DIST), res1$min_distance) 44 | expect_true(res1$min_distance >= 3) 45 | expect_equal(ncol(res1$pairwise_distance), 8) 46 | 47 | # Test with a matrix that contains only unique integers 48 | X2 <- matrix(1:9, ncol = 3) 49 | expect_error( 50 | swap_pairs(X2, starting_dist = 3, stop_iter = 100), 51 | "All elements in X appear only once" 52 | ) 53 | }) 54 | -------------------------------------------------------------------------------- /data/Diagonal_Multiple_12x13_1.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME,BLOCKS 2 | 1,A,ALL 3 | 2,B,ALL 4 | 3,C,ALL 5 | 4,D,ALL 6 | 5,E,ALL 7 | 6,ND-06,1 8 | 7,ND-07,1 9 | 8,ND-08,1 10 | 9,ND-09,1 11 | 10,ND-10,1 12 | 11,ND-11,1 13 | 12,ND-12,1 14 | 13,ND-13,1 15 | 14,ND-14,1 16 | 15,ND-15,1 17 | 16,ND-16,1 18 | 17,ND-17,1 19 | 18,ND-18,1 20 | 19,ND-19,1 21 | 20,ND-20,1 22 | 21,ND-21,1 23 | 22,ND-22,1 24 | 23,ND-23,1 25 | 24,ND-24,1 26 | 25,ND-25,1 27 | 26,ND-26,1 28 | 27,ND-27,1 29 | 28,ND-28,1 30 | 29,ND-29,1 31 | 30,ND-30,1 32 | 31,ND-31,1 33 | 32,ND-32,1 34 | 33,ND-33,1 35 | 34,ND-34,1 36 | 35,ND-35,1 37 | 36,ND-36,1 38 | 37,ND-37,1 39 | 38,ND-38,1 40 | 39,ND-39,1 41 | 40,ND-40,1 42 | 41,ND-41,2 43 | 42,ND-42,2 44 | 43,ND-43,2 45 | 44,ND-44,2 46 | 45,ND-45,2 47 | 46,ND-46,2 48 | 47,ND-47,2 49 | 48,ND-48,2 50 | 49,ND-49,2 51 | 50,ND-50,2 52 | 51,ND-51,2 53 | 52,ND-52,2 54 | 53,ND-53,2 55 | 54,ND-54,2 56 | 55,ND-55,2 57 | 56,ND-56,2 58 | 57,ND-57,2 59 | 58,ND-58,2 60 | 59,ND-59,2 61 | 60,ND-60,2 62 | 61,ND-61,2 63 | 62,ND-62,2 64 | 63,ND-63,2 65 | 64,ND-64,2 66 | 65,ND-65,2 67 | 66,ND-66,2 68 | 67,ND-67,2 69 | 68,ND-68,2 70 | 69,ND-69,2 71 | 70,ND-70,2 72 | 71,ND-71,2 73 | 72,ND-72,2 74 | 73,ND-73,2 75 | 74,ND-74,2 76 | 75,ND-75,2 77 | 76,ND-76,2 78 | 77,ND-77,2 79 | 78,ND-78,2 80 | 79,ND-79,2 81 | 80,ND-80,2 82 | 81,ND-81,2 83 | 82,ND-82,2 84 | 83,ND-83,2 85 | 84,ND-84,2 86 | 85,ND-85,2 87 | 86,ND-86,2 88 | 87,ND-87,2 89 | 88,ND-88,2 90 | 89,ND-89,2 91 | 90,ND-90,2 92 | 91,ND-91,2 93 | 92,ND-92,2 94 | 93,ND-93,2 95 | 94,ND-94,2 96 | 95,ND-95,2 97 | 96,ND-96,2 98 | 97,ND-97,2 99 | 98,ND-98,2 100 | 99,ND-99,2 101 | 100,ND-100,3 102 | 101,ND-101,3 103 | 102,ND-102,3 104 | 103,ND-103,3 105 | 104,ND-104,3 106 | 105,ND-105,3 107 | 106,ND-106,3 108 | 107,ND-107,3 109 | 108,ND-108,3 110 | 109,ND-109,3 111 | 110,ND-110,3 112 | 111,ND-111,3 113 | 112,ND-112,3 114 | 113,ND-113,3 115 | 114,ND-114,3 116 | 115,ND-115,3 117 | 116,ND-116,3 118 | 117,ND-117,3 119 | 118,ND-118,3 120 | 119,ND-119,3 121 | 120,ND-120,3 122 | 121,ND-121,3 123 | 122,ND-122,3 124 | 123,ND-123,3 125 | 124,ND-124,3 126 | 125,ND-125,3 127 | 126,ND-126,3 128 | 127,ND-127,3 129 | 128,ND-128,3 130 | 129,ND-129,3 131 | 130,ND-130,3 132 | 131,ND-131,3 133 | 132,ND-132,3 134 | 133,ND-133,3 135 | 134,ND-134,3 136 | 135,ND-135,3 137 | 136,ND-136,3 138 | 137,ND-137,3 139 | 138,ND-138,3 140 | 139,ND-139,3 141 | 140,ND-140,3 142 | -------------------------------------------------------------------------------- /pkgdown/_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: https://didiermurillof.github.io/FielDHub/ 2 | template: 3 | bootstrap: 5 4 | bootswatch: flatly 5 | home: 6 | sidebar: 7 | structure: [links, license, community, citation, authors, dev] 8 | navbar: 9 | structure: 10 | left: [reference, articles, news] 11 | right: [search, github] 12 | components: 13 | articles: 14 | text: Articles 15 | menu: 16 | - text: "Sparse Allocation/Testing" 17 | href: articles/sparse_allocation.html 18 | - text: "Unreplicated Diagonal Arrangement Design" 19 | href: articles/diagonal_arrangement.html 20 | - text: "Unreplicated Optimized Arrangement Design" 21 | href: articles/optimized_arrangement.html 22 | - text: "Augmented Randomized Complete Block Design" 23 | href: articles/RCBD_augmented.html 24 | - text: "Partially Replicated Design" 25 | href: articles/partially_replicated.html 26 | - text: "Optimized Multi-Location P-rep" 27 | href: articles/multi_location_prep.html 28 | - text: "Square Lattice Design" 29 | href: articles/square_lattice.html 30 | - text: "Rectangular Lattice Design" 31 | href: articles/rectangular_lattice.html 32 | - text: "Alpha Lattice Design" 33 | href: articles/alpha_lattice.html 34 | - text: "Completely Randomized Design" 35 | href: articles/crd.html 36 | - text: "Randomized Complete Block Design" 37 | href: articles/rcbd.html 38 | - text: "Latin Square Design" 39 | href: articles/latin_square.html 40 | - text: "Full Factorial Design" 41 | href: articles/full_factorial.html 42 | - text: "Split-Plot Design" 43 | href: articles/split_plot.html 44 | - text: "Split-Split Plot Design" 45 | href: articles/split_split_plot.html 46 | - text: "Strip-Plot Design" 47 | href: articles/strip_plot.html 48 | - text: "Incomplete Block Design" 49 | href: articles/incomplete_blocks.html 50 | - text: "Row-Column Design" 51 | href: articles/row_column.html 52 | - text: "Methods in FielDHub" 53 | href: articles/methods.html 54 | 55 | news: 56 | releases: 57 | - text: "Version 1.3.1" 58 | href: articles/news/fieldhub-1-3-1.html 59 | - text: "Version 1.2.0" 60 | href: articles/news/fieldhub-1-2-0.html 61 | - text: "Version 0.1.0" 62 | href: articles/news/fieldhub-0-1-0.html 63 | 64 | development: 65 | mode: auto -------------------------------------------------------------------------------- /man/swap_pairs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_swap_functions.R 3 | \name{swap_pairs} 4 | \alias{swap_pairs} 5 | \title{Swap pairs in a matrix of integers} 6 | \usage{ 7 | swap_pairs( 8 | X, 9 | starting_dist = 3, 10 | stop_iter = 10, 11 | lambda = 0.5, 12 | dist_method = "euclidean", 13 | candidate_sample_size = 4 14 | ) 15 | } 16 | \arguments{ 17 | \item{X}{A matrix of integers.} 18 | 19 | \item{starting_dist}{The minimum starting distance to enforce between pairs of occurrences of the same integer. Default is 3.} 20 | 21 | \item{stop_iter}{The maximum number of iterations to perform. Default is 50.} 22 | 23 | \item{lambda}{A tuning parameter for the centrality penalty. Default is 0.1.} 24 | 25 | \item{dist_method}{The method used for distance calculation. Options are "euclidean" (default) and "manhattan".} 26 | 27 | \item{candidate_sample_size}{Maximum number of candidate cells to evaluate per swap. Default is 5.} 28 | } 29 | \value{ 30 | A list containing: 31 | \item{optim_design}{The modified matrix.} 32 | \item{designs}{A list of all intermediate designs, starting from the input matrix.} 33 | \item{distances}{A list of all pair distances for each intermediate design.} 34 | \item{min_distance}{The minimum distance between pairs of occurrences of the same integer in the final design.} 35 | \item{pairwise_distance}{A data frame with the pairwise distances for the final design.} 36 | \item{rows_incidence}{A vector recording the number of rows with repeated integers for each iteration.} 37 | } 38 | \description{ 39 | Modifies the input matrix \code{X} to ensure that the distance between any two occurrences 40 | of the same integer is at least a distance \code{d}, by swapping one of the occurrences with a 41 | candidate cell of a different integer. The function starts with \code{starting_dist = 3} and increases it 42 | by \code{1} until the algorithm no longer converges or \code{stop_iter} iterations have been performed. 43 | This version evaluates candidate swaps using both the mean pairwise distance and a centrality penalty, 44 | and it uses candidate sampling to reduce computation. 45 | } 46 | \examples{ 47 | set.seed(123) 48 | X <- matrix(sample(c(rep(1:10, 2), 11:50), replace = FALSE), ncol = 10) 49 | B <- swap_pairs( 50 | X, 51 | starting_dist = 3, 52 | stop_iter = 50, 53 | lambda = 0.5, 54 | dist_method = "euclidean", 55 | candidate_sample_size = 3 56 | ) 57 | B$optim_design 58 | 59 | } 60 | -------------------------------------------------------------------------------- /R/utils_check_input.R: -------------------------------------------------------------------------------- 1 | check_input <- function(design, dataIn) { 2 | if (design == "sdiag" || design == "mdiag" || design == "optim" || design == "arcbd" 3 | || design == "prep"|| design == "square" || design == "rect" || design == "alpha" 4 | || design == "ibd" || design == "rcd") { 5 | if (ncol(dataIn) >= 2) { 6 | return( 7 | all( 8 | isTRUE(all.equal(dataIn[,1], unique(dataIn[,1]))), 9 | isTRUE(all.equal(dataIn[,2], unique(dataIn[,2]))) 10 | ) 11 | ) 12 | } else return(NULL) 13 | } else if (design == "lsd") { 14 | if (ncol(dataIn) >= 3) { 15 | return( 16 | all( 17 | isTRUE(all.equal(dataIn[,1],unique(dataIn[,1]))), 18 | isTRUE(all.equal(dataIn[,2],unique(dataIn[,2]))), 19 | isTRUE(all.equal(dataIn[,3],unique(dataIn[,3]))) 20 | ) 21 | ) 22 | } else return(NULL) 23 | } else if (design == "spd") { 24 | if (ncol(dataIn) >= 2) { 25 | wp <- as.vector(na.omit(dataIn[,1])) 26 | sp <- as.vector(na.omit(dataIn[,2])) 27 | return( 28 | all( 29 | isTRUE(all.equal(wp,unique(wp))), 30 | isTRUE(all.equal(sp,unique(sp))) 31 | ) 32 | ) 33 | } else return(NULL) 34 | } else if (design == "sspd") { 35 | if (ncol(dataIn) >= 3) { 36 | wp <- as.vector(na.omit(dataIn[,1])) 37 | sp <- as.vector(na.omit(dataIn[,2])) 38 | ssp <- as.vector(na.omit(dataIn[,3])) 39 | return( 40 | all( 41 | isTRUE(all.equal(wp,unique(wp))), 42 | isTRUE(all.equal(sp,unique(sp))), 43 | isTRUE(all.equal(ssp,unique(ssp))) 44 | ) 45 | ) 46 | } else return(NULL) 47 | } else if (design == "strip") { 48 | if (ncol(dataIn) >= 2) { 49 | h <- as.vector(na.omit(dataIn[,1])) 50 | v <- as.vector(na.omit(dataIn[,2])) 51 | return( 52 | all( 53 | isTRUE(all.equal(h,unique(h))), 54 | isTRUE(all.equal(v,unique(v))) 55 | ) 56 | ) 57 | } else return(NULL) 58 | } else if (design == "crd") { 59 | if (ncol(dataIn) >= 1) { 60 | return(isTRUE(all.equal(dataIn[,1],unique(dataIn[,1])))) 61 | } else return(NULL) 62 | } else if (design == "factorial") { 63 | if (ncol(dataIn) >= 2) { 64 | return(isTRUE(all.equal(dataIn[,2],unique(dataIn[,2])))) 65 | } else return(NULL) 66 | } else if (design == "rcbd") { 67 | if (ncol(dataIn) >= 1) { 68 | return(isTRUE(all.equal(dataIn[,1],unique(dataIn[,1])))) 69 | } else return(NULL) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /data/Diagonal_Multiple_12x13_2.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME,BLOCKS 2 | 101,A,ALL 3 | 102,B,ALL 4 | 103,C,ALL 5 | 104,D,ALL 6 | 105,E,ALL 7 | 300,ND-300,1 8 | 301,ND-301,1 9 | 302,ND-302,1 10 | 303,ND-303,1 11 | 304,ND-304,1 12 | 305,ND-305,1 13 | 306,ND-306,1 14 | 307,ND-307,1 15 | 308,ND-308,1 16 | 309,ND-309,1 17 | 310,ND-310,1 18 | 311,ND-311,1 19 | 312,ND-312,1 20 | 313,ND-313,1 21 | 314,ND-314,1 22 | 315,ND-315,1 23 | 316,ND-316,1 24 | 317,ND-317,1 25 | 318,ND-318,1 26 | 319,ND-319,1 27 | 320,ND-320,1 28 | 321,ND-321,1 29 | 322,ND-322,1 30 | 323,ND-323,1 31 | 324,ND-324,1 32 | 325,ND-325,1 33 | 326,ND-326,1 34 | 327,ND-327,1 35 | 328,ND-328,1 36 | 329,ND-329,1 37 | 330,ND-330,1 38 | 331,ND-331,1 39 | 332,ND-332,1 40 | 333,ND-333,1 41 | 334,ND-334,1 42 | 335,ND-335,2 43 | 336,ND-336,2 44 | 337,ND-337,2 45 | 338,ND-338,2 46 | 339,ND-339,2 47 | 340,ND-340,2 48 | 341,ND-341,2 49 | 342,ND-342,2 50 | 343,ND-343,2 51 | 344,ND-344,2 52 | 345,ND-345,2 53 | 346,ND-346,2 54 | 347,ND-347,2 55 | 348,ND-348,2 56 | 349,ND-349,2 57 | 350,ND-350,2 58 | 351,ND-351,2 59 | 352,ND-352,2 60 | 353,ND-353,2 61 | 354,ND-354,2 62 | 355,ND-355,2 63 | 356,ND-356,2 64 | 357,ND-357,2 65 | 358,ND-358,2 66 | 359,ND-359,2 67 | 360,ND-360,2 68 | 361,ND-361,2 69 | 362,ND-362,2 70 | 363,ND-363,2 71 | 364,ND-364,2 72 | 365,ND-365,2 73 | 366,ND-366,2 74 | 367,ND-367,2 75 | 368,ND-368,2 76 | 369,ND-369,2 77 | 370,ND-370,2 78 | 371,ND-371,2 79 | 372,ND-372,2 80 | 373,ND-373,2 81 | 374,ND-374,2 82 | 375,ND-375,2 83 | 376,ND-376,2 84 | 377,ND-377,2 85 | 378,ND-378,2 86 | 379,ND-379,2 87 | 380,ND-380,2 88 | 381,ND-381,2 89 | 382,ND-382,2 90 | 383,ND-383,2 91 | 384,ND-384,2 92 | 385,ND-385,2 93 | 386,ND-386,2 94 | 387,ND-387,2 95 | 388,ND-388,2 96 | 389,ND-389,2 97 | 390,ND-390,2 98 | 391,ND-391,2 99 | 392,ND-392,2 100 | 393,ND-393,2 101 | 394,ND-394,3 102 | 395,ND-395,3 103 | 396,ND-396,3 104 | 397,ND-397,3 105 | 398,ND-398,3 106 | 399,ND-399,3 107 | 400,ND-400,3 108 | 401,ND-401,3 109 | 402,ND-402,3 110 | 403,ND-403,3 111 | 404,ND-404,3 112 | 405,ND-405,3 113 | 406,ND-406,3 114 | 407,ND-407,3 115 | 408,ND-408,3 116 | 409,ND-409,3 117 | 410,ND-410,3 118 | 411,ND-411,3 119 | 412,ND-412,3 120 | 413,ND-413,3 121 | 414,ND-414,3 122 | 415,ND-415,3 123 | 416,ND-416,3 124 | 417,ND-417,3 125 | 418,ND-418,3 126 | 419,ND-419,3 127 | 420,ND-420,3 128 | 421,ND-421,3 129 | 422,ND-422,3 130 | 423,ND-423,3 131 | 424,ND-424,3 132 | 425,ND-425,3 133 | 426,ND-426,3 134 | 427,ND-427,3 135 | 428,ND-428,3 136 | 429,ND-429,3 137 | 430,ND-430,3 138 | 431,ND-431,3 139 | 432,ND-432,3 140 | 433,ND-433,3 141 | 434,ND-434,3 142 | -------------------------------------------------------------------------------- /man/CRD.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_CRD.R 3 | \name{CRD} 4 | \alias{CRD} 5 | \title{Generates a Completely Randomized Design (CRD)} 6 | \usage{ 7 | CRD( 8 | t = NULL, 9 | reps = NULL, 10 | plotNumber = 101, 11 | locationName = NULL, 12 | seed = NULL, 13 | data = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{t}{An integer number with total number of treatments or a vector of dimension t with labels.} 18 | 19 | \item{reps}{Number of replicates of each treatment.} 20 | 21 | \item{plotNumber}{Starting plot number. By default \code{plotNumber = 101}.} 22 | 23 | \item{locationName}{(optional) Name of the location.} 24 | 25 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 26 | 27 | \item{data}{(optional) Data frame with the 2 columns with labels of each treatments and its number of replicates.} 28 | } 29 | \value{ 30 | A list with two elements. 31 | \itemize{ 32 | \item \code{infoDesign} is a list with information on the design parameters. 33 | \item \code{fieldBook} is a data frame with the CRD field book. 34 | } 35 | } 36 | \description{ 37 | It randomly generates a completely randomized design. 38 | } 39 | \examples{ 40 | # Example 1: Generates a CRD design with 10 treatments and 5 reps each. 41 | crd1 <- CRD( 42 | t = 10, 43 | reps = 5, 44 | plotNumber = 101, 45 | seed = 1987, 46 | locationName = "Fargo" 47 | ) 48 | crd1$infoDesign 49 | head(crd1$fieldBook, 10) 50 | 51 | # Example 2: Generates a CRD design with 15 treatments and 6 reps each. 52 | Gens <- paste("Wheat", 1:15, sep = "") 53 | crd2 <- CRD( 54 | t = Gens, 55 | reps = 6, 56 | plotNumber = 1001, 57 | seed = 1654, 58 | locationName = "Fargo" 59 | ) 60 | crd2$infoDesign 61 | head(crd2$fieldBook, 10) 62 | 63 | # Example 3: Generates a CRD design with 12 treatments and 4 reps each. 64 | # In this case, we show how to use the option data. 65 | treatments <- paste("ND-", 1:12, sep = "") 66 | treatment_list <- data.frame(list(TREATMENT = treatments, REP = 4)) 67 | head(treatment_list) 68 | crd3 <- CRD( 69 | t = NULL, 70 | reps = NULL, 71 | plotNumber = 2001, 72 | seed = 1655, 73 | locationName = "Cali", 74 | data = treatment_list 75 | ) 76 | crd3$infoDesign 77 | head(crd3$fieldBook, 10) 78 | 79 | } 80 | \references{ 81 | Federer, W. T. (1955). Experimental Design. Theory and Application. New York, USA. The 82 | Macmillan Company. 83 | } 84 | \author{ 85 | Didier Murillo [aut], 86 | Salvador Gezan [aut], 87 | Ana Heilman [ctb], 88 | Thomas Walk [ctb], 89 | Johan Aparicio [ctb], 90 | Richard Horsley [ctb] 91 | } 92 | -------------------------------------------------------------------------------- /man/sparse_allocation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_do_optim.R 3 | \name{sparse_allocation} 4 | \alias{sparse_allocation} 5 | \title{Unreplicated designs using the sparse allocation approach} 6 | \usage{ 7 | sparse_allocation( 8 | lines, 9 | nrows, 10 | ncols, 11 | l, 12 | planter = "serpentine", 13 | plotNumber, 14 | copies_per_entry, 15 | checks = NULL, 16 | exptName = NULL, 17 | locationNames, 18 | sparse_list, 19 | seed, 20 | data = NULL 21 | ) 22 | } 23 | \arguments{ 24 | \item{lines}{Number of genotypes, experimental lines or treatments.} 25 | 26 | \item{nrows}{Number of rows in the field.} 27 | 28 | \item{ncols}{Number of columns in the field.} 29 | 30 | \item{l}{Number of locations or sites. By default \code{l = 1}.} 31 | 32 | \item{planter}{Option for \code{serpentine} or \code{cartesian} plot arrangement. 33 | By default \code{planter = 'serpentine'}.} 34 | 35 | \item{plotNumber}{Numeric vector with the starting plot number for each location. 36 | By default \code{plotNumber = 101}.} 37 | 38 | \item{copies_per_entry}{Number of copies per plant. 39 | When design is \code{sparse} then \code{copies_per_entry} < \code{l}} 40 | 41 | \item{checks}{Number of genotypes checks.} 42 | 43 | \item{exptName}{(optional) Name of the experiment.} 44 | 45 | \item{locationNames}{(optional) Names each location.} 46 | 47 | \item{sparse_list}{(optional) A class "Sparse" object generated by \code{do_optim()} function.} 48 | 49 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 50 | 51 | \item{data}{(optional) Data frame with 2 columns: \code{ENTRY | NAME }. ENTRY must be numeric.} 52 | } 53 | \value{ 54 | A list with four elements. 55 | \itemize{ 56 | \item \code{designs} is a list with each location unreplicated randomization. 57 | \item \code{list_locs} is a list with each location list of entries. 58 | \item \code{allocation} is a matrix with the allocation of treatments. 59 | \item \code{size_locations} is a data frame with one column for each 60 | location and one row with the size of the location. 61 | } 62 | } 63 | \description{ 64 | Unreplicated designs using the sparse allocation approach 65 | } 66 | \examples{ 67 | sparse <- sparse_allocation( 68 | lines = 120, 69 | l = 4, 70 | copies_per_entry = 3, 71 | checks = 4, 72 | locationNames = c("LOC1", "LOC2", "LOC3", "LOC4", "LOC5"), 73 | seed = 1234 74 | ) 75 | } 76 | \references{ 77 | Edmondson, R.N. Multi-level Block Designs for Comparative Experiments. JABES 25, 78 | 500–522 (2020). https://doi.org/10.1007/s13253-020-00416-0 79 | } 80 | \author{ 81 | Didier Murillo [aut], 82 | Salvador Gezan [aut], 83 | Ana Heilman [ctb] 84 | } 85 | -------------------------------------------------------------------------------- /man/incomplete_blocks.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_incomplete_blocks.R 3 | \name{incomplete_blocks} 4 | \alias{incomplete_blocks} 5 | \title{Generates a Resolvable Incomplete Block Design} 6 | \usage{ 7 | incomplete_blocks( 8 | t = NULL, 9 | k = NULL, 10 | r = NULL, 11 | l = 1, 12 | plotNumber = 101, 13 | locationNames = NULL, 14 | seed = NULL, 15 | data = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{t}{Number of treatments.} 20 | 21 | \item{k}{Size of incomplete blocks (number of units per incomplete block).} 22 | 23 | \item{r}{Number of full blocks (or resolvable replicates) (also number of replicates per treatment).} 24 | 25 | \item{l}{Number of locations. By default \code{l = 1}.} 26 | 27 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 28 | 29 | \item{locationNames}{(optional) Names for each location.} 30 | 31 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 32 | 33 | \item{data}{(optional) Data frame with label list of treatments.} 34 | } 35 | \value{ 36 | A list with two elements. 37 | \itemize{ 38 | \item \code{infoDesign} is a list with information on the design parameters. 39 | \item \code{fieldBook} is a data frame with the incomplete block design field book. 40 | } 41 | } 42 | \description{ 43 | Randomly generates a resolvable incomplete block design (IBD) of characteristics (t, k, r). 44 | The randomization can be done across locations. 45 | } 46 | \examples{ 47 | # Example 1: Generates a resolvable IBD of characteristics (t,k,r) = (12,4,2). 48 | # 1-resolvable IBDs 49 | ibd1 <- incomplete_blocks(t = 12, 50 | k = 4, 51 | r = 2, 52 | seed = 1984) 53 | ibd1$infoDesign 54 | head(ibd1$fieldBook) 55 | 56 | # Example 2: Generates a balanced resolvable IBD of characteristics (t,k,r) = (15,3,7). 57 | # In this case, we show how to use the option data. 58 | treatments <- paste("TX-", 1:15, sep = "") 59 | ENTRY <- 1:15 60 | treatment_list <- data.frame(list(ENTRY = ENTRY, TREATMENT = treatments)) 61 | head(treatment_list) 62 | ibd2 <- incomplete_blocks(t = 15, 63 | k = 3, 64 | r = 7, 65 | seed = 1985, 66 | data = treatment_list) 67 | ibd2$infoDesign 68 | head(ibd2$fieldBook) 69 | 70 | } 71 | \references{ 72 | Edmondson., R. N. (2021). blocksdesign: Nested and crossed block designs for factorial and 73 | unstructured treatment sets. https://CRAN.R-project.org/package=blocksdesign 74 | } 75 | \author{ 76 | Didier Murillo [aut], 77 | Salvador Gezan [aut], 78 | Ana Heilman [ctb], 79 | Thomas Walk [ctb], 80 | Johan Aparicio [ctb], 81 | Richard Horsley [ctb] 82 | } 83 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: FielDHub 2 | Title: A Shiny App for Design of Experiments in Life Sciences 3 | Version: 1.4.2 4 | Authors@R: 5 | c(person(given = "Didier", 6 | family = "Murillo", 7 | role = c("cre", "aut"), 8 | email = "didier.murilloflorez@ndsu.edu"), 9 | person(given = "Salvador", 10 | family = "Gezan", 11 | role = "aut", 12 | email = "forestats.sg@gmail.com"), 13 | person(given = "Ana", 14 | family = "Heilman", 15 | role = "ctb", 16 | email = "ana.heilman.morales@ndsu.edu"), 17 | person(given = "Thomas", 18 | family = "Walk", 19 | role = "ctb", 20 | email = "tom.walk@ndsu.edu"), 21 | person(given = "Johan", 22 | family = "Aparicio", 23 | role = "ctb", 24 | email = "j.aparicio@cgiar.org"), 25 | person(given = "Matthew", 26 | family = "Seefeldt", 27 | role = "ctb", 28 | email = "matthew.seefeldt@ndsu.edu"), 29 | person(given = "Jean-Marc", 30 | family = "Montpetit", 31 | role = "ctb", 32 | email = "jeanmarc.montpetit@videotron.ca"), 33 | person(given = "Richard", 34 | family = "Horsley", 35 | role = "ctb", 36 | email = "richard.horsley@ndsu.edu"), 37 | person(given = "North Dakota State University", 38 | role = "cph")) 39 | Description: A shiny design of experiments (DOE) app that aids in the creation of traditional, 40 | un-replicated, augmented and partially-replicated designs applied to agriculture, 41 | plant breeding, forestry, animal and biological sciences. 42 | Depends: R (>= 4.1.0) 43 | License: MIT + file LICENSE 44 | Imports: 45 | config, 46 | golem, 47 | shiny (>= 1.7.0), 48 | htmltools, 49 | DT, 50 | shinythemes, 51 | dplyr, 52 | numbers, 53 | blocksdesign, 54 | shinycssloaders, 55 | ggplot2, 56 | plotly, 57 | viridis, 58 | shinyalert, 59 | desplot, 60 | shinyjs 61 | Encoding: UTF-8 62 | RoxygenNote: 7.3.1 63 | Author: Didier Murillo [cre, aut], Salvador Gezan [aut], Ana Heilman [ctb], 64 | Thomas Walk [ctb], Johan Aparicio [ctb], Matthew Seefeldt [ctb], 65 | Jean-Marc Montpetit [ctb], Richard Horsley [ctb], 66 | North Dakota State University [cph] 67 | Maintainer: Didier Murillo 68 | Suggests: 69 | testthat (>= 3.0.0), 70 | spelling, 71 | rlang, 72 | glue, 73 | knitr, 74 | kableExtra, 75 | rmarkdown 76 | Config/testthat/edition: 3 77 | URL: https://github.com/DidierMurilloF/FielDHub, 78 | https://didiermurillof.github.io/FielDHub/ 79 | BugReports: https://github.com/DidierMurilloF/FielDHub/issues 80 | Language: en-US 81 | VignetteBuilder: knitr 82 | -------------------------------------------------------------------------------- /man/latin_square.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_latin_square.R 3 | \name{latin_square} 4 | \alias{latin_square} 5 | \title{Generates a Latin Square Design} 6 | \usage{ 7 | latin_square( 8 | t = NULL, 9 | reps = 1, 10 | plotNumber = 101, 11 | planter = "serpentine", 12 | seed = NULL, 13 | locationNames = NULL, 14 | data = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{t}{Number of treatments.} 19 | 20 | \item{reps}{Number of full resolvable squares. By default \code{reps = 1}.} 21 | 22 | \item{plotNumber}{Starting plot number. By default \code{plotNumber = 101}.} 23 | 24 | \item{planter}{Option for \code{serpentine} or \code{cartesian} arrangement. By default \code{planter = 'serpentine'}.} 25 | 26 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 27 | 28 | \item{locationNames}{(optional) Name for the location.} 29 | 30 | \item{data}{(optional) Data frame with label list of treatments.} 31 | } 32 | \value{ 33 | A list with information on the design parameters. 34 | 35 | Data frame with the latin square field book. 36 | 37 | A list with two elements. 38 | \itemize{ 39 | \item \code{infoDesign} is a list with information on the design parameters. 40 | \item \code{fieldBook} is a data frame with the latin square field book. 41 | } 42 | } 43 | \description{ 44 | Randomly generates a latin square design of up 10 treatments. 45 | } 46 | \examples{ 47 | # Example 1: Generates a latin square design with 4 treatments and 2 reps. 48 | latinSq1 <- latin_square(t = 4, 49 | reps = 2, 50 | plotNumber = 101, 51 | planter = "cartesian", 52 | seed = 1980) 53 | print(latinSq1) 54 | summary(latinSq1) 55 | head(latinSq1$fieldBook) 56 | 57 | # Example 2: Generates a latin square design with 5 treatments and 3 reps. 58 | latin_data <- data.frame(list(ROW = paste("Period", 1:5, sep = ""), 59 | COLUMN = paste("Cow", 1:5, sep = ""), 60 | TREATMENT = paste("Diet", 1:5, sep = ""))) 61 | print(latin_data) 62 | latinSq2 <- latin_square(t = NULL, 63 | reps = 3, 64 | plotNumber = 101, 65 | planter = "cartesian", 66 | seed = 1981, 67 | data = latin_data) 68 | latinSq2$squares 69 | latinSq2$plotSquares 70 | head(latinSq2$fieldBook) 71 | 72 | } 73 | \references{ 74 | Federer, W. T. (1955). Experimental Design. Theory and Application. New York, USA. The 75 | Macmillan Company. 76 | } 77 | \author{ 78 | Didier Murillo [aut], 79 | Salvador Gezan [aut], 80 | Ana Heilman [ctb], 81 | Thomas Walk [ctb], 82 | Johan Aparicio [ctb], 83 | Thiago de Paula Oliveira[ctb] 84 | Richard Horsley [ctb] 85 | } 86 | -------------------------------------------------------------------------------- /R/utils_automatically_cuts.R: -------------------------------------------------------------------------------- 1 | automatically_cuts <- function( 2 | data = NULL, 3 | planter_mov = "serpentine", 4 | stacked = "By Row", 5 | dim_data = NULL) { 6 | req(data) 7 | w_map <- data 8 | auto_cuts_by_r <- numeric() 9 | data_dim_each_block <- dim_data 10 | max_v <- length(data_dim_each_block) 11 | v <- 1;k <- 0 12 | if (stacked == "By Row") { 13 | if(planter_mov == "serpentine") { 14 | if (nrow(w_map) %% 2 == 0){ 15 | for(i in nrow(w_map):1){ 16 | if (i %% 2 == 0){ 17 | A <- 1:ncol(w_map) 18 | }else A <- ncol(w_map):1 19 | 20 | for(j in A){ 21 | if(w_map[i,j] == 0) k <- k + 1 22 | if(data_dim_each_block[v] == k) { 23 | auto_cuts_by_r[v] <- i;k <- 0 24 | if(v < max_v){ 25 | v <- v + 1 26 | }else v <- 1 27 | } 28 | } 29 | } 30 | } else{ 31 | for(i in nrow(w_map):1){ 32 | if (i %% 2 == 0){ 33 | A <- ncol(w_map):1 34 | }else A <- 1:ncol(w_map) 35 | 36 | for(j in A){ 37 | if(w_map[i,j] == 0) k <- k + 1 38 | if (data_dim_each_block[v] == k) { 39 | auto_cuts_by_r[v] <- i;k <- 0 40 | if(v < max_v){ 41 | v <- v + 1 42 | }else v <- 1 43 | } 44 | } 45 | } 46 | } 47 | }else{ 48 | for (i in nrow(w_map):1) { 49 | for (j in 1:ncol(w_map)) { 50 | if (w_map[i,j] == 0) k <- k + 1 51 | if (data_dim_each_block[v] == k) { 52 | auto_cuts_by_r[v] <- i;k <- 0 53 | if (v < max_v) { 54 | v <- v + 1 55 | }else v <- 1 56 | } 57 | } 58 | } 59 | } 60 | 61 | x <- nrow(w_map):1 62 | y <- auto_cuts_by_r 63 | cuts <- x[y] 64 | bks <- list() 65 | s <- 1 66 | for (h in 1:length(cuts)){ 67 | bks[[h]] <- s:(cuts[h]) 68 | s <- (cuts[h] + 1) 69 | } 70 | B <- sort(as.vector(unlist(bks))) 71 | if(nrow(w_map) != B[length(B)]) return(NULL) 72 | 73 | return(list(bks = bks, cuts = cuts)) 74 | 75 | }else { 76 | auto_cuts_by_c <- numeric() 77 | v <- 1;k <- 0 78 | for (j in 1:ncol(w_map)) { 79 | for (i in 1:nrow(w_map)) { 80 | if (w_map[i,j] == 0) k <- k + 1 81 | if (data_dim_each_block[v] == k) { 82 | auto_cuts_by_c[v] <- j;k <- 0 83 | if (v < max_v) { 84 | v <- v + 1 85 | }else v <- 1 86 | } 87 | } 88 | } 89 | } 90 | 91 | return(auto_cuts_by_c) 92 | } 93 | -------------------------------------------------------------------------------- /data/entry_list_180_trts.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,ND-01 3 | 2,ND-02 4 | 3,ND-03 5 | 4,ND-04 6 | 5,ND-05 7 | 6,ND-06 8 | 7,ND-07 9 | 8,ND-08 10 | 9,ND-09 11 | 10,ND-10 12 | 11,ND-11 13 | 12,ND-12 14 | 13,ND-13 15 | 14,ND-14 16 | 15,ND-15 17 | 16,ND-16 18 | 17,ND-17 19 | 18,ND-18 20 | 19,ND-19 21 | 20,ND-20 22 | 21,ND-21 23 | 22,ND-22 24 | 23,ND-23 25 | 24,ND-24 26 | 25,ND-25 27 | 26,ND-26 28 | 27,ND-27 29 | 28,ND-28 30 | 29,ND-29 31 | 30,ND-30 32 | 31,ND-31 33 | 32,ND-32 34 | 33,ND-33 35 | 34,ND-34 36 | 35,ND-35 37 | 36,ND-36 38 | 37,ND-37 39 | 38,ND-38 40 | 39,ND-39 41 | 40,ND-40 42 | 41,ND-41 43 | 42,ND-42 44 | 43,ND-43 45 | 44,ND-44 46 | 45,ND-45 47 | 46,ND-46 48 | 47,ND-47 49 | 48,ND-48 50 | 49,ND-49 51 | 50,ND-50 52 | 51,ND-51 53 | 52,ND-52 54 | 53,ND-53 55 | 54,ND-54 56 | 55,ND-55 57 | 56,ND-56 58 | 57,ND-57 59 | 58,ND-58 60 | 59,ND-59 61 | 60,ND-60 62 | 61,ND-61 63 | 62,ND-62 64 | 63,ND-63 65 | 64,ND-64 66 | 65,ND-65 67 | 66,ND-66 68 | 67,ND-67 69 | 68,ND-68 70 | 69,ND-69 71 | 70,ND-70 72 | 71,ND-71 73 | 72,ND-72 74 | 73,ND-73 75 | 74,ND-74 76 | 75,ND-75 77 | 76,ND-76 78 | 77,ND-77 79 | 78,ND-78 80 | 79,ND-79 81 | 80,ND-80 82 | 81,ND-81 83 | 82,ND-82 84 | 83,ND-83 85 | 84,ND-84 86 | 85,ND-85 87 | 86,ND-86 88 | 87,ND-87 89 | 88,ND-88 90 | 89,ND-89 91 | 90,ND-90 92 | 91,ND-91 93 | 92,ND-92 94 | 93,ND-93 95 | 94,ND-94 96 | 95,ND-95 97 | 96,ND-96 98 | 97,ND-97 99 | 98,ND-98 100 | 99,ND-99 101 | 100,ND-100 102 | 101,ND-101 103 | 102,ND-102 104 | 103,ND-103 105 | 104,ND-104 106 | 105,ND-105 107 | 106,ND-106 108 | 107,ND-107 109 | 108,ND-108 110 | 109,ND-109 111 | 110,ND-110 112 | 111,ND-111 113 | 112,ND-112 114 | 113,ND-113 115 | 114,ND-114 116 | 115,ND-115 117 | 116,ND-116 118 | 117,ND-117 119 | 118,ND-118 120 | 119,ND-119 121 | 120,ND-120 122 | 121,ND-121 123 | 122,ND-122 124 | 123,ND-123 125 | 124,ND-124 126 | 125,ND-125 127 | 126,ND-126 128 | 127,ND-127 129 | 128,ND-128 130 | 129,ND-129 131 | 130,ND-130 132 | 131,ND-131 133 | 132,ND-132 134 | 133,ND-133 135 | 134,ND-134 136 | 135,ND-135 137 | 136,ND-136 138 | 137,ND-137 139 | 138,ND-138 140 | 139,ND-139 141 | 140,ND-140 142 | 141,ND-141 143 | 142,ND-142 144 | 143,ND-143 145 | 144,ND-144 146 | 145,ND-145 147 | 146,ND-146 148 | 147,ND-147 149 | 148,ND-148 150 | 149,ND-149 151 | 150,ND-150 152 | 151,ND-151 153 | 152,ND-152 154 | 153,ND-153 155 | 154,ND-154 156 | 155,ND-155 157 | 156,ND-156 158 | 157,ND-157 159 | 158,ND-158 160 | 159,ND-159 161 | 160,ND-160 162 | 161,ND-161 163 | 162,ND-162 164 | 163,ND-163 165 | 164,ND-164 166 | 165,ND-165 167 | 166,ND-166 168 | 167,ND-167 169 | 168,ND-168 170 | 169,ND-169 171 | 170,ND-170 172 | 171,ND-171 173 | 172,ND-172 174 | 173,ND-173 175 | 174,ND-174 176 | 175,ND-175 177 | 176,ND-176 178 | 177,ND-177 179 | 178,ND-178 180 | 179,ND-179 181 | 180,ND-180 -------------------------------------------------------------------------------- /R/utils_get_DBrandom.R: -------------------------------------------------------------------------------- 1 | get_DBrandom <- function(binaryMap = NULL, 2 | data_dim_each_block = NULL, 3 | data_entries = NULL, 4 | planter = "serpentine") { 5 | 6 | w_map <- binaryMap 7 | # len_spots_to_fill <- sum(w_map == 0) 8 | # # data_entries <- as.vector(data_entries[,1]) 9 | # data_entries <- as.vector(data_entries$ENTRY) 10 | # len_entries_to_random <- length(data_entries) 11 | # if (len_entries_to_random != len_spots_to_fill) { 12 | # stop("data entries do not fit to the availables plot!!") 13 | # } else { 14 | # print("Randomization was done with entries: ") 15 | # print(c(len_entries_to_random, len_spots_to_fill)) 16 | # } 17 | target <- rep(LETTERS[1:length(data_dim_each_block)], data_dim_each_block) 18 | v <- 1 19 | if(planter == "serpentine") { 20 | if (nrow(w_map) %% 2 == 0){ 21 | for(i in nrow(w_map):1){ 22 | if (i %% 2 == 0){ 23 | A <- 1:ncol(w_map) 24 | }else A <- ncol(w_map):1 25 | for(j in A){ 26 | if (w_map[i,j] == 0){ 27 | w_map[i,j] <- target[v] 28 | v <- v + 1 29 | }else{ 30 | w_map[i,j] <- w_map[i,j] 31 | v <- v 32 | } 33 | } 34 | } 35 | }else{ 36 | for(i in nrow(w_map):1){ 37 | if (i %% 2 == 0){ 38 | A <- ncol(w_map):1 39 | }else A <- 1:ncol(w_map) 40 | for(j in A){ 41 | if (w_map[i,j] == 0){ 42 | w_map[i,j] <- target[v] 43 | v <- v + 1 44 | }else{ 45 | w_map[i,j] <- w_map[i,j] 46 | v <- v 47 | } 48 | } 49 | } 50 | } 51 | }else{ 52 | for(i in nrow(w_map):1){ 53 | for(j in 1:ncol(w_map)){ 54 | if (w_map[i,j] == 0){ 55 | w_map[i,j] <- target[v] 56 | v <- v + 1 57 | }else{ 58 | w_map[i,j] <- w_map[i,j] 59 | v <- v 60 | } 61 | } 62 | } 63 | v <- 1 64 | } 65 | w_map_letters <- w_map 66 | levels_target <- levels(as.factor(target)) 67 | data_entries <- as.vector(data_entries$ENTRY) 68 | entries <- split_vectors(data_entries, data_dim_each_block) 69 | z <- 1 70 | for(k in 1:length(entries)) { 71 | w_map[w_map == levels_target[z]] <- sample(entries[[k]]) 72 | z <- z + 1 73 | } 74 | 75 | data_entries_no_checks <- data_entries 76 | len_entries_to_random <- length(data_entries_no_checks) 77 | treatments_random <- sum(data_entries_no_checks %in% w_map) 78 | if (treatments_random == len_entries_to_random) { 79 | w_map_ok <- w_map 80 | # print("Randomization was successful. It passed all tests!") 81 | # print(c(treatments_random, len_entries_to_random)) 82 | } else stop("Some entries are missing in the randomization!!") 83 | return(list(rand = w_map_ok, Entries = entries, 84 | Lines = data_dim_each_block, 85 | w_map_letters = w_map_letters)) 86 | } 87 | -------------------------------------------------------------------------------- /data/entry_list_176_trts_1.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,CHECK-1 3 | 2,CHECK-2 4 | 3,CHECK-3 5 | 4,CHECK-4 6 | 5,ND-05 7 | 6,ND-06 8 | 7,ND-07 9 | 8,ND-08 10 | 9,ND-09 11 | 10,ND-10 12 | 11,ND-11 13 | 12,ND-12 14 | 13,ND-13 15 | 14,ND-14 16 | 15,ND-15 17 | 16,ND-16 18 | 17,ND-17 19 | 18,ND-18 20 | 19,ND-19 21 | 20,ND-20 22 | 21,ND-21 23 | 22,ND-22 24 | 23,ND-23 25 | 24,ND-24 26 | 25,ND-25 27 | 26,ND-26 28 | 27,ND-27 29 | 28,ND-28 30 | 29,ND-29 31 | 30,ND-30 32 | 31,ND-31 33 | 32,ND-32 34 | 33,ND-33 35 | 34,ND-34 36 | 35,ND-35 37 | 36,ND-36 38 | 37,ND-37 39 | 38,ND-38 40 | 39,ND-39 41 | 40,ND-40 42 | 41,ND-41 43 | 42,ND-42 44 | 43,ND-43 45 | 44,ND-44 46 | 45,ND-45 47 | 46,ND-46 48 | 47,ND-47 49 | 48,ND-48 50 | 49,ND-49 51 | 50,ND-50 52 | 51,ND-51 53 | 52,ND-52 54 | 53,ND-53 55 | 54,ND-54 56 | 55,ND-55 57 | 56,ND-56 58 | 57,ND-57 59 | 58,ND-58 60 | 59,ND-59 61 | 60,ND-60 62 | 61,ND-61 63 | 62,ND-62 64 | 63,ND-63 65 | 64,ND-64 66 | 65,ND-65 67 | 66,ND-66 68 | 67,ND-67 69 | 68,ND-68 70 | 69,ND-69 71 | 70,ND-70 72 | 71,ND-71 73 | 72,ND-72 74 | 73,ND-73 75 | 74,ND-74 76 | 75,ND-75 77 | 76,ND-76 78 | 77,ND-77 79 | 78,ND-78 80 | 79,ND-79 81 | 80,ND-80 82 | 81,ND-81 83 | 82,ND-82 84 | 83,ND-83 85 | 84,ND-84 86 | 85,ND-85 87 | 86,ND-86 88 | 87,ND-87 89 | 88,ND-88 90 | 89,ND-89 91 | 90,ND-90 92 | 91,ND-91 93 | 92,ND-92 94 | 93,ND-93 95 | 94,ND-94 96 | 95,ND-95 97 | 96,ND-96 98 | 97,ND-97 99 | 98,ND-98 100 | 99,ND-99 101 | 100,ND-100 102 | 101,ND-101 103 | 102,ND-102 104 | 103,ND-103 105 | 104,ND-104 106 | 105,ND-105 107 | 106,ND-106 108 | 107,ND-107 109 | 108,ND-108 110 | 109,ND-109 111 | 110,ND-110 112 | 111,ND-111 113 | 112,ND-112 114 | 113,ND-113 115 | 114,ND-114 116 | 115,ND-115 117 | 116,ND-116 118 | 117,ND-117 119 | 118,ND-118 120 | 119,ND-119 121 | 120,ND-120 122 | 121,ND-121 123 | 122,ND-122 124 | 123,ND-123 125 | 124,ND-124 126 | 125,ND-125 127 | 126,ND-126 128 | 127,ND-127 129 | 128,ND-128 130 | 129,ND-129 131 | 130,ND-130 132 | 131,ND-131 133 | 132,ND-132 134 | 133,ND-133 135 | 134,ND-134 136 | 135,ND-135 137 | 136,ND-136 138 | 137,ND-137 139 | 138,ND-138 140 | 139,ND-139 141 | 140,ND-140 142 | 141,ND-141 143 | 142,ND-142 144 | 143,ND-143 145 | 144,ND-144 146 | 145,ND-145 147 | 146,ND-146 148 | 147,ND-147 149 | 148,ND-148 150 | 149,ND-149 151 | 150,ND-150 152 | 151,ND-151 153 | 152,ND-152 154 | 153,ND-153 155 | 154,ND-154 156 | 155,ND-155 157 | 156,ND-156 158 | 157,ND-157 159 | 158,ND-158 160 | 159,ND-159 161 | 160,ND-160 162 | 161,ND-161 163 | 162,ND-162 164 | 163,ND-163 165 | 164,ND-164 166 | 165,ND-165 167 | 166,ND-166 168 | 167,ND-167 169 | 168,ND-168 170 | 169,ND-169 171 | 170,ND-170 172 | 171,ND-171 173 | 172,ND-172 174 | 173,ND-173 175 | 174,ND-174 176 | 175,ND-175 177 | 176,ND-176 178 | 177,ND-177 179 | 178,ND-178 180 | 179,ND-179 181 | 180,ND-180 -------------------------------------------------------------------------------- /data/entry_list_176_trts_2.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 501,CHECK-1 3 | 502,CHECK-2 4 | 503,CHECK-3 5 | 504,CHECK-4 6 | 5,ND-05 7 | 6,ND-06 8 | 7,ND-07 9 | 8,ND-08 10 | 9,ND-09 11 | 10,ND-10 12 | 11,ND-11 13 | 12,ND-12 14 | 13,ND-13 15 | 14,ND-14 16 | 15,ND-15 17 | 16,ND-16 18 | 17,ND-17 19 | 18,ND-18 20 | 19,ND-19 21 | 20,ND-20 22 | 21,ND-21 23 | 22,ND-22 24 | 23,ND-23 25 | 24,ND-24 26 | 25,ND-25 27 | 26,ND-26 28 | 27,ND-27 29 | 28,ND-28 30 | 29,ND-29 31 | 30,ND-30 32 | 31,ND-31 33 | 32,ND-32 34 | 33,ND-33 35 | 34,ND-34 36 | 35,ND-35 37 | 36,ND-36 38 | 37,ND-37 39 | 38,ND-38 40 | 39,ND-39 41 | 40,ND-40 42 | 41,ND-41 43 | 42,ND-42 44 | 43,ND-43 45 | 44,ND-44 46 | 45,ND-45 47 | 46,ND-46 48 | 47,ND-47 49 | 48,ND-48 50 | 49,ND-49 51 | 50,ND-50 52 | 51,ND-51 53 | 52,ND-52 54 | 53,ND-53 55 | 54,ND-54 56 | 55,ND-55 57 | 56,ND-56 58 | 57,ND-57 59 | 58,ND-58 60 | 59,ND-59 61 | 60,ND-60 62 | 61,ND-61 63 | 62,ND-62 64 | 63,ND-63 65 | 64,ND-64 66 | 65,ND-65 67 | 66,ND-66 68 | 67,ND-67 69 | 68,ND-68 70 | 69,ND-69 71 | 70,ND-70 72 | 71,ND-71 73 | 72,ND-72 74 | 73,ND-73 75 | 74,ND-74 76 | 75,ND-75 77 | 76,ND-76 78 | 77,ND-77 79 | 78,ND-78 80 | 79,ND-79 81 | 80,ND-80 82 | 81,ND-81 83 | 82,ND-82 84 | 83,ND-83 85 | 84,ND-84 86 | 85,ND-85 87 | 86,ND-86 88 | 87,ND-87 89 | 88,ND-88 90 | 89,ND-89 91 | 90,ND-90 92 | 91,ND-91 93 | 92,ND-92 94 | 93,ND-93 95 | 94,ND-94 96 | 95,ND-95 97 | 96,ND-96 98 | 97,ND-97 99 | 98,ND-98 100 | 99,ND-99 101 | 100,ND-100 102 | 101,ND-101 103 | 102,ND-102 104 | 103,ND-103 105 | 104,ND-104 106 | 105,ND-105 107 | 106,ND-106 108 | 107,ND-107 109 | 108,ND-108 110 | 109,ND-109 111 | 110,ND-110 112 | 111,ND-111 113 | 112,ND-112 114 | 113,ND-113 115 | 114,ND-114 116 | 115,ND-115 117 | 116,ND-116 118 | 117,ND-117 119 | 118,ND-118 120 | 119,ND-119 121 | 120,ND-120 122 | 121,ND-121 123 | 122,ND-122 124 | 123,ND-123 125 | 124,ND-124 126 | 125,ND-125 127 | 126,ND-126 128 | 127,ND-127 129 | 128,ND-128 130 | 129,ND-129 131 | 130,ND-130 132 | 131,ND-131 133 | 132,ND-132 134 | 133,ND-133 135 | 134,ND-134 136 | 135,ND-135 137 | 136,ND-136 138 | 137,ND-137 139 | 138,ND-138 140 | 139,ND-139 141 | 140,ND-140 142 | 141,ND-141 143 | 142,ND-142 144 | 143,ND-143 145 | 144,ND-144 146 | 145,ND-145 147 | 146,ND-146 148 | 147,ND-147 149 | 148,ND-148 150 | 149,ND-149 151 | 150,ND-150 152 | 151,ND-151 153 | 152,ND-152 154 | 153,ND-153 155 | 154,ND-154 156 | 155,ND-155 157 | 156,ND-156 158 | 157,ND-157 159 | 158,ND-158 160 | 159,ND-159 161 | 160,ND-160 162 | 161,ND-161 163 | 162,ND-162 164 | 163,ND-163 165 | 164,ND-164 166 | 165,ND-165 167 | 166,ND-166 168 | 167,ND-167 169 | 168,ND-168 170 | 169,ND-169 171 | 170,ND-170 172 | 171,ND-171 173 | 172,ND-172 174 | 173,ND-173 175 | 174,ND-174 176 | 175,ND-175 177 | 176,ND-176 178 | 177,ND-177 179 | 178,ND-178 180 | 179,ND-179 181 | 180,ND-180 -------------------------------------------------------------------------------- /R/utils_ibd_plot_numbers.R: -------------------------------------------------------------------------------- 1 | ibd_plot_numbers <- function(nt = NULL, plot.number = NULL, r = NULL, l = NULL) { 2 | 3 | if (!is.null(plot.number)) { 4 | if (any(plot.number < 1)) stop ("Plot numbers should be possitive values.") 5 | if (any(plot.number %% 1 != 0)) stop ("Plot numbers should be integer values.") 6 | if (!is.numeric(plot.number)) stop ("Plot numbers should be integer values.") 7 | 8 | if (length(plot.number) == l) { 9 | plot.number <- plot.number[1:l] 10 | plot.number <- seriePlot.numbers(plot.number = plot.number, reps = r, l = l, t = nt) 11 | p.number.loc <- vector(mode = "list", length = l) 12 | for (k in 1:l) { 13 | plotsDesign <- matrix(data = NA, nrow = nt, ncol = r) 14 | for(s in 1:r) { 15 | D <- plot.number[[k]] 16 | plots <- D[s]:(D[s] + (nt) - 1) 17 | plotsDesign[,s] <- plots 18 | } 19 | p.number.loc[[k]] <- as.vector(plotsDesign) 20 | } 21 | }else if (length(plot.number) < l) { 22 | plot.number <- seq(1001, 1000*(l+1), 1000) 23 | plot.number <- seriePlot.numbers(plot.number = plot.number, reps = r, l = l, t = nt) 24 | p.number.loc <- vector(mode = "list", length = l) 25 | for (k in 1:l) { 26 | plotsDesign <- matrix(data = NA, nrow = nt, ncol = r) 27 | for(s in 1:r) { 28 | D <- plot.number[[k]] 29 | plots <- D[s]:(D[s] + (nt) - 1) 30 | plotsDesign[,s] <- plots 31 | } 32 | p.number.loc[[k]] <- as.vector(plotsDesign) 33 | } 34 | warning("Length of plot numbers is lower than the number of locations.") 35 | }else if (length(plot.number) > l) { 36 | plot.number <- plot.number[1:l] 37 | plot.number <- seriePlot.numbers(plot.number = plot.number, reps = r, l = l, t = nt) 38 | plotsDesign <- matrix(data = NA, nrow = nt, ncol = l) 39 | p.number.loc <- vector(mode = "list", length = l) 40 | for (k in 1:l) { 41 | plotsDesign <- matrix(data = NA, nrow = nt, ncol = r) 42 | for(s in 1:r) { 43 | D <- plot.number[[k]] 44 | plots <- D[s]:(D[s] + (nt) - 1) 45 | plotsDesign[,s] <- plots 46 | } 47 | p.number.loc[[k]] <- as.vector(plotsDesign) 48 | } 49 | warning("Length of plot numbers is larger than number of locations.") 50 | } 51 | }else { 52 | plot.number <- seq(1001, 1000*(l+1), 1000) 53 | plot.number <- seriePlot.numbers(plot.number = plot.number, reps = r, l = l, t = nt) 54 | p.number.loc <- vector(mode = "list", length = l) 55 | for (k in 1:l) { 56 | plotsDesign <- matrix(data = NA, nrow = nt, ncol = r) 57 | for(s in 1:r) { 58 | D <- plot.number[[k]] 59 | plots <- D[s]:(D[s] + (nt) - 1) 60 | plotsDesign[,s] <- plots 61 | } 62 | p.number.loc[[k]] <- as.vector(plotsDesign) 63 | } 64 | warning("Since plot numbers are NULL, these will be generated automatically.") 65 | } 66 | 67 | return(plot.number = p.number.loc) 68 | 69 | } 70 | -------------------------------------------------------------------------------- /man/square_lattice.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_square_lattice.R 3 | \name{square_lattice} 4 | \alias{square_lattice} 5 | \title{Generates a Square Lattice Design.} 6 | \usage{ 7 | square_lattice( 8 | t = NULL, 9 | k = NULL, 10 | r = NULL, 11 | l = 1, 12 | plotNumber = 101, 13 | locationNames = NULL, 14 | seed = NULL, 15 | data = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{t}{Number of treatments.} 20 | 21 | \item{k}{Size of incomplete blocks (number of units per incomplete block).} 22 | 23 | \item{r}{Number of blocks (full resolvable replicates).} 24 | 25 | \item{l}{Number of locations. By default \code{l = 1}.} 26 | 27 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 28 | 29 | \item{locationNames}{(optional) Names for each location.} 30 | 31 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 32 | 33 | \item{data}{(optional) Data frame with label list of treatments.} 34 | } 35 | \value{ 36 | A list with two elements. 37 | \itemize{ 38 | \item \code{infoDesign} is a list with information on the design parameters. 39 | \item \code{fieldBook} is a data frame with the square lattice design field book. 40 | } 41 | } 42 | \description{ 43 | It randomly generates a square lattice design across locations. 44 | } 45 | \examples{ 46 | # Example 1: Generates a square lattice design with 5 full blocks, 8 units per IBlock, 47 | # 8 IBlocks for a square number of treatmens of 64 in two locations. 48 | squareLattice1 <- square_lattice(t = 64, k = 8, r = 5, l = 2, 49 | plotNumber = c(1001, 2001), 50 | locationNames = c("FARGO", "MINOT"), 51 | seed = 1986) 52 | squareLattice1$infoDesign 53 | head(squareLattice1$fieldBook,12) 54 | 55 | # Example 2: Generates a square lattice design with 3 full blocks, 7 units per IBlock, 56 | # 7 IBlocks for a square number of treatmens of 49 in one location. 57 | # In this case, we show how to use the option data. 58 | treatments <- paste("G", 1:49, sep = "") 59 | ENTRY <- 1:49 60 | treatment_list <- data.frame(list(ENTRY = ENTRY, TREATMENT = treatments)) 61 | head(treatment_list) 62 | squareLattice2 <- square_lattice(t = 49, k = 7, r = 3, l = 1, 63 | plotNumber = 1001, 64 | locationNames = "CASSELTON", 65 | seed = 1986, 66 | data = treatment_list) 67 | squareLattice2$infoDesign 68 | head(squareLattice2$fieldBook,12) 69 | 70 | } 71 | \references{ 72 | Edmondson., R. N. (2021). blocksdesign: Nested and crossed block designs for factorial and 73 | unstructured treatment sets. https://CRAN.R-project.org/package=blocksdesign 74 | } 75 | \author{ 76 | Didier Murillo [aut], 77 | Salvador Gezan [aut], 78 | Ana Heilman [ctb], 79 | Thomas Walk [ctb], 80 | Johan Aparicio [ctb], 81 | Richard Horsley [ctb] 82 | } 83 | -------------------------------------------------------------------------------- /man/rectangular_lattice.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_rectangular_lattice.R 3 | \name{rectangular_lattice} 4 | \alias{rectangular_lattice} 5 | \title{Generates a Rectangular Lattice Design.} 6 | \usage{ 7 | rectangular_lattice( 8 | t = NULL, 9 | k = NULL, 10 | r = NULL, 11 | l = 1, 12 | plotNumber = 101, 13 | locationNames = NULL, 14 | seed = NULL, 15 | data = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{t}{Number of treatments.} 20 | 21 | \item{k}{Size of incomplete blocks (number of units per incomplete block).} 22 | 23 | \item{r}{Number of blocks (full resolvable replicates).} 24 | 25 | \item{l}{Number of locations. By default \code{l = 1}.} 26 | 27 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 28 | 29 | \item{locationNames}{(optional) Names for each location.} 30 | 31 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 32 | 33 | \item{data}{(optional) Data frame with label list of treatments.} 34 | } 35 | \value{ 36 | A list with two elements. 37 | \itemize{ 38 | \item \code{infoDesign} is a list with information on the design parameters. 39 | \item \code{fieldBook} is a data frame with the rectangular lattice design field book. 40 | } 41 | } 42 | \description{ 43 | It randomly generates a rectangular lattice design across locations. 44 | } 45 | \examples{ 46 | # Example 1: Generates a rectangular lattice design with 6 full blocks, 4 units per IBlock (k) 47 | # and 20 treatments in one location. 48 | rectangularLattice1 <- rectangular_lattice(t = 20, k = 4, r = 6, l = 1, 49 | plotNumber = 101, 50 | locationNames = "FARGO", 51 | seed = 126) 52 | rectangularLattice1$infoDesign 53 | head(rectangularLattice1$fieldBook,12) 54 | 55 | # Example 2: Generates a rectangular lattice design with 5 full blocks, 7 units per IBlock (k) 56 | # and 56 treatments across 2 locations. 57 | # In this case, we show how to use the option data. 58 | treatments <- paste("ND-", 1:56, sep = "") 59 | ENTRY <- 1:56 60 | treatment_list <- data.frame(list(ENTRY = ENTRY, TREATMENT = treatments)) 61 | head(treatment_list) 62 | rectangularLattice2 <- rectangular_lattice(t = 56, k = 7, r = 5, l = 2, 63 | plotNumber = c(1001,2001), 64 | locationNames = c("Loc1", "Loc2"), 65 | seed = 127, 66 | data = treatment_list) 67 | rectangularLattice2$infoDesign 68 | head(rectangularLattice2$fieldBook,12) 69 | 70 | } 71 | \references{ 72 | Edmondson., R. N. (2021). blocksdesign: Nested and crossed block designs for factorial and 73 | unstructured treatment sets. https://CRAN.R-project.org/package=blocksdesign 74 | } 75 | \author{ 76 | Didier Murillo [aut], 77 | Salvador Gezan [aut], 78 | Ana Heilman [ctb], 79 | Thomas Walk [ctb], 80 | Johan Aparicio [ctb], 81 | Richard Horsley [ctb] 82 | } 83 | -------------------------------------------------------------------------------- /data/Diagonal_188_treatments_4_checks.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 101,A 3 | 102,B 4 | 103,C 5 | 104,D 6 | 300,ND-300 7 | 301,ND-301 8 | 302,ND-302 9 | 303,ND-303 10 | 304,ND-304 11 | 305,ND-305 12 | 306,ND-306 13 | 307,ND-307 14 | 308,ND-308 15 | 309,ND-309 16 | 310,ND-310 17 | 311,ND-311 18 | 312,ND-312 19 | 313,ND-313 20 | 314,ND-314 21 | 315,ND-315 22 | 316,ND-316 23 | 317,ND-317 24 | 318,ND-318 25 | 319,ND-319 26 | 320,ND-320 27 | 321,ND-321 28 | 322,ND-322 29 | 323,ND-323 30 | 324,ND-324 31 | 325,ND-325 32 | 326,ND-326 33 | 327,ND-327 34 | 328,ND-328 35 | 329,ND-329 36 | 330,ND-330 37 | 331,ND-331 38 | 332,ND-332 39 | 333,ND-333 40 | 334,ND-334 41 | 335,ND-335 42 | 336,ND-336 43 | 337,ND-337 44 | 338,ND-338 45 | 339,ND-339 46 | 340,ND-340 47 | 341,ND-341 48 | 342,ND-342 49 | 343,ND-343 50 | 344,ND-344 51 | 345,ND-345 52 | 346,ND-346 53 | 347,ND-347 54 | 348,ND-348 55 | 349,ND-349 56 | 350,ND-350 57 | 351,ND-351 58 | 352,ND-352 59 | 353,ND-353 60 | 354,ND-354 61 | 355,ND-355 62 | 356,ND-356 63 | 357,ND-357 64 | 358,ND-358 65 | 359,ND-359 66 | 360,ND-360 67 | 361,ND-361 68 | 362,ND-362 69 | 363,ND-363 70 | 364,ND-364 71 | 365,ND-365 72 | 366,ND-366 73 | 367,ND-367 74 | 368,ND-368 75 | 369,ND-369 76 | 370,ND-370 77 | 371,ND-371 78 | 372,ND-372 79 | 373,ND-373 80 | 374,ND-374 81 | 375,ND-375 82 | 376,ND-376 83 | 377,ND-377 84 | 378,ND-378 85 | 379,ND-379 86 | 380,ND-380 87 | 381,ND-381 88 | 382,ND-382 89 | 383,ND-383 90 | 384,ND-384 91 | 385,ND-385 92 | 386,ND-386 93 | 387,ND-387 94 | 388,ND-388 95 | 389,ND-389 96 | 390,ND-390 97 | 391,ND-391 98 | 392,ND-392 99 | 393,ND-393 100 | 394,ND-394 101 | 395,ND-395 102 | 396,ND-396 103 | 397,ND-397 104 | 398,ND-398 105 | 399,ND-399 106 | 400,ND-400 107 | 401,ND-401 108 | 402,ND-402 109 | 403,ND-403 110 | 404,ND-404 111 | 405,ND-405 112 | 406,ND-406 113 | 407,ND-407 114 | 408,ND-408 115 | 409,ND-409 116 | 410,ND-410 117 | 411,ND-411 118 | 412,ND-412 119 | 413,ND-413 120 | 414,ND-414 121 | 415,ND-415 122 | 416,ND-416 123 | 417,ND-417 124 | 418,ND-418 125 | 419,ND-419 126 | 420,ND-420 127 | 421,ND-421 128 | 422,ND-422 129 | 423,ND-423 130 | 424,ND-424 131 | 425,ND-425 132 | 426,ND-426 133 | 427,ND-427 134 | 428,ND-428 135 | 429,ND-429 136 | 430,ND-430 137 | 431,ND-431 138 | 432,ND-432 139 | 433,ND-433 140 | 434,ND-434 141 | 435,ND-435 142 | 436,ND-436 143 | 437,ND-437 144 | 438,ND-438 145 | 439,ND-439 146 | 440,ND-440 147 | 441,ND-441 148 | 442,ND-442 149 | 443,ND-443 150 | 444,ND-444 151 | 445,ND-445 152 | 446,ND-446 153 | 447,ND-447 154 | 448,ND-448 155 | 449,ND-449 156 | 450,ND-450 157 | 451,ND-451 158 | 452,ND-452 159 | 453,ND-453 160 | 454,ND-454 161 | 455,ND-455 162 | 456,ND-456 163 | 457,ND-457 164 | 458,ND-458 165 | 459,ND-459 166 | 460,ND-460 167 | 461,ND-461 168 | 462,ND-462 169 | 463,ND-463 170 | 464,ND-464 171 | 465,ND-465 172 | 466,ND-466 173 | 467,ND-467 174 | 468,ND-468 175 | 469,ND-469 176 | 470,ND-470 177 | 471,ND-471 178 | 472,ND-472 179 | 473,ND-473 180 | 474,ND-474 181 | 475,ND-475 182 | 476,ND-476 183 | 477,ND-477 184 | 478,ND-478 185 | 479,ND-479 186 | 480,ND-480 187 | 481,ND-481 188 | 482,ND-482 189 | 483,ND-483 190 | 484,ND-484 191 | 485,ND-485 192 | 486,ND-486 193 | 487,ND-487 194 | -------------------------------------------------------------------------------- /man/alpha_lattice.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_alpha_lattice.R 3 | \name{alpha_lattice} 4 | \alias{alpha_lattice} 5 | \title{Generates an Alpha Design} 6 | \usage{ 7 | alpha_lattice( 8 | t = NULL, 9 | k = NULL, 10 | r = NULL, 11 | l = 1, 12 | plotNumber = 101, 13 | locationNames = NULL, 14 | seed = NULL, 15 | data = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{t}{Number of treatments.} 20 | 21 | \item{k}{Size of incomplete blocks (number of units per incomplete block).} 22 | 23 | \item{r}{Number of full blocks (or resolvable replicates) (also number of replicates per treatment).} 24 | 25 | \item{l}{Number of locations. By default \code{l = 1}.} 26 | 27 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 28 | 29 | \item{locationNames}{(optional) String with names for each of the \code{l} locations.} 30 | 31 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 32 | 33 | \item{data}{(optional) Data frame with label list of treatments.} 34 | } 35 | \value{ 36 | A list with two elements. 37 | \itemize{ 38 | \item \code{infoDesign} is a list with information on the design parameters. 39 | \item \code{fieldBook} is a data frame with the alpha design field book. 40 | } 41 | } 42 | \description{ 43 | Randomly generates an alpha design like \code{alpha(0,1)} across multiple locations. 44 | } 45 | \examples{ 46 | # Example 1: Generates an alpha design with 4 full blocks and 15 treatments. 47 | # Size of IBlocks k = 3. 48 | alphalattice1 <- alpha_lattice(t = 15, 49 | k = 3, 50 | r = 4, 51 | l = 1, 52 | plotNumber = 101, 53 | locationNames = "GreenHouse", 54 | seed = 1247) 55 | alphalattice1$infoDesign 56 | head(alphalattice1$fieldBook, 10) 57 | 58 | # Example 2: Generates an alpha design with 3 full blocks and 25 treatment. 59 | # Size of IBlocks k = 5. 60 | # In this case, we show how to use the option data. 61 | treatments <- paste("G-", 1:25, sep = "") 62 | ENTRY <- 1:25 63 | treatment_list <- data.frame(list(ENTRY = ENTRY, TREATMENT = treatments)) 64 | head(treatment_list) 65 | alphalattice2 <- alpha_lattice(t = 25, 66 | k = 5, 67 | r = 3, 68 | l = 1, 69 | plotNumber = 1001, 70 | locationNames = "A", 71 | seed = 1945, 72 | data = treatment_list) 73 | alphalattice2$infoDesign 74 | head(alphalattice2$fieldBook, 10) 75 | 76 | } 77 | \references{ 78 | Edmondson., R. N. (2021). blocksdesign: Nested and crossed block designs for factorial and 79 | unstructured treatment sets. https://CRAN.R-project.org/package=blocksdesign 80 | } 81 | \author{ 82 | Didier Murillo [aut], 83 | Salvador Gezan [aut], 84 | Ana Heilman [ctb], 85 | Thomas Walk [ctb], 86 | Johan Aparicio [ctb], 87 | Richard Horsley [ctb] 88 | } 89 | -------------------------------------------------------------------------------- /man/RCBD.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_RCBD.R 3 | \name{RCBD} 4 | \alias{RCBD} 5 | \title{Generates a Randomized Complete Block Design (RCBD)} 6 | \usage{ 7 | RCBD( 8 | t = NULL, 9 | reps = NULL, 10 | l = 1, 11 | plotNumber = 101, 12 | continuous = FALSE, 13 | planter = "serpentine", 14 | seed = NULL, 15 | locationNames = NULL, 16 | data = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{t}{An integer number with total number of treatments or a vector of dimension t with labels.} 21 | 22 | \item{reps}{Number of replicates (full blocks) of each treatment.} 23 | 24 | \item{l}{Number of locations. By default \code{l = 1}.} 25 | 26 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 27 | 28 | \item{continuous}{Logical value for plot number continuous or not. By default \code{continuous = FALSE}.} 29 | 30 | \item{planter}{Option for \code{serpentine} or \code{cartesian} arrangement. By default \code{planter = 'serpentine'}.} 31 | 32 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 33 | 34 | \item{locationNames}{(optional) Names for each location.} 35 | 36 | \item{data}{(optional) Data frame with the labels of treatments.} 37 | } 38 | \value{ 39 | A list with five elements. 40 | \itemize{ 41 | \item \code{infoDesign} is a list with information on the design parameters. 42 | \item \code{layoutRandom} is the RCBD layout randomization for each location. 43 | \item \code{plotNumber} is the plot number layout for each location. 44 | \item \code{fieldBook} is a data frame with the RCBD field book design. 45 | } 46 | } 47 | \description{ 48 | It randomly generates a randomized complete block design (RCBD) across locations. 49 | } 50 | \examples{ 51 | # Example 1: Generates a RCBD design with 3 blocks and 20 treatments across 3 locations. 52 | rcbd1 <- RCBD(t = LETTERS[1:20], reps = 5, l = 3, 53 | plotNumber = c(101,1001, 2001), 54 | continuous = TRUE, 55 | planter = "serpentine", 56 | seed = 1020, 57 | locationNames = c("FARGO", "MINOT", "CASSELTON")) 58 | rcbd1$infoDesign 59 | rcbd1$layoutRandom 60 | rcbd1$plotNumber 61 | head(rcbd1$fieldBook) 62 | 63 | # Example 2: Generates a RCBD design with 6 blocks and 18 treatments in one location. 64 | # In this case, we show how to use the option data. 65 | treatments <- paste("ND-", 1:18, sep = "") 66 | treatment_list <- data.frame(list(TREATMENT = treatments)) 67 | head(treatment_list) 68 | rcbd2 <- RCBD(reps = 6, l = 1, 69 | plotNumber = 101, 70 | continuous = FALSE, 71 | planter = "serpentine", 72 | seed = 13, 73 | locationNames = "IBAGUE", 74 | data = treatment_list) 75 | rcbd2$infoDesign 76 | rcbd2$layoutRandom 77 | rcbd2$plotNumber 78 | head(rcbd2$fieldBook) 79 | 80 | 81 | } 82 | \references{ 83 | Federer, W. T. (1955). Experimental Design. Theory and Application. New York, USA. The 84 | Macmillan Company. 85 | } 86 | \author{ 87 | Didier Murillo [aut], 88 | Salvador Gezan [aut], 89 | Ana Heilman [ctb], 90 | Thomas Walk [ctb], 91 | Johan Aparicio [ctb], 92 | Richard Horsley [ctb] 93 | } 94 | -------------------------------------------------------------------------------- /data/Diagonal_240_treatments_4_checks_same_entries.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 301,A 3 | 302,B 4 | 303,C 5 | 304,D 6 | 1,ND-01 7 | 2,ND-02 8 | 3,ND-03 9 | 4,ND-04 10 | 5,ND-05 11 | 6,ND-06 12 | 7,ND-07 13 | 8,ND-08 14 | 9,ND-09 15 | 10,ND-10 16 | 11,ND-11 17 | 12,ND-12 18 | 13,ND-13 19 | 14,ND-14 20 | 15,ND-15 21 | 16,ND-16 22 | 17,ND-17 23 | 18,ND-18 24 | 19,ND-19 25 | 20,ND-20 26 | 21,ND-21 27 | 22,ND-22 28 | 23,ND-23 29 | 24,ND-24 30 | 25,ND-25 31 | 26,ND-26 32 | 27,ND-27 33 | 28,ND-28 34 | 29,ND-29 35 | 30,ND-30 36 | 31,ND-31 37 | 32,ND-32 38 | 33,ND-33 39 | 34,ND-34 40 | 35,ND-35 41 | 36,ND-36 42 | 37,ND-37 43 | 38,ND-38 44 | 39,ND-39 45 | 40,ND-40 46 | 41,ND-41 47 | 42,ND-42 48 | 43,ND-43 49 | 44,ND-44 50 | 45,ND-45 51 | 46,ND-46 52 | 47,ND-47 53 | 48,ND-48 54 | 49,ND-49 55 | 50,ND-50 56 | 51,ND-51 57 | 52,ND-52 58 | 53,ND-53 59 | 54,ND-54 60 | 55,ND-55 61 | 56,ND-56 62 | 57,ND-57 63 | 58,ND-58 64 | 59,ND-59 65 | 60,ND-60 66 | 61,ND-61 67 | 62,ND-62 68 | 63,ND-63 69 | 64,ND-64 70 | 65,ND-65 71 | 66,ND-66 72 | 67,ND-67 73 | 68,ND-68 74 | 69,ND-69 75 | 70,ND-70 76 | 71,ND-71 77 | 72,ND-72 78 | 73,ND-73 79 | 74,ND-74 80 | 75,ND-75 81 | 76,ND-76 82 | 77,ND-77 83 | 78,ND-78 84 | 79,ND-79 85 | 80,ND-80 86 | 1,ND-01 87 | 2,ND-02 88 | 3,ND-03 89 | 4,ND-04 90 | 5,ND-05 91 | 6,ND-06 92 | 7,ND-07 93 | 8,ND-08 94 | 9,ND-09 95 | 10,ND-10 96 | 11,ND-11 97 | 12,ND-12 98 | 13,ND-13 99 | 14,ND-14 100 | 15,ND-15 101 | 16,ND-16 102 | 17,ND-17 103 | 18,ND-18 104 | 19,ND-19 105 | 20,ND-20 106 | 21,ND-21 107 | 22,ND-22 108 | 23,ND-23 109 | 24,ND-24 110 | 25,ND-25 111 | 26,ND-26 112 | 27,ND-27 113 | 28,ND-28 114 | 29,ND-29 115 | 30,ND-30 116 | 31,ND-31 117 | 32,ND-32 118 | 33,ND-33 119 | 34,ND-34 120 | 35,ND-35 121 | 36,ND-36 122 | 37,ND-37 123 | 38,ND-38 124 | 39,ND-39 125 | 40,ND-40 126 | 41,ND-41 127 | 42,ND-42 128 | 43,ND-43 129 | 44,ND-44 130 | 45,ND-45 131 | 46,ND-46 132 | 47,ND-47 133 | 48,ND-48 134 | 49,ND-49 135 | 50,ND-50 136 | 51,ND-51 137 | 52,ND-52 138 | 53,ND-53 139 | 54,ND-54 140 | 55,ND-55 141 | 56,ND-56 142 | 57,ND-57 143 | 58,ND-58 144 | 59,ND-59 145 | 60,ND-60 146 | 61,ND-61 147 | 62,ND-62 148 | 63,ND-63 149 | 64,ND-64 150 | 65,ND-65 151 | 66,ND-66 152 | 67,ND-67 153 | 68,ND-68 154 | 69,ND-69 155 | 70,ND-70 156 | 71,ND-71 157 | 72,ND-72 158 | 73,ND-73 159 | 74,ND-74 160 | 75,ND-75 161 | 76,ND-76 162 | 77,ND-77 163 | 78,ND-78 164 | 79,ND-79 165 | 80,ND-80 166 | 1,ND-01 167 | 2,ND-02 168 | 3,ND-03 169 | 4,ND-04 170 | 5,ND-05 171 | 6,ND-06 172 | 7,ND-07 173 | 8,ND-08 174 | 9,ND-09 175 | 10,ND-10 176 | 11,ND-11 177 | 12,ND-12 178 | 13,ND-13 179 | 14,ND-14 180 | 15,ND-15 181 | 16,ND-16 182 | 17,ND-17 183 | 18,ND-18 184 | 19,ND-19 185 | 20,ND-20 186 | 21,ND-21 187 | 22,ND-22 188 | 23,ND-23 189 | 24,ND-24 190 | 25,ND-25 191 | 26,ND-26 192 | 27,ND-27 193 | 28,ND-28 194 | 29,ND-29 195 | 30,ND-30 196 | 31,ND-31 197 | 32,ND-32 198 | 33,ND-33 199 | 34,ND-34 200 | 35,ND-35 201 | 36,ND-36 202 | 37,ND-37 203 | 38,ND-38 204 | 39,ND-39 205 | 40,ND-40 206 | 41,ND-41 207 | 42,ND-42 208 | 43,ND-43 209 | 44,ND-44 210 | 45,ND-45 211 | 46,ND-46 212 | 47,ND-47 213 | 48,ND-48 214 | 49,ND-49 215 | 50,ND-50 216 | 51,ND-51 217 | 52,ND-52 218 | 53,ND-53 219 | 54,ND-54 220 | 55,ND-55 221 | 56,ND-56 222 | 57,ND-57 223 | 58,ND-58 224 | 59,ND-59 225 | 60,ND-60 226 | 61,ND-61 227 | 62,ND-62 228 | 63,ND-63 229 | 64,ND-64 230 | 65,ND-65 231 | 66,ND-66 232 | 67,ND-67 233 | 68,ND-68 234 | 69,ND-69 235 | 70,ND-70 236 | 71,ND-71 237 | 72,ND-72 238 | 73,ND-73 239 | 74,ND-74 240 | 75,ND-75 241 | 76,ND-76 242 | 77,ND-77 243 | 78,ND-78 244 | 79,ND-79 245 | 80,ND-80 246 | -------------------------------------------------------------------------------- /R/ibd_reorder_treatments.R: -------------------------------------------------------------------------------- 1 | #' Function to estimate the efficiencies of a IBD design 2 | #' This function is sourced from the `blocksdesign` package. 3 | #' @param TF Treatment factor levels 4 | #' @param BF Block factor levels 5 | #' @author Rodney Edmondson 6 | #' @return List containing design and A efficiencies 7 | #' @noRd 8 | blockEstEffics = function(TF, BF) { 9 | TM = qr.Q(qr(scale(stats::model.matrix(~TF))[, -1])) 10 | BM = qr.Q(qr(scale(stats::model.matrix(~BF))[, -1])) 11 | if (nlevels(TF) <= nlevels(BF)) 12 | E = eigen(diag(ncol(TM)) - tcrossprod(crossprod(TM, 13 | BM)), symmetric = TRUE, only.values = TRUE) 14 | else E = eigen(diag(ncol(BM)) - tcrossprod(crossprod(BM, 15 | TM)), symmetric = TRUE, only.values = TRUE) 16 | Deff = exp(sum(log(E$values))/ncol(TM)) 17 | if (nlevels(TF) <= nlevels(BF)) 18 | Aeff = ncol(TM)/sum(1/E$values) 19 | else Aeff = ncol(TM)/(ncol(TM) - ncol(BM) + sum(1/E$values)) 20 | return(list(Deffic = round(Deff, 7), Aeffic = round(Aeff, 21 | 7))) 22 | } 23 | 24 | #' Function to estimate the A bound and report the efficiencies of a IBD design 25 | #' This function is sourced from the `blocksdesign` package. 26 | #' @param Design The IBD design matrix 27 | #' @return Data frame of efficiencies and bounds 28 | #' @author Rodney Edmondson 29 | #' @noRd 30 | BlockEfficiencies = function(Design) { 31 | TF = Design[, ncol(Design)] 32 | regreps = table(TF) 33 | regReps = isTRUE(max(regreps) == min(regreps)) 34 | sizes = lapply(1:(ncol(Design) - 2), function(i) { 35 | table(Design[, i]) 36 | }) 37 | regBlocks = sapply(1:length(sizes), function(i) { 38 | max(sizes[[i]]) == min(sizes[[i]]) 39 | }) 40 | bounds = sapply(1:(ncol(Design) - 2), function(i) { 41 | if (regBlocks[i] & regReps) 42 | blocksdesign::A_bound(length(TF), nlevels(TF), nlevels(Design[, 43 | i])) 44 | else 1 45 | }) 46 | blocklevs = unlist(lapply(1:(ncol(Design) - 2), function(j) { 47 | nlevels(Design[, j]) 48 | })) 49 | Effics = t(sapply(1:(ncol(Design) - 2), function(i) { 50 | if (nlevels(Design[, i]) > 1) 51 | blockEstEffics(TF, Design[, i]) 52 | else list(Deffic = 1, Aeffic = 1) 53 | })) 54 | efficiencies = data.frame(1:(ncol(Design) - 2), blocklevs, 55 | as.numeric(Effics[, 1]), as.numeric(Effics[, 2]), 56 | round(bounds, 7)) 57 | colnames(efficiencies) = c("Level", "Blocks", "D-Efficiency", 58 | "A-Efficiency", "A-Bound") 59 | return(efficiencies) 60 | } 61 | 62 | #' Function to re-randomize IBD design 63 | #' 64 | #' @param ibd_design Input design from the `blocksdesign` package 65 | #' @return Modified IBD design with re-randomized treatments 66 | #' @author Didier Murillo 67 | #' @noRd 68 | rerandomize_ibd <- function(ibd_design) { 69 | mydes <- ibd_design 70 | tretments <- sort(unique(mydes$Design$treatments)) 71 | new_order <- data.frame( 72 | treatments = tretments, 73 | new_order_treatments = sample(tretments, replace = FALSE) 74 | ) 75 | 76 | newDesign <- mydes$Design |> 77 | dplyr::left_join(new_order, by = "treatments") 78 | 79 | mydes$Design_new <- newDesign |> 80 | dplyr::select(-treatments) |> 81 | dplyr::rename(treatments = new_order_treatments) 82 | 83 | mydes$Blocks_model_new <- BlockEfficiencies(mydes$Design_new) 84 | 85 | return(mydes) 86 | } 87 | -------------------------------------------------------------------------------- /tests/testthat/test_RCBD_layouts.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(FielDHub) 3 | library(dplyr) 4 | 5 | # Create an example RCBD design with 4 treatments and 3 replicates. 6 | example_design <- RCBD(t = 4, reps = 3, seed = 89076) 7 | 8 | # Use the fieldBook from the example design. 9 | NewBook <- example_design$fieldBook 10 | plots <- NewBook$PLOT 11 | n_TrtGen <- 4 12 | n_Reps <- 3 13 | planter <- "serpentine" 14 | 15 | test_that("generate_vertical_layout produces correct basic vertical layout", { 16 | layouts <- generate_vertical_layout(NewBook, plots, n_TrtGen, n_Reps, planter) 17 | 18 | # Verify that the basic vertical layout exists. 19 | expect_true("basic_vertical" %in% names(layouts)) 20 | 21 | basic_df <- layouts[["basic_vertical"]] 22 | # Check that the number of rows equals treatments x replicates. 23 | expect_equal(nrow(basic_df), n_TrtGen * n_Reps) 24 | # For basic vertical layout: 25 | # ROW should be rep(1:n_Reps, each = n_TrtGen) 26 | expect_equal(basic_df$ROW, rep(1:n_Reps, each = n_TrtGen)) 27 | # COLUMN should be rep(1:n_TrtGen, times = n_Reps) 28 | expect_equal(basic_df$COLUMN, rep(1:n_TrtGen, times = n_Reps)) 29 | }) 30 | 31 | test_that("generate_vertical_layout produces a single-column layout", { 32 | layouts <- generate_vertical_layout(NewBook, plots, n_TrtGen, n_Reps, planter) 33 | 34 | expect_true("single_column" %in% names(layouts)) 35 | single_df <- layouts[["single_column"]] 36 | # In a single-column layout, COLUMN should be 1 for all rows. 37 | expect_equal(single_df$COLUMN, rep(1, n_TrtGen * n_Reps)) 38 | }) 39 | 40 | test_that("generate_vertical_layout produces extended layouts when prime factors exist", { 41 | layouts <- generate_vertical_layout(NewBook, plots, n_TrtGen, n_Reps, planter) 42 | 43 | # For n_TrtGen = 4, numbers::primeFactors(4) may return c(2,2) (or similar), 44 | # so we expect at least one extended vertical layout. 45 | if (length(numbers::primeFactors(n_TrtGen)) >= 2) { 46 | expect_true(any(grepl("vertical_ext", names(layouts)))) 47 | # Check that the extended layout has a PLOT column computed. 48 | ext_name <- grep("vertical_ext", names(layouts), value = TRUE)[1] 49 | ext_layout <- layouts[[ext_name]] 50 | expect_true("PLOT" %in% colnames(ext_layout)) 51 | } 52 | }) 53 | 54 | test_that("generate_horizontal_layout produces correct basic horizontal layout", { 55 | layouts <- generate_horizontal_layout(NewBook, plots, n_TrtGen, n_Reps, planter) 56 | 57 | # Verify that the basic horizontal layout exists. 58 | expect_true("basic_horizontal" %in% names(layouts)) 59 | 60 | basic_df <- layouts[["basic_horizontal"]] 61 | expect_equal(nrow(basic_df), n_TrtGen * n_Reps) 62 | # For basic horizontal layout: 63 | # ROW should be rep(1:n_TrtGen, times = n_Reps) 64 | expect_equal(basic_df$ROW, rep(1:n_TrtGen, times = n_Reps)) 65 | # COLUMN should be rep(1:n_Reps, each = n_TrtGen) 66 | expect_equal(basic_df$COLUMN, rep(1:n_Reps, each = n_TrtGen)) 67 | }) 68 | 69 | test_that("generate_horizontal_layout produces extended layouts when available", { 70 | layouts <- generate_horizontal_layout(NewBook, plots, n_TrtGen, n_Reps, planter) 71 | 72 | # Check if factor-based combinations are available. 73 | factor_combos <- as.data.frame(FielDHub:::factor_subsets(n_TrtGen, all_factors = TRUE)$comb_factors) 74 | if (nrow(factor_combos) > 0) { 75 | expect_true(any(grepl("horizontal_ext", names(layouts)))) 76 | # Check that an extended horizontal layout has a computed PLOT column. 77 | ext_name <- grep("horizontal_ext", names(layouts), value = TRUE)[1] 78 | ext_layout <- layouts[[ext_name]] 79 | expect_true("PLOT" %in% colnames(ext_layout)) 80 | } 81 | }) 82 | -------------------------------------------------------------------------------- /R/utils_factor_subsets.R: -------------------------------------------------------------------------------- 1 | #' factor_subsets 2 | #' 3 | #' @description A utils function 4 | #' 5 | #' @author Matthew Seelfedt [aut] 6 | #' 7 | #' @return The return value, if any, from executing the utility. 8 | #' 9 | #' @noRd 10 | factor_subsets <- function( 11 | n, 12 | diagonal = FALSE, 13 | augmented = FALSE, 14 | all_factors = FALSE) { 15 | 16 | factors <- numbers::primeFactors(n) 17 | left <- 1 18 | right <- 1 19 | combos <- list() 20 | labels <- list() 21 | both <- list() 22 | if(length(sq(length(factors))) == 2) { 23 | if (all_factors == TRUE) { 24 | comb_factors <- matrix(data = c(1,factors, factors, 1), 25 | nrow = 2, 26 | ncol = 2, 27 | byrow = TRUE) 28 | return(list(comb_factors = comb_factors)) 29 | } else return(NULL) 30 | } else { 31 | list <- sq(length(factors))[-1,][-(nrow(sq(length(factors)))-1),] 32 | } 33 | for (i in 1:nrow(list)) { 34 | for (n in 1:length(factors)) { 35 | if (list[i,][n]==1) { 36 | left <- left*factors[n] 37 | } else { 38 | right <- right*factors[n] 39 | } 40 | } 41 | cols <- 3 42 | rows <- 3 43 | if (diagonal) { 44 | cols <- 9 45 | rows <- 4 46 | } else if (augmented) { 47 | cols <- 3 48 | rows <- 0 49 | } else if (all_factors) { 50 | cols <- 1 51 | rows <- 1 52 | } 53 | if(left > rows & right > cols) { 54 | combos[[i]] <- c(row = left, col = right) 55 | labels[[i]] <- paste(left,"x",right,sep = " ") 56 | } 57 | left <- 1 58 | right <- 1 59 | } 60 | combos <- unique(combos[!sapply(combos,is.null)]) 61 | labels <- unique(labels[!sapply(labels,is.null)]) 62 | 63 | if (all_factors) { 64 | c_factors <- labels 65 | n_labels <- length(labels) 66 | comb_factors <- matrix(data = NA, nrow = n_labels, ncol = 2) 67 | for (i in 1:n_labels) { 68 | comb_factors[i,] <- as.numeric(unlist(strsplit(c_factors[[i]], " x "))) 69 | } 70 | } else comb_factors <- NULL 71 | 72 | if (length(combos) == 0) { 73 | return(NULL) 74 | } else return(list(combos = combos, 75 | labels = labels, 76 | comb_factors = comb_factors)) 77 | } 78 | 79 | #' sq 80 | #' 81 | #' @description A utils function 82 | #' 83 | #' @return The return value, if any, from executing the utility. 84 | #' 85 | #' @noRd 86 | sq <- function (J, s = NULL) 87 | { 88 | M = NULL 89 | if (J > 0) { 90 | if (!is.null(s)) { 91 | if (s == J) 92 | M = matrix(1, 1, J) 93 | if (s > 1 & s < J) 94 | for (i in 1:(J - s + 1)) { 95 | S = sq(J - i, s - 1) 96 | if (is.null(S)) 97 | r = 0 98 | else r = dim(S)[1] 99 | M1 = cbind(matrix(0, r, i - 1), matrix(1, r, 100 | 1), S) 101 | M = rbind(M1, M) 102 | } 103 | if (s == 1) { 104 | M = matrix(0, J, J) 105 | for (j in 1:J) M[j, J - j + 1] = 1 106 | } 107 | if (s == 0) 108 | M = matrix(0, 1, J) 109 | } 110 | else { 111 | if (J == 1) { 112 | M = matrix(c(0, 1), 2, 1) 113 | } 114 | else { 115 | M1 = sq(J - 1) 116 | M = rbind(cbind(0, M1), cbind(1, M1)) 117 | } 118 | } 119 | } 120 | return(M) 121 | } -------------------------------------------------------------------------------- /man/split_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_split_plot.R 3 | \name{split_plot} 4 | \alias{split_plot} 5 | \title{Generates a Split Plot Design} 6 | \usage{ 7 | split_plot( 8 | wp = NULL, 9 | sp = NULL, 10 | reps = NULL, 11 | type = 2, 12 | l = 1, 13 | plotNumber = 101, 14 | seed = NULL, 15 | locationNames = NULL, 16 | factorLabels = TRUE, 17 | data = NULL 18 | ) 19 | } 20 | \arguments{ 21 | \item{wp}{Number of whole plots, as an integer or a vector.} 22 | 23 | \item{sp}{Number of sub plots per whole plot, as an integer or a vector.} 24 | 25 | \item{reps}{Number of blocks (full replicates).} 26 | 27 | \item{type}{Option for CRD or RCBD designs. Values are \code{type = 1} (CRD) or \code{type = 2} (RCBD). By default \code{type = 2}.} 28 | 29 | \item{l}{Number of locations. By default \code{l = 1}.} 30 | 31 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 32 | 33 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 34 | 35 | \item{locationNames}{(optional) Names for each location.} 36 | 37 | \item{factorLabels}{(optional) If \code{TRUE} retain the levels 38 | labels from the original data set otherwise, numeric labels will be 39 | assigned. Default is \code{factorLabels =TRUE}.} 40 | 41 | \item{data}{(optional) Data frame with label list of treatments.} 42 | } 43 | \value{ 44 | A list with two elements. 45 | \itemize{ 46 | \item \code{infoDesign} is a list with information on the design parameters. 47 | \item \code{fieldBook} is a data frame with the split plot field book. 48 | } 49 | } 50 | \description{ 51 | It randomly generates a split plot design (SPD) across locations. 52 | } 53 | \examples{ 54 | # Example 1: Generates a split plot design SPD with 4 whole plots, 2 sub plots per whole plot, 55 | # and 4 reps in an RCBD arrangement. This in for a single location. 56 | SPDExample1 <- split_plot(wp = 4, sp = 2, reps = 5, l = 1, 57 | plotNumber = 101, 58 | seed = 14, 59 | type = 2, 60 | locationNames = "FARGO") 61 | SPDExample1$infoDesign 62 | SPDExample1$layoutlocations 63 | head(SPDExample1$fieldBook,12) 64 | 65 | # Example 2: Generates a split plot design SPD with 5 whole plots 66 | # (4 types of fungicide + one control), 10 sub plots per whole plot (10 bean varieties), 67 | # and 6 reps in an RCBD arrangement. This in 3 locations or sites. 68 | # In this case, we show how to use the option data. 69 | wp <- c("NFung", paste("Fung", 1:4, sep = "")) # Fungicides (5 Whole plots) 70 | sp <- paste("Beans", 1:10, sep = "") # Beans varieties (10 sub plots) 71 | split_plot_Data <- data.frame(list(WHOLPLOT = c(wp, rep(NA, 5)), SUBPLOT = sp)) 72 | head(split_plot_Data, 12) 73 | SPDExample2 <- split_plot(reps = 6, l = 3, 74 | plotNumber = c(101, 1001, 2001), 75 | seed = 23, 76 | type = 2, 77 | locationNames = c("A", "B", "C"), 78 | data = split_plot_Data) 79 | SPDExample2$infoDesign 80 | SPDExample2$layoutlocations 81 | head(SPDExample2$fieldBook,12) 82 | 83 | 84 | } 85 | \references{ 86 | Federer, W. T. (1955). Experimental Design. Theory and Application. New York, USA. The 87 | Macmillan Company. 88 | } 89 | \author{ 90 | Didier Murillo [aut], 91 | Salvador Gezan [aut], 92 | Ana Heilman [ctb], 93 | Thomas Walk [ctb], 94 | Johan Aparicio [ctb], 95 | Richard Horsley [ctb] 96 | } 97 | -------------------------------------------------------------------------------- /data/Augmented_RCBD_220_Treatments.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,check-01 3 | 2,check-02 4 | 3,check-03 5 | 4,check-04 6 | 5,GYT-05 7 | 6,GYT-06 8 | 7,GYT-07 9 | 8,GYT-08 10 | 9,GYT-09 11 | 10,GYT-10 12 | 11,GYT-11 13 | 12,GYT-12 14 | 13,GYT-13 15 | 14,GYT-14 16 | 15,GYT-15 17 | 16,GYT-16 18 | 17,GYT-17 19 | 18,GYT-18 20 | 19,GYT-19 21 | 20,GYT-20 22 | 21,GYT-21 23 | 22,GYT-22 24 | 23,GYT-23 25 | 24,GYT-24 26 | 25,GYT-25 27 | 26,GYT-26 28 | 27,GYT-27 29 | 28,GYT-28 30 | 29,GYT-29 31 | 30,GYT-30 32 | 31,GYT-31 33 | 32,GYT-32 34 | 33,GYT-33 35 | 34,GYT-34 36 | 35,GYT-35 37 | 36,GYT-36 38 | 37,GYT-37 39 | 38,GYT-38 40 | 39,GYT-39 41 | 40,GYT-40 42 | 41,GYT-41 43 | 42,GYT-42 44 | 43,GYT-43 45 | 44,GYT-44 46 | 45,GYT-45 47 | 46,GYT-46 48 | 47,GYT-47 49 | 48,GYT-48 50 | 49,GYT-49 51 | 50,GYT-50 52 | 51,GYT-51 53 | 52,GYT-52 54 | 53,GYT-53 55 | 54,GYT-54 56 | 55,GYT-55 57 | 56,GYT-56 58 | 57,GYT-57 59 | 58,GYT-58 60 | 59,GYT-59 61 | 60,GYT-60 62 | 61,GYT-61 63 | 62,GYT-62 64 | 63,GYT-63 65 | 64,GYT-64 66 | 65,GYT-65 67 | 66,GYT-66 68 | 67,GYT-67 69 | 68,GYT-68 70 | 69,GYT-69 71 | 70,GYT-70 72 | 71,GYT-71 73 | 72,GYT-72 74 | 73,GYT-73 75 | 74,GYT-74 76 | 75,GYT-75 77 | 76,GYT-76 78 | 77,GYT-77 79 | 78,GYT-78 80 | 79,GYT-79 81 | 80,GYT-80 82 | 81,GYT-81 83 | 82,GYT-82 84 | 83,GYT-83 85 | 84,GYT-84 86 | 85,GYT-85 87 | 86,GYT-86 88 | 87,GYT-87 89 | 88,GYT-88 90 | 89,GYT-89 91 | 90,GYT-90 92 | 91,GYT-91 93 | 92,GYT-92 94 | 93,GYT-93 95 | 94,GYT-94 96 | 95,GYT-95 97 | 96,GYT-96 98 | 97,GYT-97 99 | 98,GYT-98 100 | 99,GYT-99 101 | 100,GYT-100 102 | 101,GYT-101 103 | 102,GYT-102 104 | 103,GYT-103 105 | 104,GYT-104 106 | 105,GYT-105 107 | 106,GYT-106 108 | 107,GYT-107 109 | 108,GYT-108 110 | 109,GYT-109 111 | 110,GYT-110 112 | 111,GYT-111 113 | 112,GYT-112 114 | 113,GYT-113 115 | 114,GYT-114 116 | 115,GYT-115 117 | 116,GYT-116 118 | 117,GYT-117 119 | 118,GYT-118 120 | 119,GYT-119 121 | 120,GYT-120 122 | 121,GYT-121 123 | 122,GYT-122 124 | 123,GYT-123 125 | 124,GYT-124 126 | 125,GYT-125 127 | 126,GYT-126 128 | 127,GYT-127 129 | 128,GYT-128 130 | 129,GYT-129 131 | 130,GYT-130 132 | 131,GYT-131 133 | 132,GYT-132 134 | 133,GYT-133 135 | 134,GYT-134 136 | 135,GYT-135 137 | 136,GYT-136 138 | 137,GYT-137 139 | 138,GYT-138 140 | 139,GYT-139 141 | 140,GYT-140 142 | 141,GYT-141 143 | 142,GYT-142 144 | 143,GYT-143 145 | 144,GYT-144 146 | 145,GYT-145 147 | 146,GYT-146 148 | 147,GYT-147 149 | 148,GYT-148 150 | 149,GYT-149 151 | 150,GYT-150 152 | 151,GYT-151 153 | 152,GYT-152 154 | 153,GYT-153 155 | 154,GYT-154 156 | 155,GYT-155 157 | 156,GYT-156 158 | 157,GYT-157 159 | 158,GYT-158 160 | 159,GYT-159 161 | 160,GYT-160 162 | 161,GYT-161 163 | 162,GYT-162 164 | 163,GYT-163 165 | 164,GYT-164 166 | 165,GYT-165 167 | 166,GYT-166 168 | 167,GYT-167 169 | 168,GYT-168 170 | 169,GYT-169 171 | 170,GYT-170 172 | 171,GYT-171 173 | 172,GYT-172 174 | 173,GYT-173 175 | 174,GYT-174 176 | 175,GYT-175 177 | 176,GYT-176 178 | 177,GYT-177 179 | 178,GYT-178 180 | 179,GYT-179 181 | 180,GYT-180 182 | 181,GYT-181 183 | 182,GYT-182 184 | 183,GYT-183 185 | 184,GYT-184 186 | 185,GYT-185 187 | 186,GYT-186 188 | 187,GYT-187 189 | 188,GYT-188 190 | 189,GYT-189 191 | 190,GYT-190 192 | 191,GYT-191 193 | 192,GYT-192 194 | 193,GYT-193 195 | 194,GYT-194 196 | 195,GYT-195 197 | 196,GYT-196 198 | 197,GYT-197 199 | 198,GYT-198 200 | 199,GYT-199 201 | 200,GYT-200 202 | 201,GYT-201 203 | 202,GYT-202 204 | 203,GYT-203 205 | 204,GYT-204 206 | 205,GYT-205 207 | 206,GYT-206 208 | 207,GYT-207 209 | 208,GYT-208 210 | 209,GYT-209 211 | 210,GYT-210 212 | 211,GYT-211 213 | 212,GYT-212 214 | 213,GYT-213 215 | 214,GYT-214 216 | 215,GYT-215 217 | 216,GYT-216 218 | 217,GYT-217 219 | 218,GYT-218 220 | 219,GYT-219 221 | 220,GYT-220 222 | -------------------------------------------------------------------------------- /data/Bad_format_duplicated_entries.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,check-01 3 | 2,check-02 4 | 3,check-03 5 | 4,check-03 6 | 5,GYT-05 7 | 5,GYT-06 8 | 7,GYT-07 9 | 8,GYT-08 10 | 9,GYT-09 11 | 10,GYT-10 12 | 11,GYT-11 13 | 12,GYT-12 14 | 13,GYT-13 15 | 14,GYT-14 16 | 15,GYT-15 17 | 16,GYT-16 18 | 17,GYT-17 19 | 18,GYT-18 20 | 19,GYT-19 21 | 20,GYT-20 22 | 21,GYT-21 23 | 22,GYT-22 24 | 23,GYT-23 25 | 24,GYT-24 26 | 25,GYT-25 27 | 26,GYT-26 28 | 27,GYT-27 29 | 28,GYT-28 30 | 29,GYT-29 31 | 30,GYT-30 32 | 31,GYT-31 33 | 32,GYT-32 34 | 33,GYT-33 35 | 34,GYT-34 36 | 35,GYT-35 37 | 36,GYT-36 38 | 37,GYT-37 39 | 38,GYT-38 40 | 39,GYT-39 41 | 40,GYT-40 42 | 41,GYT-41 43 | 42,GYT-42 44 | 43,GYT-43 45 | 44,GYT-44 46 | 45,GYT-45 47 | 46,GYT-46 48 | 47,GYT-47 49 | 48,GYT-48 50 | 49,GYT-49 51 | 50,GYT-50 52 | 51,GYT-51 53 | 52,GYT-52 54 | 53,GYT-53 55 | 54,GYT-54 56 | 55,GYT-55 57 | 56,GYT-56 58 | 57,GYT-57 59 | 58,GYT-58 60 | 59,GYT-59 61 | 60,GYT-60 62 | 61,GYT-61 63 | 62,GYT-62 64 | 63,GYT-63 65 | 64,GYT-64 66 | 65,GYT-65 67 | 66,GYT-66 68 | 67,GYT-67 69 | 68,GYT-68 70 | 69,GYT-69 71 | 70,GYT-70 72 | 71,GYT-71 73 | 72,GYT-72 74 | 73,GYT-73 75 | 74,GYT-74 76 | 75,GYT-75 77 | 76,GYT-76 78 | 77,GYT-77 79 | 78,GYT-78 80 | 79,GYT-79 81 | 80,GYT-80 82 | 81,GYT-81 83 | 82,GYT-82 84 | 83,GYT-83 85 | 84,GYT-84 86 | 85,GYT-85 87 | 86,GYT-86 88 | 87,GYT-87 89 | 88,GYT-88 90 | 89,GYT-89 91 | 90,GYT-90 92 | 91,GYT-91 93 | 92,GYT-92 94 | 93,GYT-93 95 | 94,GYT-94 96 | 95,GYT-95 97 | 96,GYT-96 98 | 97,GYT-97 99 | 98,GYT-98 100 | 99,GYT-99 101 | 100,GYT-100 102 | 101,GYT-101 103 | 102,GYT-102 104 | 103,GYT-103 105 | 104,GYT-104 106 | 105,GYT-105 107 | 106,GYT-106 108 | 107,GYT-107 109 | 108,GYT-108 110 | 109,GYT-109 111 | 110,GYT-110 112 | 111,GYT-111 113 | 112,GYT-112 114 | 113,GYT-113 115 | 114,GYT-114 116 | 115,GYT-115 117 | 116,GYT-116 118 | 117,GYT-117 119 | 118,GYT-118 120 | 119,GYT-119 121 | 120,GYT-120 122 | 121,GYT-121 123 | 122,GYT-122 124 | 123,GYT-123 125 | 124,GYT-124 126 | 125,GYT-125 127 | 126,GYT-126 128 | 127,GYT-127 129 | 128,GYT-128 130 | 129,GYT-129 131 | 130,GYT-130 132 | 131,GYT-131 133 | 132,GYT-132 134 | 133,GYT-133 135 | 134,GYT-134 136 | 135,GYT-135 137 | 136,GYT-136 138 | 137,GYT-137 139 | 138,GYT-138 140 | 139,GYT-139 141 | 140,GYT-140 142 | 141,GYT-141 143 | 142,GYT-142 144 | 143,GYT-143 145 | 144,GYT-144 146 | 145,GYT-145 147 | 146,GYT-146 148 | 147,GYT-147 149 | 148,GYT-148 150 | 149,GYT-149 151 | 150,GYT-150 152 | 151,GYT-151 153 | 152,GYT-152 154 | 153,GYT-153 155 | 154,GYT-154 156 | 155,GYT-155 157 | 156,GYT-156 158 | 157,GYT-157 159 | 158,GYT-158 160 | 159,GYT-159 161 | 160,GYT-160 162 | 161,GYT-161 163 | 162,GYT-162 164 | 163,GYT-163 165 | 164,GYT-164 166 | 165,GYT-165 167 | 166,GYT-166 168 | 167,GYT-167 169 | 168,GYT-168 170 | 169,GYT-169 171 | 170,GYT-170 172 | 171,GYT-171 173 | 172,GYT-172 174 | 173,GYT-173 175 | 174,GYT-174 176 | 175,GYT-175 177 | 176,GYT-176 178 | 177,GYT-177 179 | 178,GYT-178 180 | 179,GYT-179 181 | 180,GYT-180 182 | 181,GYT-181 183 | 182,GYT-182 184 | 183,GYT-183 185 | 184,GYT-184 186 | 185,GYT-185 187 | 186,GYT-186 188 | 187,GYT-187 189 | 188,GYT-188 190 | 189,GYT-189 191 | 190,GYT-190 192 | 191,GYT-191 193 | 192,GYT-192 194 | 193,GYT-193 195 | 194,GYT-194 196 | 195,GYT-195 197 | 196,GYT-196 198 | 197,GYT-197 199 | 198,GYT-198 200 | 199,GYT-199 201 | 200,GYT-200 202 | 201,GYT-201 203 | 202,GYT-202 204 | 203,GYT-203 205 | 204,GYT-204 206 | 205,GYT-205 207 | 206,GYT-206 208 | 207,GYT-207 209 | 208,GYT-208 210 | 209,GYT-209 211 | 210,GYT-210 212 | 211,GYT-211 213 | 212,GYT-212 214 | 213,GYT-213 215 | 214,GYT-214 216 | 215,GYT-215 217 | 216,GYT-216 218 | 217,GYT-217 219 | 218,GYT-218 220 | 219,GYT-219 221 | 220,GYT-220 222 | -------------------------------------------------------------------------------- /inst/app/www/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Shiny design of experiments (DOE) app 11 | 12 | 13 |
14 |
15 |
16 |

 Welcome to FielDHub 

17 |
18 |
19 |
20 |
21 |
22 |
23 |

About the App

24 |

FielD·Hub is an R Shiny design of experiments (DOE) app created by 25 | the NDSU Big Data Pipeline team that aids in the 26 | creation of traditional and non-traditional augmented experiment designs, 27 | including spatial trials with checks assigned to plots in a diagonal 28 | arrangement across the field. Users of FielD·Hub are guided through an 29 | interactive DOE platform that generates randomizations of field, laboratory, 30 | and greenhouse experiments. Outputs from FielD·Hub include interactive field maps, 31 | tables, and field books that can be extracted and saved. 32 |

33 | A novel feature of FielD·Hub is an option that generates simulated data for a response variable along with the randomization. This feature makes FielD·Hub suitable for classroom teaching purposes, where instructors can either use the graphical dynamic user interface and/or use the formulas included in the R package for teaching R scripting courses. 34 |

37 | 38 |
39 |
40 | 41 |
42 |
43 | 44 |

Easy to Use

45 |

Users are guided in each step of the DOE platform in a reactive interface.

46 |
47 |
48 | 49 |

Teaching

50 |

The app provides suitable features for classroom teaching purposes.

51 |
52 |
53 | 54 |

Novel App

55 |

FielDHub offers DOE and features not currently available in most apps.

56 |
57 |
58 |
59 | 62 | 63 | -------------------------------------------------------------------------------- /data/Optim_1_15x16.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME,REPS 2 | 1,A,8 3 | 2,B,8 4 | 3,C,8 5 | 4,D,8 6 | 5,ND-05,1 7 | 6,ND-06,1 8 | 7,ND-07,1 9 | 8,ND-08,1 10 | 9,ND-09,1 11 | 10,ND-10,1 12 | 11,ND-11,1 13 | 12,ND-12,1 14 | 13,ND-13,1 15 | 14,ND-14,1 16 | 15,ND-15,1 17 | 16,ND-16,1 18 | 17,ND-17,1 19 | 18,ND-18,1 20 | 19,ND-19,1 21 | 20,ND-20,1 22 | 21,ND-21,1 23 | 22,ND-22,1 24 | 23,ND-23,1 25 | 24,ND-24,1 26 | 25,ND-25,1 27 | 26,ND-26,1 28 | 27,ND-27,1 29 | 28,ND-28,1 30 | 29,ND-29,1 31 | 30,ND-30,1 32 | 31,ND-31,1 33 | 32,ND-32,1 34 | 33,ND-33,1 35 | 34,ND-34,1 36 | 35,ND-35,1 37 | 36,ND-36,1 38 | 37,ND-37,1 39 | 38,ND-38,1 40 | 39,ND-39,1 41 | 40,ND-40,1 42 | 41,ND-41,1 43 | 42,ND-42,1 44 | 43,ND-43,1 45 | 44,ND-44,1 46 | 45,ND-45,1 47 | 46,ND-46,1 48 | 47,ND-47,1 49 | 48,ND-48,1 50 | 49,ND-49,1 51 | 50,ND-50,1 52 | 51,ND-51,1 53 | 52,ND-52,1 54 | 53,ND-53,1 55 | 54,ND-54,1 56 | 55,ND-55,1 57 | 56,ND-56,1 58 | 57,ND-57,1 59 | 58,ND-58,1 60 | 59,ND-59,1 61 | 60,ND-60,1 62 | 61,ND-61,1 63 | 62,ND-62,1 64 | 63,ND-63,1 65 | 64,ND-64,1 66 | 65,ND-65,1 67 | 66,ND-66,1 68 | 67,ND-67,1 69 | 68,ND-68,1 70 | 69,ND-69,1 71 | 70,ND-70,1 72 | 71,ND-71,1 73 | 72,ND-72,1 74 | 73,ND-73,1 75 | 74,ND-74,1 76 | 75,ND-75,1 77 | 76,ND-76,1 78 | 77,ND-77,1 79 | 78,ND-78,1 80 | 79,ND-79,1 81 | 80,ND-80,1 82 | 81,ND-81,1 83 | 82,ND-82,1 84 | 83,ND-83,1 85 | 84,ND-84,1 86 | 85,ND-85,1 87 | 86,ND-86,1 88 | 87,ND-87,1 89 | 88,ND-88,1 90 | 89,ND-89,1 91 | 90,ND-90,1 92 | 91,ND-91,1 93 | 92,ND-92,1 94 | 93,ND-93,1 95 | 94,ND-94,1 96 | 95,ND-95,1 97 | 96,ND-96,1 98 | 97,ND-97,1 99 | 98,ND-98,1 100 | 99,ND-99,1 101 | 100,ND-100,1 102 | 101,ND-101,1 103 | 102,ND-102,1 104 | 103,ND-103,1 105 | 104,ND-104,1 106 | 105,ND-105,1 107 | 106,ND-106,1 108 | 107,ND-107,1 109 | 108,ND-108,1 110 | 109,ND-109,1 111 | 110,ND-110,1 112 | 111,ND-111,1 113 | 112,ND-112,1 114 | 113,ND-113,1 115 | 114,ND-114,1 116 | 115,ND-115,1 117 | 116,ND-116,1 118 | 117,ND-117,1 119 | 118,ND-118,1 120 | 119,ND-119,1 121 | 120,ND-120,1 122 | 121,ND-121,1 123 | 122,ND-122,1 124 | 123,ND-123,1 125 | 124,ND-124,1 126 | 125,ND-125,1 127 | 126,ND-126,1 128 | 127,ND-127,1 129 | 128,ND-128,1 130 | 129,ND-129,1 131 | 130,ND-130,1 132 | 131,ND-131,1 133 | 132,ND-132,1 134 | 133,ND-133,1 135 | 134,ND-134,1 136 | 135,ND-135,1 137 | 136,ND-136,1 138 | 137,ND-137,1 139 | 138,ND-138,1 140 | 139,ND-139,1 141 | 140,ND-140,1 142 | 141,ND-141,1 143 | 142,ND-142,1 144 | 143,ND-143,1 145 | 144,ND-144,1 146 | 145,ND-145,1 147 | 146,ND-146,1 148 | 147,ND-147,1 149 | 148,ND-148,1 150 | 149,ND-149,1 151 | 150,ND-150,1 152 | 151,ND-151,1 153 | 152,ND-152,1 154 | 153,ND-153,1 155 | 154,ND-154,1 156 | 155,ND-155,1 157 | 156,ND-156,1 158 | 157,ND-157,1 159 | 158,ND-158,1 160 | 159,ND-159,1 161 | 160,ND-160,1 162 | 161,ND-161,1 163 | 162,ND-162,1 164 | 163,ND-163,1 165 | 164,ND-164,1 166 | 165,ND-165,1 167 | 166,ND-166,1 168 | 167,ND-167,1 169 | 168,ND-168,1 170 | 169,ND-169,1 171 | 170,ND-170,1 172 | 171,ND-171,1 173 | 172,ND-172,1 174 | 173,ND-173,1 175 | 174,ND-174,1 176 | 175,ND-175,1 177 | 176,ND-176,1 178 | 177,ND-177,1 179 | 178,ND-178,1 180 | 179,ND-179,1 181 | 180,ND-180,1 182 | 181,ND-181,1 183 | 182,ND-182,1 184 | 183,ND-183,1 185 | 184,ND-184,1 186 | 185,ND-185,1 187 | 186,ND-186,1 188 | 187,ND-187,1 189 | 188,ND-188,1 190 | 189,ND-189,1 191 | 190,ND-190,1 192 | 191,ND-191,1 193 | 192,ND-192,1 194 | 193,ND-193,1 195 | 194,ND-194,1 196 | 195,ND-195,1 197 | 196,ND-196,1 198 | 197,ND-197,1 199 | 198,ND-198,1 200 | 199,ND-199,1 201 | 200,ND-200,1 202 | 201,ND-201,1 203 | 202,ND-202,1 204 | 203,ND-203,1 205 | 204,ND-204,1 206 | 205,ND-205,1 207 | 206,ND-206,1 208 | 207,ND-207,1 209 | 208,ND-208,1 210 | 209,ND-209,1 211 | 210,ND-210,1 212 | 211,ND-211,1 213 | 212,ND-212,1 214 | -------------------------------------------------------------------------------- /data/Diagonal_Single_14x20.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,A 3 | 2,B 4 | 3,C 5 | 4,D 6 | 5,ND-05 7 | 6,ND-06 8 | 7,ND-07 9 | 8,ND-08 10 | 9,ND-09 11 | 10,ND-10 12 | 11,ND-11 13 | 12,ND-12 14 | 13,ND-13 15 | 14,ND-14 16 | 15,ND-15 17 | 16,ND-16 18 | 17,ND-17 19 | 18,ND-18 20 | 19,ND-19 21 | 20,ND-20 22 | 21,ND-21 23 | 22,ND-22 24 | 23,ND-23 25 | 24,ND-24 26 | 25,ND-25 27 | 26,ND-26 28 | 27,ND-27 29 | 28,ND-28 30 | 29,ND-29 31 | 30,ND-30 32 | 31,ND-31 33 | 32,ND-32 34 | 33,ND-33 35 | 34,ND-34 36 | 35,ND-35 37 | 36,ND-36 38 | 37,ND-37 39 | 38,ND-38 40 | 39,ND-39 41 | 40,ND-40 42 | 41,ND-41 43 | 42,ND-42 44 | 43,ND-43 45 | 44,ND-44 46 | 45,ND-45 47 | 46,ND-46 48 | 47,ND-47 49 | 48,ND-48 50 | 49,ND-49 51 | 50,ND-50 52 | 51,ND-51 53 | 52,ND-52 54 | 53,ND-53 55 | 54,ND-54 56 | 55,ND-55 57 | 56,ND-56 58 | 57,ND-57 59 | 58,ND-58 60 | 59,ND-59 61 | 60,ND-60 62 | 61,ND-61 63 | 62,ND-62 64 | 63,ND-63 65 | 64,ND-64 66 | 65,ND-65 67 | 66,ND-66 68 | 67,ND-67 69 | 68,ND-68 70 | 69,ND-69 71 | 70,ND-70 72 | 71,ND-71 73 | 72,ND-72 74 | 73,ND-73 75 | 74,ND-74 76 | 75,ND-75 77 | 76,ND-76 78 | 77,ND-77 79 | 78,ND-78 80 | 79,ND-79 81 | 80,ND-80 82 | 81,ND-81 83 | 82,ND-82 84 | 83,ND-83 85 | 84,ND-84 86 | 85,ND-85 87 | 86,ND-86 88 | 87,ND-87 89 | 88,ND-88 90 | 89,ND-89 91 | 90,ND-90 92 | 91,ND-91 93 | 92,ND-92 94 | 93,ND-93 95 | 94,ND-94 96 | 95,ND-95 97 | 96,ND-96 98 | 97,ND-97 99 | 98,ND-98 100 | 99,ND-99 101 | 100,ND-100 102 | 101,ND-101 103 | 102,ND-102 104 | 103,ND-103 105 | 104,ND-104 106 | 105,ND-105 107 | 106,ND-106 108 | 107,ND-107 109 | 108,ND-108 110 | 109,ND-109 111 | 110,ND-110 112 | 111,ND-111 113 | 112,ND-112 114 | 113,ND-113 115 | 114,ND-114 116 | 115,ND-115 117 | 116,ND-116 118 | 117,ND-117 119 | 118,ND-118 120 | 119,ND-119 121 | 120,ND-120 122 | 121,ND-121 123 | 122,ND-122 124 | 123,ND-123 125 | 124,ND-124 126 | 125,ND-125 127 | 126,ND-126 128 | 127,ND-127 129 | 128,ND-128 130 | 129,ND-129 131 | 130,ND-130 132 | 131,ND-131 133 | 132,ND-132 134 | 133,ND-133 135 | 134,ND-134 136 | 135,ND-135 137 | 136,ND-136 138 | 137,ND-137 139 | 138,ND-138 140 | 139,ND-139 141 | 140,ND-140 142 | 141,ND-141 143 | 142,ND-142 144 | 143,ND-143 145 | 144,ND-144 146 | 145,ND-145 147 | 146,ND-146 148 | 147,ND-147 149 | 148,ND-148 150 | 149,ND-149 151 | 150,ND-150 152 | 151,ND-151 153 | 152,ND-152 154 | 153,ND-153 155 | 154,ND-154 156 | 155,ND-155 157 | 156,ND-156 158 | 157,ND-157 159 | 158,ND-158 160 | 159,ND-159 161 | 160,ND-160 162 | 161,ND-161 163 | 162,ND-162 164 | 163,ND-163 165 | 164,ND-164 166 | 165,ND-165 167 | 166,ND-166 168 | 167,ND-167 169 | 168,ND-168 170 | 169,ND-169 171 | 170,ND-170 172 | 171,ND-171 173 | 172,ND-172 174 | 173,ND-173 175 | 174,ND-174 176 | 175,ND-175 177 | 176,ND-176 178 | 177,ND-177 179 | 178,ND-178 180 | 179,ND-179 181 | 180,ND-180 182 | 181,ND-181 183 | 182,ND-182 184 | 183,ND-183 185 | 184,ND-184 186 | 185,ND-185 187 | 186,ND-186 188 | 187,ND-187 189 | 188,ND-188 190 | 189,ND-189 191 | 190,ND-190 192 | 191,ND-191 193 | 192,ND-192 194 | 193,ND-193 195 | 194,ND-194 196 | 195,ND-195 197 | 196,ND-196 198 | 197,ND-197 199 | 198,ND-198 200 | 199,ND-199 201 | 200,ND-200 202 | 201,ND-201 203 | 202,ND-202 204 | 203,ND-203 205 | 204,ND-204 206 | 205,ND-205 207 | 206,ND-206 208 | 207,ND-207 209 | 208,ND-208 210 | 209,ND-209 211 | 210,ND-210 212 | 211,ND-211 213 | 212,ND-212 214 | 213,ND-213 215 | 214,ND-214 216 | 215,ND-215 217 | 216,ND-216 218 | 217,ND-217 219 | 218,ND-218 220 | 219,ND-219 221 | 220,ND-220 222 | 221,ND-221 223 | 222,ND-222 224 | 223,ND-223 225 | 224,ND-224 226 | 225,ND-225 227 | 226,ND-226 228 | 227,ND-227 229 | 228,ND-228 230 | 229,ND-229 231 | 230,ND-230 232 | 231,ND-231 233 | 232,ND-232 234 | 233,ND-233 235 | 234,ND-234 236 | 235,ND-235 237 | 236,ND-236 238 | 237,ND-237 239 | 238,ND-238 240 | 239,ND-239 241 | 240,ND-240 242 | 241,ND-241 243 | 242,ND-242 244 | 243,ND-243 245 | 244,ND-244 246 | -------------------------------------------------------------------------------- /data/pREPS_1_16x20.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME,REPS 2 | 1,ND-01,2 3 | 2,ND-02,2 4 | 3,ND-03,2 5 | 4,ND-04,2 6 | 5,ND-05,2 7 | 6,ND-06,2 8 | 7,ND-07,2 9 | 8,ND-08,2 10 | 9,ND-09,2 11 | 10,ND-10,2 12 | 11,ND-11,2 13 | 12,ND-12,2 14 | 13,ND-13,2 15 | 14,ND-14,2 16 | 15,ND-15,2 17 | 16,ND-16,2 18 | 17,ND-17,2 19 | 18,ND-18,2 20 | 19,ND-19,2 21 | 20,ND-20,2 22 | 21,ND-21,2 23 | 22,ND-22,2 24 | 23,ND-23,2 25 | 24,ND-24,2 26 | 25,ND-25,2 27 | 26,ND-26,2 28 | 27,ND-27,2 29 | 28,ND-28,2 30 | 29,ND-29,2 31 | 30,ND-30,2 32 | 31,ND-31,2 33 | 32,ND-32,2 34 | 33,ND-33,2 35 | 34,ND-34,2 36 | 35,ND-35,2 37 | 36,ND-36,2 38 | 37,ND-37,2 39 | 38,ND-38,2 40 | 39,ND-39,2 41 | 40,ND-40,2 42 | 41,ND-41,2 43 | 42,ND-42,2 44 | 43,ND-43,2 45 | 44,ND-44,2 46 | 45,ND-45,2 47 | 46,ND-46,2 48 | 47,ND-47,2 49 | 48,ND-48,2 50 | 49,ND-49,2 51 | 50,ND-50,2 52 | 51,ND-51,2 53 | 52,ND-52,2 54 | 53,ND-53,2 55 | 54,ND-54,2 56 | 55,ND-55,2 57 | 56,ND-56,2 58 | 57,ND-57,2 59 | 58,ND-58,2 60 | 59,ND-59,2 61 | 60,ND-60,2 62 | 61,ND-61,2 63 | 62,ND-62,2 64 | 63,ND-63,2 65 | 64,ND-64,2 66 | 65,ND-65,2 67 | 66,ND-66,2 68 | 67,ND-67,2 69 | 68,ND-68,2 70 | 69,ND-69,2 71 | 70,ND-70,2 72 | 71,ND-71,2 73 | 72,ND-72,2 74 | 73,ND-73,2 75 | 74,ND-74,2 76 | 75,ND-75,2 77 | 76,ND-76,2 78 | 77,ND-77,2 79 | 78,ND-78,2 80 | 79,ND-79,2 81 | 80,ND-80,2 82 | 81,ND-81,2 83 | 82,ND-82,2 84 | 83,ND-83,2 85 | 84,ND-84,2 86 | 85,ND-85,2 87 | 86,ND-86,2 88 | 87,ND-87,2 89 | 88,ND-88,2 90 | 89,ND-89,2 91 | 90,ND-90,2 92 | 91,ND-91,2 93 | 92,ND-92,2 94 | 93,ND-93,2 95 | 94,ND-94,2 96 | 95,ND-95,2 97 | 96,ND-96,2 98 | 97,ND-97,2 99 | 98,ND-98,2 100 | 99,ND-99,2 101 | 100,ND-100,2 102 | 101,ND-101,1 103 | 102,ND-102,1 104 | 103,ND-103,1 105 | 104,ND-104,1 106 | 105,ND-105,1 107 | 106,ND-106,1 108 | 107,ND-107,1 109 | 108,ND-108,1 110 | 109,ND-109,1 111 | 110,ND-110,1 112 | 111,ND-111,1 113 | 112,ND-112,1 114 | 113,ND-113,1 115 | 114,ND-114,1 116 | 115,ND-115,1 117 | 116,ND-116,1 118 | 117,ND-117,1 119 | 118,ND-118,1 120 | 119,ND-119,1 121 | 120,ND-120,1 122 | 121,ND-121,1 123 | 122,ND-122,1 124 | 123,ND-123,1 125 | 124,ND-124,1 126 | 125,ND-125,1 127 | 126,ND-126,1 128 | 127,ND-127,1 129 | 128,ND-128,1 130 | 129,ND-129,1 131 | 130,ND-130,1 132 | 131,ND-131,1 133 | 132,ND-132,1 134 | 133,ND-133,1 135 | 134,ND-134,1 136 | 135,ND-135,1 137 | 136,ND-136,1 138 | 137,ND-137,1 139 | 138,ND-138,1 140 | 139,ND-139,1 141 | 140,ND-140,1 142 | 141,ND-141,1 143 | 142,ND-142,1 144 | 143,ND-143,1 145 | 144,ND-144,1 146 | 145,ND-145,1 147 | 146,ND-146,1 148 | 147,ND-147,1 149 | 148,ND-148,1 150 | 149,ND-149,1 151 | 150,ND-150,1 152 | 151,ND-151,1 153 | 152,ND-152,1 154 | 153,ND-153,1 155 | 154,ND-154,1 156 | 155,ND-155,1 157 | 156,ND-156,1 158 | 157,ND-157,1 159 | 158,ND-158,1 160 | 159,ND-159,1 161 | 160,ND-160,1 162 | 161,ND-161,1 163 | 162,ND-162,1 164 | 163,ND-163,1 165 | 164,ND-164,1 166 | 165,ND-165,1 167 | 166,ND-166,1 168 | 167,ND-167,1 169 | 168,ND-168,1 170 | 169,ND-169,1 171 | 170,ND-170,1 172 | 171,ND-171,1 173 | 172,ND-172,1 174 | 173,ND-173,1 175 | 174,ND-174,1 176 | 175,ND-175,1 177 | 176,ND-176,1 178 | 177,ND-177,1 179 | 178,ND-178,1 180 | 179,ND-179,1 181 | 180,ND-180,1 182 | 181,ND-181,1 183 | 182,ND-182,1 184 | 183,ND-183,1 185 | 184,ND-184,1 186 | 185,ND-185,1 187 | 186,ND-186,1 188 | 187,ND-187,1 189 | 188,ND-188,1 190 | 189,ND-189,1 191 | 190,ND-190,1 192 | 191,ND-191,1 193 | 192,ND-192,1 194 | 193,ND-193,1 195 | 194,ND-194,1 196 | 195,ND-195,1 197 | 196,ND-196,1 198 | 197,ND-197,1 199 | 198,ND-198,1 200 | 199,ND-199,1 201 | 200,ND-200,1 202 | 201,ND-201,1 203 | 202,ND-202,1 204 | 203,ND-203,1 205 | 204,ND-204,1 206 | 205,ND-205,1 207 | 206,ND-206,1 208 | 207,ND-207,1 209 | 208,ND-208,1 210 | 209,ND-209,1 211 | 210,ND-210,1 212 | 211,ND-211,1 213 | 212,ND-212,1 214 | 213,ND-213,1 215 | 214,ND-214,1 216 | 215,ND-215,1 217 | 216,ND-216,1 218 | 217,ND-217,1 219 | 218,ND-218,1 220 | 219,ND-219,1 221 | 220,ND-220,1 222 | -------------------------------------------------------------------------------- /vignettes/news/fieldhub-0-1-0.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = NA, 11 | out.width = "100%" 12 | ) 13 | ``` 14 | 15 | ### FielDHub 0.1.0 16 | 17 | 18 | Photo by Karsten Würth on Unsplash 19 | 20 | 21 | ##### 2021/05/17 22 | ##### [FielDHub](https://github.com/DidierMurilloF/FielDHub) 23 | ##### Didier Murillo 24 | 25 | I am delighted to announce the initial release of FielDHub to CRAN! FielDHub is conceived to make it quick and easy to generate, randomize, and plot complex and standard experimental designs. This initial release is version 0.1.0 in recognition that FielDHub has been in development for more than one year and has already been used for researchers at NDSU, CIAT, as well as for teaching. 26 | 27 | Install FielDHub with: 28 | 29 | ```{r, eval=FALSE} 30 | install.packages("FielDHub") 31 | ``` 32 | 33 | #### Usage 34 | 35 | Get started using only two simple lines of code: 36 | 37 | ```{r, eval=FALSE} 38 | library(FielDHub) 39 | run_app() 40 | ``` 41 | 42 | #### Relevant Features 43 | 44 | Unreplicated and partially replicated designs are commonly used in plant breeding and forestry but with a lack of free tools available to researchers to make that randomization. 45 | 46 | * FielDHub provides an easy way to complete designs by using the app or through the standalone functions such as `diagonal_arrangement()`, `optimized_arrangement()` and `RCBD_augmented()`. 47 | 48 | * Partially replicated design can be done using the function `partially_replicated()`. 49 | 50 | * The app provides novel features to make the randomization along with the field layout or map. 51 | 52 | * FielDHub's features such as generating synthetic data along with randomization, as well as plotting field layouts make the app suitable to teach statistic courses such as experimental design. 53 | 54 | #### Acknowledgements 55 | 56 | FielDHub has been a long time coming, and it wouldn’t have been possible without a devoted community of users, many of whom have gone on to contribute fixes and new ideas. I would like to particularly thank **Dr. Richard Horsley** (Professor, Department Head & Barley Breeder at Department of Plant Sciences) who sponsored the development of this project. Also, a big thanks go out to **Dr. Ana María Heilman** and **Dr. Andrew Green** for all the support in the plant breeding/biological background. This project could not be the same without all the contributions and knowledge of **Dr. Salvador Gezan**. He came to the project at a critical moment and with his ideas and code, we went beyond what was expected. Thank you to **Johan Aparicio** and **Thomas Walk** for all the contributions to FielDHub. 57 | 58 | FielDHub was submitted and published in The Journal of Open Source Software. The peer review process was done by [Thiago de Paula Oliveira](https://github.com/Prof-ThiagoOliveira) (Reviewer), [David LeBauer](https://github.com/dlebauer) (Reviewer), and [Charlotte Soneson](https://github.com/csoneson) (Editor). Thank you to all of you for your work, effort, and contributions. 59 | 60 | 61 | -------------------------------------------------------------------------------- /man/full_factorial.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_full_factorial.R 3 | \name{full_factorial} 4 | \alias{full_factorial} 5 | \title{Generates a Full Factorial Design} 6 | \usage{ 7 | full_factorial( 8 | setfactors = NULL, 9 | reps = NULL, 10 | l = 1, 11 | type = 2, 12 | plotNumber = 101, 13 | continuous = FALSE, 14 | planter = "serpentine", 15 | seed = NULL, 16 | locationNames = NULL, 17 | factorLabels = TRUE, 18 | data = NULL 19 | ) 20 | } 21 | \arguments{ 22 | \item{setfactors}{Numeric vector with levels of each factor.} 23 | 24 | \item{reps}{Number of replicates (full blocks).} 25 | 26 | \item{l}{Number of locations. By default \code{l = 1}.} 27 | 28 | \item{type}{Option for CRD or RCBD designs. Values are \code{type = 29 | 1} (CRD) or \code{type = 2} (RCBD). By default \code{type = 2}.} 30 | 31 | \item{plotNumber}{Numeric vector with the starting plot number for 32 | each location. By default \code{plotNumber = 101}.} 33 | 34 | \item{continuous}{Logical for plot number continuous or not. By 35 | default \code{continuous = FALSE}.} 36 | 37 | \item{planter}{Option for \code{serpentine} or \code{cartesian} plot 38 | arrangement. By default \code{planter = 'serpentine'}.} 39 | 40 | \item{seed}{(optional) Real number that specifies the starting seed 41 | to obtain reproducible designs.} 42 | 43 | \item{locationNames}{(optional) Names for each location.} 44 | 45 | \item{factorLabels}{(optional) If \code{TRUE} retain the levels 46 | labels from the original data set otherwise, numeric labels will be 47 | assigned. Default is \code{factorLabels =TRUE}.} 48 | 49 | \item{data}{(optional) Data frame with the labels of factors.} 50 | } 51 | \value{ 52 | A list with two elements. 53 | \itemize{ 54 | \item \code{infoDesign} is a list with information on the design parameters. 55 | \item \code{fieldBook} is a data frame with the full factorial field book. 56 | } 57 | } 58 | \description{ 59 | It randomly generates a full factorial design across locations. 60 | } 61 | \examples{ 62 | # Example 1: Generates a full factorial with 3 factors each with 2 levels. 63 | # This in an RCBD arrangement with 3 reps. 64 | fullFact1 <- full_factorial(setfactors = c(2,2,2), reps = 3, l = 1, type = 2, 65 | plotNumber = 101, 66 | continuous = TRUE, 67 | planter = "serpentine", 68 | seed = 325, 69 | locationNames = "FARGO") 70 | fullFact1$infoDesign 71 | head(fullFact1$fieldBook,10) 72 | 73 | # Example 2: Generates a full factorial with 3 factors and each with levels: 2,3, 74 | # and 2, respectively. In this case, we show how to use the option data 75 | FACTORS <- rep(c("A", "B", "C"), c(2,3,2)) 76 | LEVELS <- c("a0", "a1", "b0", "b1", "b2", "c0", "c1") 77 | data_factorial <- data.frame(list(FACTOR = FACTORS, LEVEL = LEVELS)) 78 | print(data_factorial) 79 | # This in an RCBD arrangement with 5 reps in 3 locations. 80 | fullFact2 <- full_factorial(setfactors = NULL, reps = 5, l = 3, type = 2, 81 | plotNumber = c(101,1001,2001), 82 | continuous = FALSE, 83 | planter = "serpentine", 84 | seed = 326, 85 | locationNames = c("Loc1","Loc2","Loc3"), 86 | data = data_factorial) 87 | fullFact2$infoDesign 88 | head(fullFact2$fieldBook,10) 89 | 90 | } 91 | \references{ 92 | Federer, W. T. (1955). Experimental Design. Theory and Application. New York, USA. The 93 | Macmillan Company. 94 | } 95 | \author{ 96 | Didier Murillo [aut], 97 | Salvador Gezan [aut], 98 | Ana Heilman [ctb], 99 | Thomas Walk [ctb], 100 | Johan Aparicio [ctb], 101 | Richard Horsley [ctb] 102 | } 103 | -------------------------------------------------------------------------------- /data/Optim_2_15x16.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME,REPS 2 | 101,A,8 3 | 102,B,8 4 | 103,C,8 5 | 104,D,8 6 | 105,ND-105,1 7 | 106,ND-106,1 8 | 107,ND-107,1 9 | 108,ND-108,1 10 | 109,ND-109,1 11 | 110,ND-110,1 12 | 111,ND-111,1 13 | 112,ND-112,1 14 | 113,ND-113,1 15 | 114,ND-114,1 16 | 115,ND-115,1 17 | 116,ND-116,1 18 | 117,ND-117,1 19 | 118,ND-118,1 20 | 119,ND-119,1 21 | 120,ND-120,1 22 | 121,ND-121,1 23 | 122,ND-122,1 24 | 123,ND-123,1 25 | 124,ND-124,1 26 | 125,ND-125,1 27 | 126,ND-126,1 28 | 127,ND-127,1 29 | 128,ND-128,1 30 | 129,ND-129,1 31 | 130,ND-130,1 32 | 131,ND-131,1 33 | 132,ND-132,1 34 | 133,ND-133,1 35 | 134,ND-134,1 36 | 135,ND-135,1 37 | 136,ND-136,1 38 | 137,ND-137,1 39 | 138,ND-138,1 40 | 139,ND-139,1 41 | 140,ND-140,1 42 | 141,ND-141,1 43 | 142,ND-142,1 44 | 143,ND-143,1 45 | 144,ND-144,1 46 | 145,ND-145,1 47 | 146,ND-146,1 48 | 147,ND-147,1 49 | 148,ND-148,1 50 | 149,ND-149,1 51 | 150,ND-150,1 52 | 151,ND-151,1 53 | 152,ND-152,1 54 | 153,ND-153,1 55 | 154,ND-154,1 56 | 155,ND-155,1 57 | 156,ND-156,1 58 | 157,ND-157,1 59 | 158,ND-158,1 60 | 159,ND-159,1 61 | 160,ND-160,1 62 | 161,ND-161,1 63 | 162,ND-162,1 64 | 163,ND-163,1 65 | 164,ND-164,1 66 | 165,ND-165,1 67 | 166,ND-166,1 68 | 167,ND-167,1 69 | 168,ND-168,1 70 | 169,ND-169,1 71 | 170,ND-170,1 72 | 171,ND-171,1 73 | 172,ND-172,1 74 | 173,ND-173,1 75 | 174,ND-174,1 76 | 175,ND-175,1 77 | 176,ND-176,1 78 | 177,ND-177,1 79 | 178,ND-178,1 80 | 179,ND-179,1 81 | 180,ND-180,1 82 | 181,ND-181,1 83 | 182,ND-182,1 84 | 183,ND-183,1 85 | 184,ND-184,1 86 | 185,ND-185,1 87 | 186,ND-186,1 88 | 187,ND-187,1 89 | 188,ND-188,1 90 | 189,ND-189,1 91 | 190,ND-190,1 92 | 191,ND-191,1 93 | 192,ND-192,1 94 | 193,ND-193,1 95 | 194,ND-194,1 96 | 195,ND-195,1 97 | 196,ND-196,1 98 | 197,ND-197,1 99 | 198,ND-198,1 100 | 199,ND-199,1 101 | 200,ND-200,1 102 | 201,ND-201,1 103 | 202,ND-202,1 104 | 203,ND-203,1 105 | 204,ND-204,1 106 | 205,ND-205,1 107 | 206,ND-206,1 108 | 207,ND-207,1 109 | 208,ND-208,1 110 | 209,ND-209,1 111 | 210,ND-210,1 112 | 211,ND-211,1 113 | 212,ND-212,1 114 | 213,ND-213,1 115 | 214,ND-214,1 116 | 215,ND-215,1 117 | 216,ND-216,1 118 | 217,ND-217,1 119 | 218,ND-218,1 120 | 219,ND-219,1 121 | 220,ND-220,1 122 | 221,ND-221,1 123 | 222,ND-222,1 124 | 223,ND-223,1 125 | 224,ND-224,1 126 | 225,ND-225,1 127 | 226,ND-226,1 128 | 227,ND-227,1 129 | 228,ND-228,1 130 | 229,ND-229,1 131 | 230,ND-230,1 132 | 231,ND-231,1 133 | 232,ND-232,1 134 | 233,ND-233,1 135 | 234,ND-234,1 136 | 235,ND-235,1 137 | 236,ND-236,1 138 | 237,ND-237,1 139 | 238,ND-238,1 140 | 239,ND-239,1 141 | 240,ND-240,1 142 | 241,ND-241,1 143 | 242,ND-242,1 144 | 243,ND-243,1 145 | 244,ND-244,1 146 | 245,ND-245,1 147 | 246,ND-246,1 148 | 247,ND-247,1 149 | 248,ND-248,1 150 | 249,ND-249,1 151 | 250,ND-250,1 152 | 251,ND-251,1 153 | 252,ND-252,1 154 | 253,ND-253,1 155 | 254,ND-254,1 156 | 255,ND-255,1 157 | 256,ND-256,1 158 | 257,ND-257,1 159 | 258,ND-258,1 160 | 259,ND-259,1 161 | 260,ND-260,1 162 | 261,ND-261,1 163 | 262,ND-262,1 164 | 263,ND-263,1 165 | 264,ND-264,1 166 | 265,ND-265,1 167 | 266,ND-266,1 168 | 267,ND-267,1 169 | 268,ND-268,1 170 | 269,ND-269,1 171 | 270,ND-270,1 172 | 271,ND-271,1 173 | 272,ND-272,1 174 | 273,ND-273,1 175 | 274,ND-274,1 176 | 275,ND-275,1 177 | 276,ND-276,1 178 | 277,ND-277,1 179 | 278,ND-278,1 180 | 279,ND-279,1 181 | 280,ND-280,1 182 | 281,ND-281,1 183 | 282,ND-282,1 184 | 283,ND-283,1 185 | 284,ND-284,1 186 | 285,ND-285,1 187 | 286,ND-286,1 188 | 287,ND-287,1 189 | 288,ND-288,1 190 | 289,ND-289,1 191 | 290,ND-290,1 192 | 291,ND-291,1 193 | 292,ND-292,1 194 | 293,ND-293,1 195 | 294,ND-294,1 196 | 295,ND-295,1 197 | 296,ND-296,1 198 | 297,ND-297,1 199 | 298,ND-298,1 200 | 299,ND-299,1 201 | 300,ND-300,1 202 | 301,ND-301,1 203 | 302,ND-302,1 204 | 303,ND-303,1 205 | 304,ND-304,1 206 | 305,ND-305,1 207 | 306,ND-306,1 208 | 307,ND-307,1 209 | 308,ND-308,1 210 | 309,ND-309,1 211 | 310,ND-310,1 212 | 311,ND-311,1 213 | 312,ND-312,1 214 | -------------------------------------------------------------------------------- /data/pREPS_2_16x20.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME,REPS 2 | 22,ND-22,2 3 | 23,ND-23,2 4 | 24,ND-24,2 5 | 25,ND-25,2 6 | 26,ND-26,2 7 | 27,ND-27,2 8 | 28,ND-28,2 9 | 29,ND-29,2 10 | 30,ND-30,2 11 | 31,ND-31,2 12 | 32,ND-32,2 13 | 33,ND-33,2 14 | 34,ND-34,2 15 | 35,ND-35,2 16 | 36,ND-36,2 17 | 37,ND-37,2 18 | 38,ND-38,2 19 | 39,ND-39,2 20 | 40,ND-40,2 21 | 41,ND-41,2 22 | 42,ND-42,2 23 | 43,ND-43,2 24 | 44,ND-44,2 25 | 45,ND-45,2 26 | 46,ND-46,2 27 | 47,ND-47,2 28 | 48,ND-48,2 29 | 49,ND-49,2 30 | 50,ND-50,2 31 | 51,ND-51,2 32 | 52,ND-52,2 33 | 53,ND-53,2 34 | 54,ND-54,2 35 | 55,ND-55,2 36 | 56,ND-56,2 37 | 57,ND-57,2 38 | 58,ND-58,2 39 | 59,ND-59,2 40 | 60,ND-60,2 41 | 61,ND-61,2 42 | 62,ND-62,2 43 | 63,ND-63,2 44 | 64,ND-64,2 45 | 65,ND-65,2 46 | 66,ND-66,2 47 | 67,ND-67,2 48 | 68,ND-68,2 49 | 69,ND-69,2 50 | 70,ND-70,2 51 | 71,ND-71,2 52 | 72,ND-72,2 53 | 73,ND-73,2 54 | 74,ND-74,2 55 | 75,ND-75,2 56 | 76,ND-76,2 57 | 77,ND-77,2 58 | 78,ND-78,2 59 | 79,ND-79,2 60 | 80,ND-80,2 61 | 81,ND-81,2 62 | 82,ND-82,2 63 | 83,ND-83,2 64 | 84,ND-84,2 65 | 85,ND-85,2 66 | 86,ND-86,2 67 | 87,ND-87,2 68 | 88,ND-88,2 69 | 89,ND-89,2 70 | 90,ND-90,2 71 | 91,ND-91,2 72 | 92,ND-92,2 73 | 93,ND-93,2 74 | 94,ND-94,2 75 | 95,ND-95,2 76 | 96,ND-96,2 77 | 97,ND-97,2 78 | 98,ND-98,2 79 | 99,ND-99,2 80 | 100,ND-100,2 81 | 101,ND-101,2 82 | 102,ND-102,2 83 | 103,ND-103,2 84 | 104,ND-104,2 85 | 105,ND-105,2 86 | 106,ND-106,2 87 | 107,ND-107,2 88 | 108,ND-108,2 89 | 109,ND-109,2 90 | 110,ND-110,2 91 | 111,ND-111,2 92 | 112,ND-112,2 93 | 113,ND-113,2 94 | 114,ND-114,2 95 | 115,ND-115,2 96 | 116,ND-116,2 97 | 117,ND-117,2 98 | 118,ND-118,2 99 | 119,ND-119,2 100 | 120,ND-120,2 101 | 121,ND-121,2 102 | 122,ND-122,1 103 | 123,ND-123,1 104 | 124,ND-124,1 105 | 125,ND-125,1 106 | 126,ND-126,1 107 | 127,ND-127,1 108 | 128,ND-128,1 109 | 129,ND-129,1 110 | 130,ND-130,1 111 | 131,ND-131,1 112 | 132,ND-132,1 113 | 133,ND-133,1 114 | 134,ND-134,1 115 | 135,ND-135,1 116 | 136,ND-136,1 117 | 137,ND-137,1 118 | 138,ND-138,1 119 | 139,ND-139,1 120 | 140,ND-140,1 121 | 141,ND-141,1 122 | 142,ND-142,1 123 | 143,ND-143,1 124 | 144,ND-144,1 125 | 145,ND-145,1 126 | 146,ND-146,1 127 | 147,ND-147,1 128 | 148,ND-148,1 129 | 149,ND-149,1 130 | 150,ND-150,1 131 | 151,ND-151,1 132 | 152,ND-152,1 133 | 153,ND-153,1 134 | 154,ND-154,1 135 | 155,ND-155,1 136 | 156,ND-156,1 137 | 157,ND-157,1 138 | 158,ND-158,1 139 | 159,ND-159,1 140 | 160,ND-160,1 141 | 161,ND-161,1 142 | 162,ND-162,1 143 | 163,ND-163,1 144 | 164,ND-164,1 145 | 165,ND-165,1 146 | 166,ND-166,1 147 | 167,ND-167,1 148 | 168,ND-168,1 149 | 169,ND-169,1 150 | 170,ND-170,1 151 | 171,ND-171,1 152 | 172,ND-172,1 153 | 173,ND-173,1 154 | 174,ND-174,1 155 | 175,ND-175,1 156 | 176,ND-176,1 157 | 177,ND-177,1 158 | 178,ND-178,1 159 | 179,ND-179,1 160 | 180,ND-180,1 161 | 181,ND-181,1 162 | 182,ND-182,1 163 | 183,ND-183,1 164 | 184,ND-184,1 165 | 185,ND-185,1 166 | 186,ND-186,1 167 | 187,ND-187,1 168 | 188,ND-188,1 169 | 189,ND-189,1 170 | 190,ND-190,1 171 | 191,ND-191,1 172 | 192,ND-192,1 173 | 193,ND-193,1 174 | 194,ND-194,1 175 | 195,ND-195,1 176 | 196,ND-196,1 177 | 197,ND-197,1 178 | 198,ND-198,1 179 | 199,ND-199,1 180 | 200,ND-200,1 181 | 201,ND-201,1 182 | 202,ND-202,1 183 | 203,ND-203,1 184 | 204,ND-204,1 185 | 205,ND-205,1 186 | 206,ND-206,1 187 | 207,ND-207,1 188 | 208,ND-208,1 189 | 209,ND-209,1 190 | 210,ND-210,1 191 | 211,ND-211,1 192 | 212,ND-212,1 193 | 213,ND-213,1 194 | 214,ND-214,1 195 | 215,ND-215,1 196 | 216,ND-216,1 197 | 217,ND-217,1 198 | 218,ND-218,1 199 | 219,ND-219,1 200 | 220,ND-220,1 201 | 221,ND-221,1 202 | 222,ND-222,1 203 | 223,ND-223,1 204 | 224,ND-224,1 205 | 225,ND-225,1 206 | 226,ND-226,1 207 | 227,ND-227,1 208 | 228,ND-228,1 209 | 229,ND-229,1 210 | 230,ND-230,1 211 | 231,ND-231,1 212 | 232,ND-232,1 213 | 233,ND-233,1 214 | 234,ND-234,1 215 | 235,ND-235,1 216 | 236,ND-236,1 217 | 237,ND-237,1 218 | 238,ND-238,1 219 | 239,ND-239,1 220 | 240,ND-240,1 221 | 241,ND-241,1 222 | -------------------------------------------------------------------------------- /man/strip_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_strip_plot.R 3 | \name{strip_plot} 4 | \alias{strip_plot} 5 | \title{Strip Plot Design} 6 | \usage{ 7 | strip_plot( 8 | Hplots = NULL, 9 | Vplots = NULL, 10 | b = 1, 11 | l = 1, 12 | plotNumber = NULL, 13 | planter = "serpentine", 14 | locationNames = NULL, 15 | seed = NULL, 16 | factorLabels = TRUE, 17 | randomizeH = TRUE, 18 | randomizeV = FALSE, 19 | data = NULL 20 | ) 21 | } 22 | \arguments{ 23 | \item{Hplots}{Number of horizontal factors, as an integer or a vector.} 24 | 25 | \item{Vplots}{Number of vertical factors, as an integer or a vector.} 26 | 27 | \item{b}{Number of blocks (full replicates).} 28 | 29 | \item{l}{Number of locations. By default \code{l = 1}.} 30 | 31 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 32 | 33 | \item{planter}{Option for \code{serpentine} or \code{cartesian} arrangement. By default \code{planter = 'serpentine'}.} 34 | 35 | \item{locationNames}{(optional) Names for each location.} 36 | 37 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 38 | 39 | \item{factorLabels}{(optional) If \code{TRUE} retain the levels 40 | labels from the original data set otherwise, numeric labels will be 41 | assigned. Default is \code{factorLabels =TRUE}.} 42 | 43 | \item{randomizeH}{Logical flag: \code{TRUE} to randomize horizontal strips separately in each replicate; \code{FALSE} to randomize once per location and reuse.} 44 | 45 | \item{randomizeV}{Logical flag: \code{TRUE} to randomize vertical strips separately in each replicate; \code{FALSE} to randomize once per location and reuse.} 46 | 47 | \item{data}{(optional) data frame with the labels of vertical and horizontal plots.} 48 | } 49 | \value{ 50 | A list with four elements. 51 | \itemize{ 52 | \item \code{infoDesign} is a list with information on the design parameters. 53 | \item \code{stripsBlockLoc} is a list with the strip blocks for each location. 54 | \item \code{plotLayouts} is a list with the layout plot numbers for each location. 55 | \item \code{fieldBook} is a data frame with the strip plot field book. 56 | } 57 | } 58 | \description{ 59 | It randomly generates a strip plot design across locations. 60 | } 61 | \examples{ 62 | # Example 1: Generates a strip plot design with 5 vertical strips and 4 horizontal strips, 63 | # with 3 reps in one location. 64 | H <- paste("H", 1:4, sep = "") 65 | V <- paste("V", 1:5, sep = "") 66 | strip1 <- strip_plot( 67 | Hplots = H, 68 | Vplots = V, 69 | b = 3, 70 | l = 1, 71 | plotNumber = 101, 72 | planter = "serpentine", 73 | locationNames = "A", 74 | seed = 333 75 | ) 76 | strip1$infoDesign 77 | strip1$stripsBlockLoc 78 | strip1$plotLayouts 79 | head(strip1$fieldBook, 12) 80 | 81 | # Example 2: Generates a strip plot design with 5 vertical strips and 5 horizontal strips, 82 | # with 6 reps across to 3 locations. In this case, we show how to use the option data. 83 | Hplots <- LETTERS[1:5] 84 | Vplots <- LETTERS[1:4] 85 | strip_data <- data.frame(list(HPLOTS = Hplots, VPLOTS = c(Vplots, NA))) 86 | head(strip_data) 87 | strip2 <- strip_plot( 88 | Hplots = 5, 89 | Vplots = 5, 90 | b = 6, 91 | l = 3, 92 | plotNumber = c(101, 1001, 2001), 93 | planter = "cartesian", 94 | locationNames = c("A", "B", "C"), 95 | seed = 222, 96 | data = strip_data 97 | ) 98 | strip2$infoDesign 99 | strip2$stripsBlockLoc 100 | strip2$plotLayouts 101 | head(strip2$fieldBook, 12) 102 | 103 | } 104 | \references{ 105 | Federer, W. T. (1955). Experimental Design. Theory and Application. New York, USA. The 106 | Macmillan Company. 107 | } 108 | \author{ 109 | Didier Murillo [aut], 110 | Salvador Gezan [aut], 111 | Ana Heilman [ctb], 112 | Thomas Walk [ctb], 113 | Johan Aparicio [ctb], 114 | Richard Horsley [ctb] 115 | } 116 | -------------------------------------------------------------------------------- /R/utils_row_col_optimization.R: -------------------------------------------------------------------------------- 1 | # Function to randomly swap a pair of treatments within a random 2 | # level of Level_2 for all levels of Level_1 3 | #' @noRd 4 | swap_treatments <- function(df) { 5 | # Split the dataframe by Level_1 6 | df_split <- split(df, df$Level_1) 7 | 8 | # Initialize an empty dataframe to store the results 9 | result <- data.frame() 10 | 11 | # Loop through each level of Level_1 12 | for (level1 in names(df_split)) { 13 | df_level1 <- df_split[[level1]] 14 | 15 | # Get the unique values of Level_2 16 | unique_levels2 <- unique(df_level1$Level_2) 17 | 18 | # Randomly select one level of Level_2 19 | random_level2 <- sample(unique_levels2, 1) 20 | df_level2 <- df_level1[df_level1$Level_2 == random_level2, ] 21 | 22 | if (nrow(df_level2) >= 2) { 23 | # Randomly select two different rows to swap treatments 24 | rows_to_swap <- sample(1:nrow(df_level2), 2) 25 | temp <- df_level2$treatments[rows_to_swap[1]] 26 | df_level2$treatments[rows_to_swap[1]] <- df_level2$treatments[rows_to_swap[2]] 27 | df_level2$treatments[rows_to_swap[2]] <- temp 28 | } 29 | 30 | # Combine the modified dataframe with the rest 31 | df_level1[df_level1$Level_2 == random_level2, ] <- df_level2 32 | result <- rbind(result, df_level1) 33 | } 34 | 35 | return(result) 36 | } 37 | 38 | # Function to improve A-Efficiency for Level 2 39 | #' @noRd 40 | improve_efficiency <- function(design, iterations, seed) { 41 | set.seed(seed) 42 | # Initial design 43 | best_design <- design 44 | 45 | # Calculate initial efficiencies 46 | row_blocks <- best_design |> 47 | dplyr::select(Level_1, Level_3, plots, treatments) 48 | efficiencies <- BlockEfficiencies(row_blocks) 49 | best_a_efficiency <- efficiencies$`A-Efficiency`[efficiencies$Level == 2] 50 | 51 | # Run iterations to improve A-Efficiency 52 | for (i in 1:iterations) { 53 | # Generate a new design by swapping treatments 54 | new_design <- swap_treatments(best_design) 55 | 56 | # Calculate efficiencies for the new design 57 | new_row_blocks <- new_design |> 58 | dplyr::select(Level_1, Level_3, plots, treatments) 59 | new_efficiencies <- BlockEfficiencies(new_row_blocks) 60 | new_a_efficiency <- new_efficiencies$`A-Efficiency`[new_efficiencies$Level == 2] 61 | 62 | # Update the best design if the new A-Efficiency is higher 63 | if (new_a_efficiency > best_a_efficiency) { 64 | best_design <- new_design 65 | best_a_efficiency <- new_a_efficiency 66 | best_efficiencies <- new_efficiencies 67 | } 68 | } 69 | return( 70 | list( 71 | best_design = best_design, 72 | best_efficiencies = best_efficiencies, 73 | best_a_efficiency = best_a_efficiency 74 | ) 75 | ) 76 | } 77 | 78 | # Function to calculate and return combined BlockEfficiencies 79 | #' @noRd 80 | report_efficiency <- function(design) { 81 | # Calculate row block efficiencies 82 | row_blocks <- design |> 83 | dplyr::select(Level_1, Level_3, plots, treatments) 84 | row_efficiencies <- BlockEfficiencies(row_blocks) 85 | row_efficiencies <- row_efficiencies |> 86 | dplyr::filter(Level == 2) |> 87 | dplyr::mutate(Level = "Row") 88 | 89 | # Calculate column block efficiencies 90 | col_blocks <- design |> 91 | dplyr::select(Level_1, Level_2, plots, treatments) 92 | col_efficiencies <- BlockEfficiencies(col_blocks) 93 | col_efficiencies <- col_efficiencies |> 94 | dplyr::filter(Level == 2) |> 95 | dplyr::mutate(Level = "Column") 96 | 97 | # Get replication efficiencies 98 | rep_efficiencies <- BlockEfficiencies(row_blocks) |> 99 | dplyr::filter(Level == 1) |> 100 | dplyr::mutate(Level = "Rep") 101 | 102 | # Combine the results 103 | combined_efficiencies <- dplyr::bind_rows(rep_efficiencies, row_efficiencies, col_efficiencies) 104 | 105 | return(combined_efficiencies) 106 | } 107 | -------------------------------------------------------------------------------- /man/split_split_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_split_split_plot.R 3 | \name{split_split_plot} 4 | \alias{split_split_plot} 5 | \title{Generates a Split Split Plot Design} 6 | \usage{ 7 | split_split_plot( 8 | wp = NULL, 9 | sp = NULL, 10 | ssp = NULL, 11 | reps = NULL, 12 | type = 2, 13 | l = 1, 14 | plotNumber = 101, 15 | seed = NULL, 16 | locationNames = NULL, 17 | factorLabels = TRUE, 18 | data = NULL 19 | ) 20 | } 21 | \arguments{ 22 | \item{wp}{Number of whole plots, as an integer or a vector.} 23 | 24 | \item{sp}{Number of sub plots per whole plot, as an integer or a vector.} 25 | 26 | \item{ssp}{Number of sub-sub plots, as an integer or a vector.} 27 | 28 | \item{reps}{Number of blocks (full replicates).} 29 | 30 | \item{type}{Option for CRD or RCBD designs. Values are \code{type = 1} (CRD) or \code{type = 2} (RCBD). By default \code{type = 2}.} 31 | 32 | \item{l}{Number of locations. By default \code{l = 1}.} 33 | 34 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 35 | 36 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 37 | 38 | \item{locationNames}{(optional) Names for each location.} 39 | 40 | \item{factorLabels}{(optional) If \code{TRUE} retain the levels 41 | labels from the original data set otherwise, numeric labels will be 42 | assigned. Default is \code{factorLabels =TRUE}.} 43 | 44 | \item{data}{(optional) Data frame with label list of treatments.} 45 | } 46 | \value{ 47 | A list with two elements. 48 | \itemize{ 49 | \item \code{infoDesign} is a list with information on the design parameters. 50 | \item \code{fieldBook} is a data frame with the split split plot field book. 51 | } 52 | } 53 | \description{ 54 | It randomly generates a split split plot design (SSPD) across locations. 55 | } 56 | \examples{ 57 | # Example 1: Generates a split split plot design SSPD with 5 whole plots, 2 sub-plots, 58 | # 3 sub-sub plots, and 3 reps in an RCBD arrangement. This is for one location. 59 | SSPD1 <- split_split_plot(wp = 4, sp = 2, ssp = 3, reps = 5, l = 1, 60 | plotNumber = 101, 61 | seed = 23, 62 | type = 2, 63 | locationNames = "FARGO") 64 | SSPD1$infoDesign 65 | head(SSPD1$fieldBook,12) 66 | 67 | # Example 2: Generates a split split plot design SSPD with 2 whole plost 68 | # (Irrigation, No irrigation), 5 sub plots (4 types of fungicide + one control), and 69 | # 10 sub-sub plots (Ten varieties of beans), and 4 reps in an RCBD arrangement. 70 | # This is for 3 locations. In this case, we show how to use the option data. 71 | wp <- paste("IRR_", c("NO", "Yes"), sep = "") #Irrigation (2 Whole plots) 72 | sp <- c("NFung", paste("Fung", 1:4, sep = "")) #Fungicides (5 Sub plots) 73 | ssp <- paste("Beans", 1:10, sep = "") #Beans varieties (10 Sub-sub plots) 74 | split_split_plot_Data <- data.frame(list(WHOLPLOT = c(wp, rep(NA, 8)), 75 | SUBPLOT = c(sp, rep(NA, 5)), 76 | SUB_SUBPLOTS = ssp)) 77 | head(split_split_plot_Data, 10) 78 | SSPD2 <- split_split_plot(reps = 4, l = 3, 79 | plotNumber = c(101, 1001, 2001), 80 | seed = 23, 81 | type = 2, 82 | locationNames = c("A", "B", "C"), 83 | data = split_split_plot_Data) 84 | SSPD2$infoDesign 85 | head(SSPD2$fieldBook,12) 86 | 87 | } 88 | \references{ 89 | Federer, W. T. (1955). Experimental Design. Theory and Application. New York, USA. The 90 | Macmillan Company. 91 | } 92 | \author{ 93 | Didier Murillo [aut], 94 | Salvador Gezan [aut], 95 | Ana Heilman [ctb], 96 | Thomas Walk [ctb], 97 | Johan Aparicio [ctb], 98 | Richard Horsley [ctb] 99 | } 100 | -------------------------------------------------------------------------------- /data/Diagonal_258_treatments_4_checks.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 1,A 3 | 2,B 4 | 3,C 5 | 4,D 6 | 5,ND-05 7 | 6,ND-06 8 | 7,ND-07 9 | 8,ND-08 10 | 9,ND-09 11 | 10,ND-10 12 | 11,ND-11 13 | 12,ND-12 14 | 13,ND-13 15 | 14,ND-14 16 | 15,ND-15 17 | 16,ND-16 18 | 17,ND-17 19 | 18,ND-18 20 | 19,ND-19 21 | 20,ND-20 22 | 21,ND-21 23 | 22,ND-22 24 | 23,ND-23 25 | 24,ND-24 26 | 25,ND-25 27 | 26,ND-26 28 | 27,ND-27 29 | 28,ND-28 30 | 29,ND-29 31 | 30,ND-30 32 | 31,ND-31 33 | 32,ND-32 34 | 33,ND-33 35 | 34,ND-34 36 | 35,ND-35 37 | 36,ND-36 38 | 37,ND-37 39 | 38,ND-38 40 | 39,ND-39 41 | 40,ND-40 42 | 41,ND-41 43 | 42,ND-42 44 | 43,ND-43 45 | 44,ND-44 46 | 45,ND-45 47 | 46,ND-46 48 | 47,ND-47 49 | 48,ND-48 50 | 49,ND-49 51 | 50,ND-50 52 | 51,ND-51 53 | 52,ND-52 54 | 53,ND-53 55 | 54,ND-54 56 | 55,ND-55 57 | 56,ND-56 58 | 57,ND-57 59 | 58,ND-58 60 | 59,ND-59 61 | 60,ND-60 62 | 61,ND-61 63 | 62,ND-62 64 | 63,ND-63 65 | 64,ND-64 66 | 65,ND-65 67 | 66,ND-66 68 | 67,ND-67 69 | 68,ND-68 70 | 69,ND-69 71 | 70,ND-70 72 | 71,ND-71 73 | 72,ND-72 74 | 73,ND-73 75 | 74,ND-74 76 | 75,ND-75 77 | 76,ND-76 78 | 77,ND-77 79 | 78,ND-78 80 | 79,ND-79 81 | 80,ND-80 82 | 81,ND-81 83 | 82,ND-82 84 | 83,ND-83 85 | 84,ND-84 86 | 85,ND-85 87 | 86,ND-86 88 | 87,ND-87 89 | 88,ND-88 90 | 89,ND-89 91 | 90,ND-90 92 | 91,ND-91 93 | 92,ND-92 94 | 93,ND-93 95 | 94,ND-94 96 | 95,ND-95 97 | 96,ND-96 98 | 97,ND-97 99 | 98,ND-98 100 | 99,ND-99 101 | 100,ND-100 102 | 101,ND-101 103 | 102,ND-102 104 | 103,ND-103 105 | 104,ND-104 106 | 105,ND-105 107 | 106,ND-106 108 | 107,ND-107 109 | 108,ND-108 110 | 109,ND-109 111 | 110,ND-110 112 | 111,ND-111 113 | 112,ND-112 114 | 113,ND-113 115 | 114,ND-114 116 | 115,ND-115 117 | 116,ND-116 118 | 117,ND-117 119 | 118,ND-118 120 | 119,ND-119 121 | 120,ND-120 122 | 121,ND-121 123 | 122,ND-122 124 | 123,ND-123 125 | 124,ND-124 126 | 125,ND-125 127 | 126,ND-126 128 | 127,ND-127 129 | 128,ND-128 130 | 129,ND-129 131 | 130,ND-130 132 | 131,ND-131 133 | 132,ND-132 134 | 133,ND-133 135 | 134,ND-134 136 | 135,ND-135 137 | 136,ND-136 138 | 137,ND-137 139 | 138,ND-138 140 | 139,ND-139 141 | 140,ND-140 142 | 141,ND-141 143 | 142,ND-142 144 | 143,ND-143 145 | 144,ND-144 146 | 145,ND-145 147 | 146,ND-146 148 | 147,ND-147 149 | 148,ND-148 150 | 149,ND-149 151 | 150,ND-150 152 | 151,ND-151 153 | 152,ND-152 154 | 153,ND-153 155 | 154,ND-154 156 | 155,ND-155 157 | 156,ND-156 158 | 157,ND-157 159 | 158,ND-158 160 | 159,ND-159 161 | 160,ND-160 162 | 161,ND-161 163 | 162,ND-162 164 | 163,ND-163 165 | 164,ND-164 166 | 165,ND-165 167 | 166,ND-166 168 | 167,ND-167 169 | 168,ND-168 170 | 169,ND-169 171 | 170,ND-170 172 | 171,ND-171 173 | 172,ND-172 174 | 173,ND-173 175 | 174,ND-174 176 | 175,ND-175 177 | 176,ND-176 178 | 177,ND-177 179 | 178,ND-178 180 | 179,ND-179 181 | 180,ND-180 182 | 181,ND-181 183 | 182,ND-182 184 | 183,ND-183 185 | 184,ND-184 186 | 185,ND-185 187 | 186,ND-186 188 | 187,ND-187 189 | 188,ND-188 190 | 189,ND-189 191 | 190,ND-190 192 | 191,ND-191 193 | 192,ND-192 194 | 193,ND-193 195 | 194,ND-194 196 | 195,ND-195 197 | 196,ND-196 198 | 197,ND-197 199 | 198,ND-198 200 | 199,ND-199 201 | 200,ND-200 202 | 201,ND-201 203 | 202,ND-202 204 | 203,ND-203 205 | 204,ND-204 206 | 205,ND-205 207 | 206,ND-206 208 | 207,ND-207 209 | 208,ND-208 210 | 209,ND-209 211 | 210,ND-210 212 | 211,ND-211 213 | 212,ND-212 214 | 213,ND-213 215 | 214,ND-214 216 | 215,ND-215 217 | 216,ND-216 218 | 217,ND-217 219 | 218,ND-218 220 | 219,ND-219 221 | 220,ND-220 222 | 221,ND-221 223 | 222,ND-222 224 | 223,ND-223 225 | 224,ND-224 226 | 225,ND-225 227 | 226,ND-226 228 | 227,ND-227 229 | 228,ND-228 230 | 229,ND-229 231 | 230,ND-230 232 | 231,ND-231 233 | 232,ND-232 234 | 233,ND-233 235 | 234,ND-234 236 | 235,ND-235 237 | 236,ND-236 238 | 237,ND-237 239 | 238,ND-238 240 | 239,ND-239 241 | 240,ND-240 242 | 241,ND-241 243 | 242,ND-242 244 | 243,ND-243 245 | 244,ND-244 246 | 245,ND-245 247 | 246,ND-246 248 | 247,ND-247 249 | 248,ND-248 250 | 249,ND-249 251 | 250,ND-250 252 | 251,ND-251 253 | 252,ND-252 254 | 253,ND-253 255 | 254,ND-254 256 | 255,ND-255 257 | 256,ND-256 258 | 257,ND-257 259 | 258,ND-258 260 | 259,ND-259 261 | 260,ND-260 262 | 261,ND-261 263 | 262,ND-262 264 | -------------------------------------------------------------------------------- /man/RCBD_augmented.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fct_RCDB_augmented.R 3 | \name{RCBD_augmented} 4 | \alias{RCBD_augmented} 5 | \title{Generates an Augmented Randomized Complete Block Design (ARCBD)} 6 | \usage{ 7 | RCBD_augmented( 8 | lines = NULL, 9 | checks = NULL, 10 | b = NULL, 11 | l = 1, 12 | planter = "serpentine", 13 | plotNumber = 101, 14 | exptName = NULL, 15 | seed = NULL, 16 | locationNames = NULL, 17 | repsExpt = 1, 18 | random = TRUE, 19 | data = NULL, 20 | nrows = NULL, 21 | ncols = NULL 22 | ) 23 | } 24 | \arguments{ 25 | \item{lines}{Treatments, number of lines for test.} 26 | 27 | \item{checks}{Number of checks per augmented block.} 28 | 29 | \item{b}{Number of augmented blocks.} 30 | 31 | \item{l}{Number of locations. By default \code{l = 1}.} 32 | 33 | \item{planter}{Option for \code{serpentine} or \code{cartesian} arrangement. By default \code{planter = 'serpentine'}.} 34 | 35 | \item{plotNumber}{Numeric vector with the starting plot number for each location. By default \code{plotNumber = 101}.} 36 | 37 | \item{exptName}{(optional) Name of experiment.} 38 | 39 | \item{seed}{(optional) Real number that specifies the starting seed to obtain reproducible designs.} 40 | 41 | \item{locationNames}{(optional) Name for each location.} 42 | 43 | \item{repsExpt}{(optional) Number of reps of experiment. By default \code{repsExpt = 1}.} 44 | 45 | \item{random}{Logical value to randomize treatments or not. By default \code{random = TRUE}.} 46 | 47 | \item{data}{(optional) Data frame with the labels of treatments.} 48 | 49 | \item{nrows}{(optional) Number of rows in the field.} 50 | 51 | \item{ncols}{(optional) Number of columns in the field.} 52 | } 53 | \value{ 54 | A list with five elements. 55 | \itemize{ 56 | \item \code{infoDesign} is a list with information on the design parameters. 57 | \item \code{layoutRandom} is the ARCBD layout randomization for the first location. 58 | \item \code{plotNumber} is the plot number layout for the first location. 59 | \item \code{exptNames} is the experiment names layout. 60 | \item \code{data_entry} is a data frame with the data input. 61 | \item \code{fieldBook} is a data frame with the ARCBD field book. 62 | } 63 | } 64 | \description{ 65 | It randomly generates an augmented randomized complete block design across locations (ARCBD). 66 | } 67 | \examples{ 68 | # Example 1: Generates an ARCBD with 6 blocks, 3 checks for each, and 50 treatments 69 | # in two locations. 70 | ARCBD1 <- RCBD_augmented(lines = 50, checks = 3, b = 6, l = 2, 71 | planter = "cartesian", 72 | plotNumber = c(1,1001), 73 | seed = 23, 74 | locationNames = c("FARGO", "MINOT")) 75 | ARCBD1$infoDesign 76 | ARCBD1$layoutRandom 77 | ARCBD1$exptNames 78 | ARCBD1$plotNumber 79 | head(ARCBD1$fieldBook, 12) 80 | 81 | # Example 2: Generates an ARCBD with 17 blocks, 4 checks for each, and 350 treatments 82 | # in 3 locations. 83 | # In this case, we show how to use the option data. 84 | checks <- 4; 85 | list_checks <- paste("CH", 1:checks, sep = "") 86 | treatments <- paste("G", 5:354, sep = "") 87 | treatment_list <- data.frame(list(ENTRY = 1:354, NAME = c(list_checks, treatments))) 88 | head(treatment_list, 12) 89 | ARCBD2 <- RCBD_augmented(lines = 350, checks = 4, b = 17, l = 3, 90 | planter = "serpentine", 91 | plotNumber = c(101,1001,2001), 92 | seed = 24, 93 | locationNames = LETTERS[1:3], 94 | data = treatment_list) 95 | ARCBD2$infoDesign 96 | ARCBD2$layoutRandom 97 | ARCBD2$exptNames 98 | ARCBD2$plotNumber 99 | head(ARCBD2$fieldBook, 12) 100 | 101 | } 102 | \references{ 103 | Federer, W. T. (1955). Experimental Design. Theory and Application. New York, USA. The 104 | Macmillan Company. 105 | } 106 | \author{ 107 | Didier Murillo [aut], 108 | Salvador Gezan [aut], 109 | Ana Heilman [ctb], 110 | Thomas Walk [ctb], 111 | Johan Aparicio [ctb], 112 | Richard Horsley [ctb] 113 | } 114 | -------------------------------------------------------------------------------- /data/Diagonal_Single_15x20.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 301,A 3 | 302,B 4 | 303,C 5 | 304,D 6 | 305,ND-305 7 | 306,ND-306 8 | 307,ND-307 9 | 308,ND-308 10 | 309,ND-309 11 | 310,ND-310 12 | 311,ND-311 13 | 312,ND-312 14 | 313,ND-313 15 | 314,ND-314 16 | 315,ND-315 17 | 316,ND-316 18 | 317,ND-317 19 | 318,ND-318 20 | 319,ND-319 21 | 320,ND-320 22 | 321,ND-321 23 | 322,ND-322 24 | 323,ND-323 25 | 324,ND-324 26 | 325,ND-325 27 | 326,ND-326 28 | 327,ND-327 29 | 328,ND-328 30 | 329,ND-329 31 | 330,ND-330 32 | 331,ND-331 33 | 332,ND-332 34 | 333,ND-333 35 | 334,ND-334 36 | 335,ND-335 37 | 336,ND-336 38 | 337,ND-337 39 | 338,ND-338 40 | 339,ND-339 41 | 340,ND-340 42 | 341,ND-341 43 | 342,ND-342 44 | 343,ND-343 45 | 344,ND-344 46 | 345,ND-345 47 | 346,ND-346 48 | 347,ND-347 49 | 348,ND-348 50 | 349,ND-349 51 | 350,ND-350 52 | 351,ND-351 53 | 352,ND-352 54 | 353,ND-353 55 | 354,ND-354 56 | 355,ND-355 57 | 356,ND-356 58 | 357,ND-357 59 | 358,ND-358 60 | 359,ND-359 61 | 360,ND-360 62 | 361,ND-361 63 | 362,ND-362 64 | 363,ND-363 65 | 364,ND-364 66 | 365,ND-365 67 | 366,ND-366 68 | 367,ND-367 69 | 368,ND-368 70 | 369,ND-369 71 | 370,ND-370 72 | 371,ND-371 73 | 372,ND-372 74 | 373,ND-373 75 | 374,ND-374 76 | 375,ND-375 77 | 376,ND-376 78 | 377,ND-377 79 | 378,ND-378 80 | 379,ND-379 81 | 380,ND-380 82 | 381,ND-381 83 | 382,ND-382 84 | 383,ND-383 85 | 384,ND-384 86 | 385,ND-385 87 | 386,ND-386 88 | 387,ND-387 89 | 388,ND-388 90 | 389,ND-389 91 | 390,ND-390 92 | 391,ND-391 93 | 392,ND-392 94 | 393,ND-393 95 | 394,ND-394 96 | 395,ND-395 97 | 396,ND-396 98 | 397,ND-397 99 | 398,ND-398 100 | 399,ND-399 101 | 400,ND-400 102 | 401,ND-401 103 | 402,ND-402 104 | 403,ND-403 105 | 404,ND-404 106 | 405,ND-405 107 | 406,ND-406 108 | 407,ND-407 109 | 408,ND-408 110 | 409,ND-409 111 | 410,ND-410 112 | 411,ND-411 113 | 412,ND-412 114 | 413,ND-413 115 | 414,ND-414 116 | 415,ND-415 117 | 416,ND-416 118 | 417,ND-417 119 | 418,ND-418 120 | 419,ND-419 121 | 420,ND-420 122 | 421,ND-421 123 | 422,ND-422 124 | 423,ND-423 125 | 424,ND-424 126 | 425,ND-425 127 | 426,ND-426 128 | 427,ND-427 129 | 428,ND-428 130 | 429,ND-429 131 | 430,ND-430 132 | 431,ND-431 133 | 432,ND-432 134 | 433,ND-433 135 | 434,ND-434 136 | 435,ND-435 137 | 436,ND-436 138 | 437,ND-437 139 | 438,ND-438 140 | 439,ND-439 141 | 440,ND-440 142 | 441,ND-441 143 | 442,ND-442 144 | 443,ND-443 145 | 444,ND-444 146 | 445,ND-445 147 | 446,ND-446 148 | 447,ND-447 149 | 448,ND-448 150 | 449,ND-449 151 | 450,ND-450 152 | 451,ND-451 153 | 452,ND-452 154 | 453,ND-453 155 | 454,ND-454 156 | 455,ND-455 157 | 456,ND-456 158 | 457,ND-457 159 | 458,ND-458 160 | 459,ND-459 161 | 460,ND-460 162 | 461,ND-461 163 | 462,ND-462 164 | 463,ND-463 165 | 464,ND-464 166 | 465,ND-465 167 | 466,ND-466 168 | 467,ND-467 169 | 468,ND-468 170 | 469,ND-469 171 | 470,ND-470 172 | 471,ND-471 173 | 472,ND-472 174 | 473,ND-473 175 | 474,ND-474 176 | 475,ND-475 177 | 476,ND-476 178 | 477,ND-477 179 | 478,ND-478 180 | 479,ND-479 181 | 480,ND-480 182 | 481,ND-481 183 | 482,ND-482 184 | 483,ND-483 185 | 484,ND-484 186 | 485,ND-485 187 | 486,ND-486 188 | 487,ND-487 189 | 488,ND-488 190 | 489,ND-489 191 | 490,ND-490 192 | 491,ND-491 193 | 492,ND-492 194 | 493,ND-493 195 | 494,ND-494 196 | 495,ND-495 197 | 496,ND-496 198 | 497,ND-497 199 | 498,ND-498 200 | 499,ND-499 201 | 500,ND-500 202 | 501,ND-501 203 | 502,ND-502 204 | 503,ND-503 205 | 504,ND-504 206 | 505,ND-505 207 | 506,ND-506 208 | 507,ND-507 209 | 508,ND-508 210 | 509,ND-509 211 | 510,ND-510 212 | 511,ND-511 213 | 512,ND-512 214 | 513,ND-513 215 | 514,ND-514 216 | 515,ND-515 217 | 516,ND-516 218 | 517,ND-517 219 | 518,ND-518 220 | 519,ND-519 221 | 520,ND-520 222 | 521,ND-521 223 | 522,ND-522 224 | 523,ND-523 225 | 524,ND-524 226 | 525,ND-525 227 | 526,ND-526 228 | 527,ND-527 229 | 528,ND-528 230 | 529,ND-529 231 | 530,ND-530 232 | 531,ND-531 233 | 532,ND-532 234 | 533,ND-533 235 | 534,ND-534 236 | 535,ND-535 237 | 536,ND-536 238 | 537,ND-537 239 | 538,ND-538 240 | 539,ND-539 241 | 540,ND-540 242 | 541,ND-541 243 | 542,ND-542 244 | 543,ND-543 245 | 544,ND-544 246 | 545,ND-545 247 | 546,ND-546 248 | 547,ND-547 249 | 548,ND-548 250 | 549,ND-549 251 | 550,ND-550 252 | 551,ND-551 253 | 552,ND-552 254 | 553,ND-553 255 | 554,ND-554 256 | 555,ND-555 257 | 556,ND-556 258 | 557,ND-557 259 | 558,ND-558 260 | 559,ND-559 261 | 560,ND-560 262 | 561,ND-561 263 | 562,ND-562 264 | 563,ND-563 265 | 564,ND-564 266 | -------------------------------------------------------------------------------- /data/Diagonal_260_treatments_4_checks.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 301,A 3 | 302,B 4 | 303,C 5 | 304,D 6 | 305,ND-305 7 | 306,ND-306 8 | 307,ND-307 9 | 308,ND-308 10 | 309,ND-309 11 | 310,ND-310 12 | 311,ND-311 13 | 312,ND-312 14 | 313,ND-313 15 | 314,ND-314 16 | 315,ND-315 17 | 316,ND-316 18 | 317,ND-317 19 | 318,ND-318 20 | 319,ND-319 21 | 320,ND-320 22 | 321,ND-321 23 | 322,ND-322 24 | 323,ND-323 25 | 324,ND-324 26 | 325,ND-325 27 | 326,ND-326 28 | 327,ND-327 29 | 328,ND-328 30 | 329,ND-329 31 | 330,ND-330 32 | 331,ND-331 33 | 332,ND-332 34 | 333,ND-333 35 | 334,ND-334 36 | 335,ND-335 37 | 336,ND-336 38 | 337,ND-337 39 | 338,ND-338 40 | 339,ND-339 41 | 340,ND-340 42 | 341,ND-341 43 | 342,ND-342 44 | 343,ND-343 45 | 344,ND-344 46 | 345,ND-345 47 | 346,ND-346 48 | 347,ND-347 49 | 348,ND-348 50 | 349,ND-349 51 | 350,ND-350 52 | 351,ND-351 53 | 352,ND-352 54 | 353,ND-353 55 | 354,ND-354 56 | 355,ND-355 57 | 356,ND-356 58 | 357,ND-357 59 | 358,ND-358 60 | 359,ND-359 61 | 360,ND-360 62 | 361,ND-361 63 | 362,ND-362 64 | 363,ND-363 65 | 364,ND-364 66 | 365,ND-365 67 | 366,ND-366 68 | 367,ND-367 69 | 368,ND-368 70 | 369,ND-369 71 | 370,ND-370 72 | 371,ND-371 73 | 372,ND-372 74 | 373,ND-373 75 | 374,ND-374 76 | 375,ND-375 77 | 376,ND-376 78 | 377,ND-377 79 | 378,ND-378 80 | 379,ND-379 81 | 380,ND-380 82 | 381,ND-381 83 | 382,ND-382 84 | 383,ND-383 85 | 384,ND-384 86 | 385,ND-385 87 | 386,ND-386 88 | 387,ND-387 89 | 388,ND-388 90 | 389,ND-389 91 | 390,ND-390 92 | 391,ND-391 93 | 392,ND-392 94 | 393,ND-393 95 | 394,ND-394 96 | 395,ND-395 97 | 396,ND-396 98 | 397,ND-397 99 | 398,ND-398 100 | 399,ND-399 101 | 400,ND-400 102 | 401,ND-401 103 | 402,ND-402 104 | 403,ND-403 105 | 404,ND-404 106 | 405,ND-405 107 | 406,ND-406 108 | 407,ND-407 109 | 408,ND-408 110 | 409,ND-409 111 | 410,ND-410 112 | 411,ND-411 113 | 412,ND-412 114 | 413,ND-413 115 | 414,ND-414 116 | 415,ND-415 117 | 416,ND-416 118 | 417,ND-417 119 | 418,ND-418 120 | 419,ND-419 121 | 420,ND-420 122 | 421,ND-421 123 | 422,ND-422 124 | 423,ND-423 125 | 424,ND-424 126 | 425,ND-425 127 | 426,ND-426 128 | 427,ND-427 129 | 428,ND-428 130 | 429,ND-429 131 | 430,ND-430 132 | 431,ND-431 133 | 432,ND-432 134 | 433,ND-433 135 | 434,ND-434 136 | 435,ND-435 137 | 436,ND-436 138 | 437,ND-437 139 | 438,ND-438 140 | 439,ND-439 141 | 440,ND-440 142 | 441,ND-441 143 | 442,ND-442 144 | 443,ND-443 145 | 444,ND-444 146 | 445,ND-445 147 | 446,ND-446 148 | 447,ND-447 149 | 448,ND-448 150 | 449,ND-449 151 | 450,ND-450 152 | 451,ND-451 153 | 452,ND-452 154 | 453,ND-453 155 | 454,ND-454 156 | 455,ND-455 157 | 456,ND-456 158 | 457,ND-457 159 | 458,ND-458 160 | 459,ND-459 161 | 460,ND-460 162 | 461,ND-461 163 | 462,ND-462 164 | 463,ND-463 165 | 464,ND-464 166 | 465,ND-465 167 | 466,ND-466 168 | 467,ND-467 169 | 468,ND-468 170 | 469,ND-469 171 | 470,ND-470 172 | 471,ND-471 173 | 472,ND-472 174 | 473,ND-473 175 | 474,ND-474 176 | 475,ND-475 177 | 476,ND-476 178 | 477,ND-477 179 | 478,ND-478 180 | 479,ND-479 181 | 480,ND-480 182 | 481,ND-481 183 | 482,ND-482 184 | 483,ND-483 185 | 484,ND-484 186 | 485,ND-485 187 | 486,ND-486 188 | 487,ND-487 189 | 488,ND-488 190 | 489,ND-489 191 | 490,ND-490 192 | 491,ND-491 193 | 492,ND-492 194 | 493,ND-493 195 | 494,ND-494 196 | 495,ND-495 197 | 496,ND-496 198 | 497,ND-497 199 | 498,ND-498 200 | 499,ND-499 201 | 500,ND-500 202 | 501,ND-501 203 | 502,ND-502 204 | 503,ND-503 205 | 504,ND-504 206 | 505,ND-505 207 | 506,ND-506 208 | 507,ND-507 209 | 508,ND-508 210 | 509,ND-509 211 | 510,ND-510 212 | 511,ND-511 213 | 512,ND-512 214 | 513,ND-513 215 | 514,ND-514 216 | 515,ND-515 217 | 516,ND-516 218 | 517,ND-517 219 | 518,ND-518 220 | 519,ND-519 221 | 520,ND-520 222 | 521,ND-521 223 | 522,ND-522 224 | 523,ND-523 225 | 524,ND-524 226 | 525,ND-525 227 | 526,ND-526 228 | 527,ND-527 229 | 528,ND-528 230 | 529,ND-529 231 | 530,ND-530 232 | 531,ND-531 233 | 532,ND-532 234 | 533,ND-533 235 | 534,ND-534 236 | 535,ND-535 237 | 536,ND-536 238 | 537,ND-537 239 | 538,ND-538 240 | 539,ND-539 241 | 540,ND-540 242 | 541,ND-541 243 | 542,ND-542 244 | 543,ND-543 245 | 544,ND-544 246 | 545,ND-545 247 | 546,ND-546 248 | 547,ND-547 249 | 548,ND-548 250 | 549,ND-549 251 | 550,ND-550 252 | 551,ND-551 253 | 552,ND-552 254 | 553,ND-553 255 | 554,ND-554 256 | 555,ND-555 257 | 556,ND-556 258 | 557,ND-557 259 | 558,ND-558 260 | 559,ND-559 261 | 560,ND-560 262 | 561,ND-561 263 | 562,ND-562 264 | 563,ND-563 265 | 564,ND-564 266 | -------------------------------------------------------------------------------- /data/Diagonal_260_treatments_4_checks2.csv: -------------------------------------------------------------------------------- 1 | ENTRY,NAME 2 | 301,A 3 | 302,B 4 | 303,C 5 | 304,D 6 | 305,ND-305 7 | 306,ND-306 8 | 307,ND-307 9 | 308,ND-308 10 | 309,ND-309 11 | 310,ND-310 12 | 311,ND-311 13 | 312,ND-312 14 | 313,ND-313 15 | 314,ND-314 16 | 315,ND-315 17 | 316,ND-316 18 | 317,ND-317 19 | 318,ND-318 20 | 319,ND-319 21 | 320,ND-320 22 | 321,ND-321 23 | 322,ND-322 24 | 323,ND-323 25 | 324,ND-324 26 | 325,ND-325 27 | 326,ND-326 28 | 327,ND-327 29 | 328,ND-328 30 | 329,ND-329 31 | 330,ND-330 32 | 331,ND-331 33 | 332,ND-332 34 | 333,ND-333 35 | 334,ND-334 36 | 335,ND-335 37 | 336,ND-336 38 | 337,ND-337 39 | 338,ND-338 40 | 339,ND-339 41 | 340,ND-340 42 | 341,ND-341 43 | 342,ND-342 44 | 343,ND-343 45 | 344,ND-344 46 | 345,ND-345 47 | 346,ND-346 48 | 347,ND-347 49 | 348,ND-348 50 | 349,ND-349 51 | 350,ND-350 52 | 351,ND-351 53 | 352,ND-352 54 | 353,ND-353 55 | 354,ND-354 56 | 355,ND-355 57 | 356,ND-356 58 | 357,ND-357 59 | 358,ND-358 60 | 359,ND-359 61 | 360,ND-360 62 | 361,ND-361 63 | 362,ND-362 64 | 363,ND-363 65 | 364,ND-364 66 | 365,ND-365 67 | 366,ND-366 68 | 367,ND-367 69 | 368,ND-368 70 | 369,ND-369 71 | 370,ND-370 72 | 371,ND-371 73 | 372,ND-372 74 | 373,ND-373 75 | 374,ND-374 76 | 375,ND-375 77 | 376,ND-376 78 | 377,ND-377 79 | 378,ND-378 80 | 379,ND-379 81 | 380,ND-380 82 | 381,ND-381 83 | 382,ND-382 84 | 383,ND-383 85 | 384,ND-384 86 | 385,ND-385 87 | 386,ND-386 88 | 387,ND-387 89 | 388,ND-388 90 | 389,ND-389 91 | 390,ND-390 92 | 391,ND-391 93 | 392,ND-392 94 | 393,ND-393 95 | 394,ND-394 96 | 395,ND-395 97 | 396,ND-396 98 | 397,ND-397 99 | 398,ND-398 100 | 399,ND-399 101 | 400,ND-400 102 | 401,ND-401 103 | 402,ND-402 104 | 403,ND-403 105 | 404,ND-404 106 | 405,ND-405 107 | 406,ND-406 108 | 407,ND-407 109 | 408,ND-408 110 | 409,ND-409 111 | 410,ND-410 112 | 411,ND-411 113 | 412,ND-412 114 | 413,ND-413 115 | 414,ND-414 116 | 415,ND-415 117 | 416,ND-416 118 | 417,ND-417 119 | 418,ND-418 120 | 419,ND-419 121 | 420,ND-420 122 | 421,ND-421 123 | 422,ND-422 124 | 423,ND-423 125 | 424,ND-424 126 | 425,ND-425 127 | 426,ND-426 128 | 427,ND-427 129 | 428,ND-428 130 | 429,ND-429 131 | 430,ND-430 132 | 431,ND-431 133 | 432,ND-432 134 | 433,ND-433 135 | 434,ND-434 136 | 435,ND-435 137 | 436,ND-436 138 | 437,ND-437 139 | 438,ND-438 140 | 439,ND-439 141 | 440,ND-440 142 | 441,ND-441 143 | 442,ND-442 144 | 443,ND-443 145 | 444,ND-444 146 | 445,ND-445 147 | 446,ND-446 148 | 447,ND-447 149 | 448,ND-448 150 | 449,ND-449 151 | 450,ND-450 152 | 451,ND-451 153 | 452,ND-452 154 | 453,ND-453 155 | 454,ND-454 156 | 455,ND-455 157 | 456,ND-456 158 | 457,ND-457 159 | 458,ND-458 160 | 459,ND-459 161 | 460,ND-460 162 | 461,ND-461 163 | 462,ND-462 164 | 463,ND-463 165 | 464,ND-464 166 | 465,ND-465 167 | 466,ND-466 168 | 467,ND-467 169 | 468,ND-468 170 | 469,ND-469 171 | 470,ND-470 172 | 471,ND-471 173 | 472,ND-472 174 | 473,ND-473 175 | 474,ND-474 176 | 475,ND-475 177 | 476,ND-476 178 | 477,ND-477 179 | 478,ND-478 180 | 479,ND-479 181 | 480,ND-480 182 | 481,ND-481 183 | 482,ND-482 184 | 483,ND-483 185 | 484,ND-484 186 | 485,ND-485 187 | 486,ND-486 188 | 487,ND-487 189 | 488,ND-488 190 | 489,ND-489 191 | 490,ND-490 192 | 491,ND-491 193 | 492,ND-492 194 | 493,ND-493 195 | 494,ND-494 196 | 495,ND-495 197 | 496,ND-496 198 | 497,ND-497 199 | 498,ND-498 200 | 499,ND-499 201 | 500,ND-500 202 | 501,ND-501 203 | 502,ND-502 204 | 503,ND-503 205 | 504,ND-504 206 | 505,ND-505 207 | 506,ND-506 208 | 507,ND-507 209 | 508,ND-508 210 | 509,ND-509 211 | 510,ND-510 212 | 511,ND-511 213 | 512,ND-512 214 | 513,ND-513 215 | 514,ND-514 216 | 515,ND-515 217 | 516,ND-516 218 | 517,ND-517 219 | 518,ND-518 220 | 519,ND-519 221 | 520,ND-520 222 | 521,ND-521 223 | 522,ND-522 224 | 523,ND-523 225 | 524,ND-524 226 | 525,ND-525 227 | 526,ND-526 228 | 527,ND-527 229 | 528,ND-528 230 | 529,ND-529 231 | 530,ND-530 232 | 531,ND-531 233 | 532,ND-532 234 | 533,ND-533 235 | 534,ND-534 236 | 535,ND-535 237 | 536,ND-536 238 | 537,ND-537 239 | 538,ND-538 240 | 539,ND-539 241 | 540,ND-540 242 | 541,ND-541 243 | 542,ND-542 244 | 543,ND-543 245 | 544,ND-544 246 | 545,ND-545 247 | 546,ND-546 248 | 547,ND-547 249 | 548,ND-548 250 | 549,ND-549 251 | 550,ND-550 252 | 551,ND-551 253 | 552,ND-552 254 | 553,ND-553 255 | 554,ND-554 256 | 555,ND-555 257 | 556,ND-556 258 | 557,ND-557 259 | 558,ND-558 260 | 559,ND-559 261 | 560,ND-560 262 | 561,ND-561 263 | 562,ND-562 264 | 563,ND-563 265 | 564,ND-564 266 | --------------------------------------------------------------------------------