Create a set of plots from a list of Accessions (ordered by plot) and basic layout properties. The plots will start in the top left corner and move across rows and down columns. Blocks will increment in the same order as plots. If `zig_zag` is set to TRUE then rows will alternate the direction of plot numbers.

createPlots(
  trial_name = NULL,
  accessions = NULL,
  max_cols = NULL,
  max_cols_per_block = NULL,
  max_rows_per_block = NULL,
  rep_equals_block = TRUE,
  max_plots_per_rep = NULL,
  zig_zag = FALSE,
  controls = c()
)

Arguments

trial_name

The trial name or Trial to be used for plot names (TRIAL_PLOT#)

accessions

List of Accessions or Accession names in plot order (moving across rows)

max_cols

(optional, default = no max) The maximum number of columns (plots) in a row

max_cols_per_block

(optional, default = no max) The maximum number of columns in a block

max_rows_per_block

(optional, default = no max) The maximum number of rows in a block

rep_equals_block

(optional, default = TRUE) When set, the rep number will be set as the block number

max_plots_per_rep

(optional, default = no max) When set, `rep_equals_block` is FALSE and the rep number will increment after each set of max plots

zig_zag

(optional, default = FALSE) When TRUE, rows will alternate direction (left to right, right to left, etc)

controls

(optional, default = none) A vector of plot numbers or accession names that will be used as controls

Value

vector of Plots

Examples

# When given a list of 18 accessions (ACC_A -> ACC_R), a max_cols of `6` 
# and a max_cols_per_block of `3`, the following plots will be generated:
#     
#         COL 1   COL 2   COL 3   COL 4   COL 5   COL 6
# ROW 1   #1      #2      #3      #4      #5      #6
#         ACC_A   ACC_B   ACC_C   ACC_D   ACC_E   ACC_F
#         BLK 1   BLK 1   BLK 1   BLK 2   BLK 2   BLK 2
# 
# ROW 2   #7      #8      #9      #10     #11     #12
#         ACC_G   ACC_H   ACC_I   ACC_J   ACC_K   ACC_L
#         BLK 1   BLK 1   BLK 1   BLK 2   BLK 2   BLK 2
# 
# ROW 3   #13     #14     #15     #16     #17     #18
#         ACC_M   ACC_N   ACC_O   ACC_P   ACC_Q   ACC_R
#         BLK 1   BLK 1   BLK 1   BLK 2   BLK 2   BLK 2
accessions <- lapply(LETTERS[c(1:18)], function(x) {Accession(paste0("ACC_", x), "Saccharina latissima")})
plots <- createPlots("TEST_TRIAL", accessions, max_cols = 6, max_cols_per_block = 3)