R/design_split.R

Defines functions design_split

Documented in design_split

#' Split-plot experimental designs
#'
#' Dispatch split-plot experimental designs.
#'
#' @param nfactors Number of factors in the experiment.
#' @param factors List with factor levels.
#' @param type Split-plot design type.
#' @param rep Number of replications.
#' @param zigzag Field layout in zigzag.
#' @param nrows Experimental design dimension by rows.
#' @param serie Number to start the plot id.
#' @param seed Seed for randomization.
#' @param project Barcode prefix.
#' @param qrcode String to concatenate the QR code.
#'
#' @return A list with the fieldbook design and parameters.
#'
#' @export

design_split <- function(
    nfactors = 2,
    factors,
    type = "split-rcbd",
    rep = 3,
    zigzag = FALSE,
    nrows = NA,
    serie = 1000,
    seed = NULL,
    project = "inkaverse",
    qrcode = "{project}{plots}{factors}"
) {
  
  type <- normalize_tarpuy_design_type(
    type
  )
  
  if(type == "split-rcbd") {
    
    return(
      design_split_rcbd(
        nfactors = nfactors,
        factors = factors,
        type = type,
        rep = rep,
        zigzag = zigzag,
        nrows = nrows,
        serie = serie,
        seed = seed,
        project = project,
        qrcode = qrcode
      )
    )
  }
  
  stop("Split design type not implemented.")
}

Try the inti package in your browser

Any scripts or data that you put into this service are public.

inti documentation built on Aug. 20, 2026, 5:08 p.m.