R/seq_patterson_lucas.R

Defines functions seq_patterson_lucas

Documented in seq_patterson_lucas

#' Patterson and Lucas (1962) cross-over design specification
#'
#' Specifies cross-over designs from Patterson and Lucas (1962).
#'
#' \code{seq_patterson_lucas()} supports the specification of designs from
#' Patterson and Lucas (1962). Designs for three through nine treatments (see
#' \code{D}) are supported, for any chosen treatment labels (see \code{labels}).
#' In addition, the designs can be returned in \code{\link[base]{matrix}} or
#' \code{\link[tibble]{tibble}} form (see \code{as_matrix}).
#'
#' Precisely, designs are indexed using the argument \code{selection}, which can
#' take the following values for the following numbers of treatments:
#'
#' \itemize{
#' \item \code{D = 3}: 1, 30, and 31;
#' \item \code{D = 4}: 3-5, 32-35, and 153;
#' \item \code{D = 5}: 7-10, 18, 36-40, 125, 126, 131, 132, and 154;
#' \item \code{D = 6}: 12, 13, 15, 41, 42, 99-101, 133-135, and 155;
#' \item \code{D = 7}: 16, 17, 19-23, 43-49, and 86;
#' \item \code{D = 8}: 102-105, 136-138, and 156;
#' \item \code{D = 9}: 106, 107, 127, 128, and 139-141.
#' }
#'
#' Ultimately, the \ifelse{html}{\out{(<i>k</i>,<i>j</i>)}}{\eqn{(k,j)}}th
#' element of the cross-over design matrix corresponds to the treatment a
#' subject on the \ifelse{html}{\out{<i>k</i>}}{\eqn{k}}th sequence would
#' receive in the \ifelse{html}{\out{<i>j</i>}}{\eqn{j}}th period.
#'
#' @param selection A single \code{\link[base]{numeric}} integer indicating
#' which design to return. See \strong{Details} for information on supported
#' values.
#' @param labels A \code{\link[base]{vector}} of labels for the treatments.
#' If specified, should have \code{\link[base]{length}} corresponding to the
#' number of treatments in the chosen design, containing unique elements. If
#' missing, will internally default to \code{0:(D - 1)}, where \code{D} is the
#' number of treatments.
#' @param as_matrix A \code{\link[base]{logical}} variable indicating whether
#' the design should be returned as a \code{\link[base]{matrix}}, or a
#' \code{\link[tibble]{tibble}}. Defaults to \code{T}.
#' @return Either a \code{\link[base]{matrix}} if \code{as_matrix = T} (with
#' rows corresponding to sequences and columns to periods), or a
#' \code{\link[tibble]{tibble}} if \code{as_matrix = F} (with rows corresponding
#' to a particular period on a particular sequence). In either case, the
#' returned object will have class \code{xover_seq}.
#' @examples
#' # Patterson and Lucas (1962) designs for three treatments
#' patterson_lucas1         <- seq_patterson_lucas()
#' patterson_lucas30        <- seq_patterson_lucas(selection = 30)
#' patterson_lucas31        <- seq_patterson_lucas(selection = 31)
#' # Using different labels
#' patterson_lucas1_ABC     <- seq_patterson_lucas(labels = LETTERS[1:3])
#' patterson_lucas30_ABC    <- seq_patterson_lucas(selection = 30,
#'                                                 labels = LETTERS[1:3])
#' patterson_lucas31_ABC    <- seq_patterson_lucas(selection = 31,
#'                                                  labels = LETTERS[1:3])
#' # Returning in tibble form
#' patterson_lucas1_tibble  <- seq_patterson_lucas(as_matrix = F)
#' patterson_lucas30_tibble <- seq_patterson_lucas(selection = 30,
#' as_matrix = F)
#' patterson_lucas31_tibble <- seq_patterson_lucas(selection = 31,
#'                                                 as_matrix = F)
#' @references Patterson HD, Lucas HL (1962) Change-over designs. \emph{North
#' Carolina Agricultural Experiment Station}. Tech Bull 147.
#' @author Based on data from the \code{\link[Crossover]{Crossover}} package by
#' Kornelius Rohmeyer.
#' @export
seq_patterson_lucas <- function(selection = 1, labels, as_matrix = T,
                                summary = T) {

  ##### Input checking #########################################################

  if (!(selection %in% c(1, 3:5, 7:10, 12, 13, 15:23, 30:49, 86, 99:107,
                         125:128, 131:141, 153:156))) {
    stop("selection must be one of 1, 3-5, 7-10, 12, 13, 15-23, 30-49, 86, ",
         "99-107, 125-128, 131-141, or 153-156")
  }
  check_logical(as_matrix, "as_matrix")
  check_logical(summary, "summary")

  ##### Main computations ######################################################

  if (summary) {
    message("   Beginning the design specification...")
  }
  if (selection == 1) {
    sequences <- matrix(c(1, 2, 2, 3, 3, 1, 1, 3, 2, 1, 3, 2), 6, 2, byrow = T)
  } else if (selection == 3) {
    sequences <- matrix(c(1, 2, 2, 1, 3, 4, 4, 3, 1, 3, 2, 4, 3, 1, 4, 2, 1, 4,
                          2, 3, 3, 2, 4, 1), 12, 2, byrow = T)
  } else if (selection == 4) {
    sequences <- matrix(c(1, 2, 3, 2, 1, 4, 3, 4, 1, 4, 3, 2, 1, 3, 4, 2, 4, 3,
                          3, 1, 2, 4, 2, 1, 1, 4, 2, 2, 3, 1, 3, 2, 4, 4, 1, 3),
                        12, 3, byrow = T)
  } else if (selection == 5) {
    sequences <- matrix(c(1, 2, 3, 4, 2, 4, 1, 3, 3, 1, 4, 2, 4, 3, 2, 1), 4, 4,
                        byrow = T)
  } else if (selection == 7) {
    sequences <- matrix(c(1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 1, 3, 2, 4, 3, 5, 4, 1,
                          5, 2, 1, 4, 2, 5, 3, 1, 4, 2, 5, 3, 1, 5, 2, 1, 3, 2,
                          4, 3, 5, 4), 20, 2, byrow = T)
  } else if (selection == 8) {
    sequences <- matrix(c(1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 1, 5, 1, 2, 1, 3, 5,
                          2, 4, 1, 3, 5, 2, 4, 1, 3, 5, 2, 4, 1, 4, 2, 2, 5, 3,
                          3, 1, 4, 4, 2, 5, 5, 3, 1, 1, 5, 4, 2, 1, 5, 3, 2, 1,
                          4, 3, 2, 5, 4, 3), 20, 3, byrow = T)
  } else if (selection == 9) {
    sequences <- matrix(c(1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 1, 4, 5, 1, 2, 5, 1,
                          2, 3, 1, 3, 5, 2, 2, 4, 1, 3, 3, 5, 2, 4, 4, 1, 3, 5,
                          5, 2, 4, 1, 1, 4, 2, 5, 2, 5, 3, 1, 3, 1, 4, 2, 4, 2,
                          5, 3, 5, 3, 1, 4, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5,
                          4, 3, 2, 1, 5, 4, 3, 2), 20, 4, byrow = T)
  } else if (selection == 10) {
    sequences <- matrix(c(1, 2, 5, 3, 4, 2, 3, 1, 4, 5, 3, 4, 2, 5, 1, 4, 5, 3,
                          1, 2, 5, 1, 4, 2, 3, 1, 5, 2, 4, 3, 2, 1, 3, 5, 4, 3,
                          2, 4, 1, 5, 4, 3, 5, 2, 1, 5, 4, 1, 3, 2), 10, 5,
                        byrow = T)
  } else if (selection == 12) {
    sequences <- matrix(c(1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 1, 1, 3, 2, 4, 3, 5,
                          4, 6, 5, 1, 6, 2, 1, 4, 2, 5, 3, 6, 4, 1, 5, 2, 6, 3,
                          1, 5, 2, 6, 3, 1, 4, 2, 5, 3, 6, 4, 1, 6, 2, 1, 3, 2,
                          4, 3, 5, 4, 6, 5), 30, 2, byrow = T)
  } else if (selection == 13) {
    sequences <- matrix(c(1, 2, 3, 6, 4, 2, 3, 4, 1, 5, 3, 4, 5, 2, 6, 4, 5, 6,
                          3, 1, 5, 6, 1, 4, 2, 6, 1, 2, 5, 3, 1, 3, 4, 6, 5, 2,
                          4, 5, 1, 6, 3, 5, 6, 2, 1, 4, 6, 1, 3, 2, 5, 1, 2, 4,
                          3, 6, 2, 3, 5, 4, 1, 4, 5, 3, 2, 2, 5, 6, 4, 3, 3, 6,
                          1, 5, 4, 4, 1, 2, 6, 5, 5, 2, 3, 1, 6, 6, 3, 4, 2, 1,
                          1, 5, 3, 6, 2, 2, 6, 4, 1, 3, 3, 1, 5, 2, 4, 4, 2, 6,
                          3, 5, 5, 3, 1, 4, 6, 6, 4, 2, 5, 1, 1, 6, 2, 5, 4, 2,
                          1, 3, 6, 5, 3, 2, 4, 1, 6, 4, 3, 5, 2, 1, 5, 4, 6, 3,
                          2, 6, 5, 1, 4, 3), 30, 5, byrow = T)
  } else if (selection == 15) {
    sequences <- matrix(c(1, 2, 3, 6, 4, 5, 2, 3, 4, 1, 5, 6, 3, 4, 5, 2, 6, 1,
                          4, 5, 6, 3, 1, 2, 5, 6, 1, 4, 2, 3, 6, 1, 2, 5, 3, 4,
                          1, 3, 4, 6, 5, 2, 2, 4, 5, 1, 6, 3, 3, 5, 6, 2, 1, 4,
                          4, 6, 1, 3, 2, 5, 5, 1, 2, 4, 3, 6, 6, 2, 3, 5, 4, 1,
                          1, 4, 5, 3, 2, 6, 2, 5, 6, 4, 3, 1, 3, 6, 1, 5, 4, 2,
                          4, 1, 2, 6, 5, 3, 5, 2, 3, 1, 6, 4, 6, 3, 4, 2, 1, 5,
                          1, 5, 3, 6, 2, 4, 2, 6, 4, 1, 3, 5, 3, 1, 5, 2, 4, 6,
                          4, 2, 6, 3, 5, 1, 5, 3, 1, 4, 6, 2, 6, 4, 2, 5, 1, 3,
                          1, 6, 2, 5, 4, 3, 2, 1, 3, 6, 5, 4, 3, 2, 4, 1, 6, 5,
                          4, 3, 5, 2, 1, 6, 5, 4, 6, 3, 2, 1, 6, 5, 1, 4, 3, 2),
                        30, 6, byrow = T)
  } else if (selection == 16) {
    sequences <- matrix(c(1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 1, 1, 3, 2, 4,
                          3, 5, 4, 6, 5, 7, 6, 1, 7, 2, 1, 4, 2, 5, 3, 6, 4, 7,
                          5, 1, 6, 2, 7, 3, 1, 5, 2, 6, 3, 7, 4, 1, 5, 2, 6, 3,
                          7, 4, 1, 6, 2, 7, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 1, 7,
                          2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6), 42, 2, byrow = T)
  } else if (selection == 17) {
    sequences <- matrix(c(1, 2, 5, 2, 3, 6, 3, 4, 7, 4, 5, 1, 5, 6, 2, 6, 7, 3,
                          7, 1, 4, 1, 3, 2, 2, 4, 3, 3, 5, 4, 4, 6, 5, 5, 7, 6,
                          6, 1, 7, 7, 2, 1, 1, 5, 3, 2, 6, 4, 3, 7, 5, 4, 1, 6,
                          5, 2, 7, 6, 3, 1, 7, 4, 2), 21, 3, byrow = T)
  } else if (selection == 18) {
    sequences <- matrix(c(1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 1,
                          7, 1, 2, 1, 3, 5, 2, 4, 6, 3, 5, 7, 4, 6, 1, 5, 7, 2,
                          6, 1, 3, 7, 2, 4, 1, 4, 7, 2, 5, 1, 3, 6, 2, 4, 7, 3,
                          5, 1, 4, 6, 2, 5, 7, 3, 6, 1, 5, 2, 2, 6, 3, 3, 7, 4,
                          4, 1, 5, 5, 2, 6, 6, 3, 7, 7, 4, 1, 1, 6, 4, 2, 7, 5,
                          3, 1, 6, 4, 2, 7, 5, 3, 1, 6, 4, 2, 7, 5, 3, 1, 7, 6,
                          2, 1, 7, 3, 2, 1, 4, 3, 2, 5, 4, 3, 6, 5, 4, 7, 6, 5),
                        42, 3, byrow = T)
  } else if (selection == 19) {
    sequences <- matrix(c(1, 2, 4, 7, 2, 3, 5, 1, 3, 4, 6, 2, 4, 5, 7, 3, 5, 6,
                          1, 4, 6, 7, 2, 5, 7, 1, 3, 6, 1, 7, 5, 2, 2, 1, 6, 3,
                          3, 2, 7, 4, 4, 3, 1, 5, 5, 4, 2, 6, 6, 5, 3, 7, 7, 6,
                          4, 1), 14, 4, byrow = T)
  } else if (selection == 20) {
    sequences <- matrix(c(1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6,
                          7, 1, 6, 7, 1, 2, 7, 1, 2, 3, 1, 3, 5, 7, 2, 4, 6, 1,
                          3, 5, 7, 2, 4, 6, 1, 3, 5, 7, 2, 4, 6, 1, 3, 5, 7, 2,
                          4, 6, 1, 4, 7, 3, 2, 5, 1, 4, 3, 6, 2, 5, 4, 7, 3, 6,
                          5, 1, 4, 7, 6, 2, 5, 1, 7, 3, 6, 2, 1, 5, 2, 6, 2, 6,
                          3, 7, 3, 7, 4, 1, 4, 1, 5, 2, 5, 2, 6, 3, 6, 3, 7, 4,
                          7, 4, 1, 5, 1, 6, 4, 2, 2, 7, 5, 3, 3, 1, 6, 4, 4, 2,
                          7, 5, 5, 3, 1, 6, 6, 4, 2, 7, 7, 5, 3, 1, 1, 7, 6, 5,
                          2, 1, 7, 6, 3, 2, 1, 7, 4, 3, 2, 1, 5, 4, 3, 2, 6, 5,
                          4, 3, 7, 6, 5, 4), 42, 4, byrow = T)
  } else if (selection == 21) {
    sequences <- matrix(c(1, 2, 5, 7, 6, 2, 3, 6, 1, 7, 3, 4, 7, 2, 1, 4, 5, 1,
                          3, 2, 5, 6, 2, 4, 3, 6, 7, 3, 5, 4, 7, 1, 4, 6, 5, 1,
                          3, 2, 6, 4, 2, 4, 3, 7, 5, 3, 5, 4, 1, 6, 4, 6, 5, 2,
                          7, 5, 7, 6, 3, 1, 6, 1, 7, 4, 2, 7, 2, 1, 5, 3, 1, 5,
                          3, 4, 7, 2, 6, 4, 5, 1, 3, 7, 5, 6, 2, 4, 1, 6, 7, 3,
                          5, 2, 7, 1, 4, 6, 3, 1, 2, 5, 7, 4, 2, 3, 6), 21, 5,
                        byrow = T)
  } else if (selection == 22) {
    sequences <- matrix(c(1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 5, 6,
                          7, 1, 5, 6, 7, 1, 2, 6, 7, 1, 2, 3, 7, 1, 2, 3, 4, 1,
                          3, 5, 7, 2, 2, 4, 6, 1, 3, 3, 5, 7, 2, 4, 4, 6, 1, 3,
                          5, 5, 7, 2, 4, 6, 6, 1, 3, 5, 7, 7, 2, 4, 6, 1, 1, 4,
                          7, 3, 6, 2, 5, 1, 4, 7, 3, 6, 2, 5, 1, 4, 7, 3, 6, 2,
                          5, 1, 4, 7, 3, 6, 2, 5, 1, 4, 7, 3, 6, 2, 5, 1, 5, 2,
                          6, 3, 2, 6, 3, 7, 4, 3, 7, 4, 1, 5, 4, 1, 5, 2, 6, 5,
                          2, 6, 3, 7, 6, 3, 7, 4, 1, 7, 4, 1, 5, 2, 1, 6, 4, 2,
                          7, 2, 7, 5, 3, 1, 3, 1, 6, 4, 2, 4, 2, 7, 5, 3, 5, 3,
                          1, 6, 4, 6, 4, 2, 7, 5, 7, 5, 3, 1, 6, 1, 7, 6, 5, 4,
                          2, 1, 7, 6, 5, 3, 2, 1, 7, 6, 4, 3, 2, 1, 7, 5, 4, 3,
                          2, 1, 6, 5, 4, 3, 2, 7, 6, 5, 4, 3), 42, 5, byrow = T)
  } else if (selection == 23) {
    sequences <- matrix(c(1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 1,
                          4, 5, 6, 7, 1, 2, 5, 6, 7, 1, 2, 3, 6, 7, 1, 2, 3, 4,
                          7, 1, 2, 3, 4, 5, 1, 3, 5, 7, 2, 4, 2, 4, 6, 1, 3, 5,
                          3, 5, 7, 2, 4, 6, 4, 6, 1, 3, 5, 7, 5, 7, 2, 4, 6, 1,
                          6, 1, 3, 5, 7, 2, 7, 2, 4, 6, 1, 3, 1, 4, 7, 3, 6, 2,
                          2, 5, 1, 4, 7, 3, 3, 6, 2, 5, 1, 4, 4, 7, 3, 6, 2, 5,
                          5, 1, 4, 7, 3, 6, 6, 2, 5, 1, 4, 7, 7, 3, 6, 2, 5, 1,
                          1, 5, 2, 6, 3, 7, 2, 6, 3, 7, 4, 1, 3, 7, 4, 1, 5, 2,
                          4, 1, 5, 2, 6, 3, 5, 2, 6, 3, 7, 4, 6, 3, 7, 4, 1, 5,
                          7, 4, 1, 5, 2, 6, 1, 6, 4, 2, 7, 5, 2, 7, 5, 3, 1, 6,
                          3, 1, 6, 4, 2, 7, 4, 2, 7, 5, 3, 1, 5, 3, 1, 6, 4, 2,
                          6, 4, 2, 7, 5, 3, 7, 5, 3, 1, 6, 4, 1, 7, 6, 5, 4, 3,
                          2, 1, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 7, 6,
                          5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2),
                        42, 6, byrow = T)
  } else if (selection == 30) {
    sequences <- matrix(c(1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 3, 3, 2, 1, 1, 3, 2, 2),
                        6, 3, byrow = T)
  } else if (selection == 31) {
    sequences <- matrix(c(1, 2, 3, 3, 2, 3, 1, 1, 3, 1, 2, 2, 1, 3, 2, 2, 2, 1,
                          3, 3, 3, 2, 1, 1), 6, 4, byrow = T)
  } else if (selection == 32) {
    sequences <- matrix(c(1, 2, 2, 2, 1, 1, 3, 4, 4, 4, 3, 3, 1, 3, 3, 2, 4, 4,
                          3, 1, 1, 4, 2, 2, 1, 4, 4, 2, 3, 3, 3, 2, 2, 4, 1, 1),
                        12, 3, byrow = T)
  } else if (selection == 33) {
    sequences <- matrix(c(1, 2, 3, 3, 2, 1, 4, 4, 3, 4, 1, 1, 4, 3, 2, 2, 1, 3,
                          4, 4, 2, 4, 3, 3, 3, 1, 2, 2, 4, 2, 1, 1, 1, 4, 2, 2,
                          2, 3, 1, 1, 3, 2, 4, 4, 4, 1, 3, 3), 12, 4, byrow = T)
  } else if (selection == 34) {
    sequences <- matrix(c(1, 2, 3, 4, 4, 2, 4, 1, 3, 3, 3, 1, 4, 2, 2, 4, 3, 2,
                          1, 1), 4, 5, byrow = T)
  } else if (selection == 35) {
    sequences <- matrix(c(1, 2, 3, 4, 4, 2, 1, 4, 3, 3, 3, 4, 1, 2, 2, 4, 3, 2,
                          1, 1, 1, 3, 4, 2, 2, 2, 4, 3, 1, 1, 3, 1, 2, 4, 4, 4,
                          2, 1, 3, 3, 1, 4, 2, 3, 3, 2, 3, 1, 4, 4, 3, 2, 4, 1,
                          1, 4, 1, 3, 2, 2), 12, 5, byrow = T)
  } else if (selection == 36) {
    sequences <- matrix(c(1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 1, 1, 1, 3, 3,
                          2, 4, 4, 3, 5, 5, 4, 1, 1, 5, 2, 2, 1, 4, 4, 2, 5, 5,
                          3, 1, 1, 4, 2, 2, 5, 3, 3, 1, 5, 5, 2, 1, 1, 3, 2, 2,
                          4, 3, 3, 5, 4, 4), 20, 3, byrow = T)
  } else if (selection == 37) {
    sequences <- matrix(c(1, 2, 3, 3, 2, 3, 4, 4, 3, 4, 5, 5, 4, 5, 1, 1, 5, 1,
                          2, 2, 1, 3, 5, 5, 2, 4, 1, 1, 3, 5, 2, 2, 4, 1, 3, 3,
                          5, 2, 4, 4, 1, 4, 2, 2, 2, 5, 3, 3, 3, 1, 4, 4, 4, 2,
                          5, 5, 5, 3, 1, 1, 1, 5, 4, 4, 2, 1, 5, 5, 3, 2, 1, 1,
                          4, 3, 2, 2, 5, 4, 3, 3), 20, 4, byrow = T)
  } else if (selection == 38) {
    sequences <- matrix(c(1, 2, 3, 4, 4, 2, 3, 4, 5, 5, 3, 4, 5, 1, 1, 4, 5, 1,
                          2, 2, 5, 1, 2, 3, 3, 1, 3, 5, 2, 2, 2, 4, 1, 3, 3, 3,
                          5, 2, 4, 4, 4, 1, 3, 5, 5, 5, 2, 4, 1, 1, 1, 4, 2, 5,
                          5, 2, 5, 3, 1, 1, 3, 1, 4, 2, 2, 4, 2, 5, 3, 3, 5, 3,
                          1, 4, 4, 1, 5, 4, 3, 3, 2, 1, 5, 4, 4, 3, 2, 1, 5, 5,
                          4, 3, 2, 1, 1, 5, 4, 3, 2, 2), 20, 5, byrow = T)
  } else if (selection == 39) {
    sequences <- matrix(c(1, 2, 5, 3, 4, 4, 2, 3, 1, 4, 5, 5, 3, 4, 2, 5, 1, 1,
                          4, 5, 3, 1, 2, 2, 5, 1, 4, 2, 3, 3, 1, 5, 2, 4, 3, 3,
                          2, 1, 3, 5, 4, 4, 3, 2, 4, 1, 5, 5, 4, 3, 5, 2, 1, 1,
                          5, 4, 1, 3, 2, 2), 10, 6, byrow = T)
  } else if (selection == 40) {
    sequences <- matrix(c(1, 2, 3, 4, 5, 5, 2, 3, 4, 5, 1, 1, 3, 4, 5, 1, 2, 2,
                          4, 5, 1, 2, 3, 3, 5, 1, 2, 3, 4, 4, 1, 3, 5, 2, 4, 4,
                          2, 4, 1, 3, 5, 5, 3, 5, 2, 4, 1, 1, 4, 1, 3, 5, 2, 2,
                          5, 2, 4, 1, 3, 3, 1, 4, 2, 5, 3, 3, 2, 5, 3, 1, 4, 4,
                          3, 1, 4, 2, 5, 5, 4, 2, 5, 3, 1, 1, 5, 3, 1, 4, 2, 2,
                          1, 5, 4, 3, 2, 2, 2, 1, 5, 4, 3, 3, 3, 2, 1, 5, 4, 4,
                          4, 3, 2, 1, 5, 5, 5, 4, 3, 2, 1, 1), 20, 6, byrow = T)
  } else if (selection == 41) {
    sequences <- matrix(c(1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 1, 1,
                          1, 3, 3, 2, 4, 4, 3, 5, 5, 4, 6, 6, 5, 1, 1, 6, 2, 2,
                          1, 4, 4, 2, 5, 5, 3, 6, 6, 4, 1, 1, 5, 2, 2, 6, 3, 3,
                          1, 5, 5, 2, 6, 6, 3, 1, 1, 4, 2, 2, 5, 3, 3, 6, 4, 4,
                          1, 6, 6, 2, 1, 1, 3, 2, 2, 4, 3, 3, 5, 4, 4, 6, 5, 5),
                        30, 3, byrow = T)
  } else if (selection == 42) {
    sequences <- matrix(c(1, 2, 3, 6, 4, 4, 2, 3, 4, 1, 5, 5, 3, 4, 5, 2, 6, 6,
                          4, 5, 6, 3, 1, 1, 5, 6, 1, 4, 2, 2, 6, 1, 2, 5, 3, 3,
                          1, 3, 4, 6, 5, 5, 2, 4, 5, 1, 6, 6, 3, 5, 6, 2, 1, 1,
                          4, 6, 1, 3, 2, 2, 5, 1, 2, 4, 3, 3, 6, 2, 3, 5, 4, 4,
                          1, 4, 5, 3, 2, 2, 2, 5, 6, 4, 3, 3, 3, 6, 1, 5, 4, 4,
                          4, 1, 2, 6, 5, 5, 5, 2, 3, 1, 6, 6, 6, 3, 4, 2, 1, 1,
                          1, 5, 3, 6, 2, 2, 2, 6, 4, 1, 3, 3, 3, 1, 5, 2, 4, 4,
                          4, 2, 6, 3, 5, 5, 5, 3, 1, 4, 6, 6, 6, 4, 2, 5, 1, 1,
                          1, 6, 2, 5, 4, 4, 2, 1, 3, 6, 5, 5, 3, 2, 4, 1, 6, 6,
                          4, 3, 5, 2, 1, 1, 5, 4, 6, 3, 2, 2, 6, 5, 1, 4, 3, 3),
                        30, 6, byrow = T)
  } else if (selection == 43) {
    sequences <- matrix(c(1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7,
                          7, 1, 1, 1, 3, 3, 2, 4, 4, 3, 5, 5, 4, 6, 6, 5, 7, 7,
                          6, 1, 1, 7, 2, 2, 1, 4, 4, 2, 5, 5, 3, 6, 6, 4, 7, 7,
                          5, 1, 1, 6, 2, 2, 7, 3, 3, 1, 5, 5, 2, 6, 6, 3, 7, 7,
                          4, 1, 1, 5, 2, 2, 6, 3, 3, 7, 4, 4, 1, 6, 6, 2, 7, 7,
                          3, 1, 1, 4, 2, 2, 5, 3, 3, 6, 4, 4, 7, 5, 5, 1, 7, 7,
                          2, 1, 1, 3, 2, 2, 4, 3, 3, 5, 4, 4, 6, 5, 5, 7, 6, 6),
                        42, 3, byrow = T)
  } else if (selection == 44) {
    sequences <- matrix(c(1, 2, 5, 5, 2, 3, 6, 6, 3, 4, 7, 7, 4, 5, 1, 1, 5, 6,
                          2, 2, 6, 7, 3, 3, 7, 1, 4, 4, 1, 3, 2, 2, 2, 4, 3, 3,
                          3, 5, 4, 4, 4, 6, 5, 5, 5, 7, 6, 6, 6, 1, 7, 7, 7, 2,
                          1, 1, 1, 5, 3, 3, 2, 6, 4, 4, 3, 7, 5, 5, 4, 1, 6, 6,
                          5, 2, 7, 7, 6, 3, 1, 1, 7, 4, 2, 2), 21, 4, byrow = T)
  } else if (selection == 45) {
    sequences <- matrix(c(1, 2, 3, 3, 2, 3, 4, 4, 3, 4, 5, 5, 4, 5, 6, 6, 5, 6,
                          7, 7, 6, 7, 1, 1, 7, 1, 2, 2, 1, 3, 5, 5, 2, 4, 6, 6,
                          3, 5, 7, 7, 4, 6, 1, 1, 5, 7, 2, 2, 6, 1, 3, 3, 7, 2,
                          4, 4, 1, 4, 7, 7, 2, 5, 1, 1, 3, 6, 2, 2, 4, 7, 3, 3,
                          5, 1, 4, 4, 6, 2, 5, 5, 7, 3, 6, 6, 1, 5, 2, 2, 2, 6,
                          3, 3, 3, 7, 4, 4, 4, 1, 5, 5, 5, 2, 6, 6, 6, 3, 7, 7,
                          7, 4, 1, 1, 1, 6, 4, 4, 2, 7, 5, 5, 3, 1, 6, 6, 4, 2,
                          7, 7, 5, 3, 1, 1, 6, 4, 2, 2, 7, 5, 3, 3, 1, 7, 6, 6,
                          2, 1, 7, 7, 3, 2, 1, 1, 4, 3, 2, 2, 5, 4, 3, 3, 6, 5,
                          4, 4, 7, 6, 5, 5), 42, 4, byrow = T)
  } else if (selection == 46) {
    sequences <- matrix(c(1, 2, 4, 7, 7, 2, 3, 5, 1, 1, 3, 4, 6, 2, 2, 4, 5, 7,
                          3, 3, 5, 6, 1, 4, 4, 6, 7, 2, 5, 5, 7, 1, 3, 6, 6, 1,
                          7, 5, 2, 2, 2, 1, 6, 3, 3, 3, 2, 7, 4, 4, 4, 3, 1, 5,
                          5, 5, 4, 2, 6, 6, 6, 5, 3, 7, 7, 7, 6, 4, 1, 1), 14, 5,
                        byrow = T)
  } else if (selection == 47) {
    sequences <- matrix(c(1, 2, 3, 4, 4, 2, 3, 4, 5, 5, 3, 4, 5, 6, 6, 4, 5, 6,
                          7, 7, 5, 6, 7, 1, 1, 6, 7, 1, 2, 2, 7, 1, 2, 3, 3, 1,
                          3, 5, 7, 7, 2, 4, 6, 1, 1, 3, 5, 7, 2, 2, 4, 6, 1, 3,
                          3, 5, 7, 2, 4, 4, 6, 1, 3, 5, 5, 7, 2, 4, 6, 6, 1, 4,
                          7, 3, 3, 2, 5, 1, 4, 4, 3, 6, 2, 5, 5, 4, 7, 3, 6, 6,
                          5, 1, 4, 7, 7, 6, 2, 5, 1, 1, 7, 3, 6, 2, 2, 1, 5, 2,
                          6, 6, 2, 6, 3, 7, 7, 3, 7, 4, 1, 1, 4, 1, 5, 2, 2, 5,
                          2, 6, 3, 3, 6, 3, 7, 4, 4, 7, 4, 1, 5, 5, 1, 6, 4, 2,
                          2, 2, 7, 5, 3, 3, 3, 1, 6, 4, 4, 4, 2, 7, 5, 5, 5, 3,
                          1, 6, 6, 6, 4, 2, 7, 7, 7, 5, 3, 1, 1, 1, 7, 6, 5, 5,
                          2, 1, 7, 6, 6, 3, 2, 1, 7, 7, 4, 3, 2, 1, 1, 5, 4, 3,
                          2, 2, 6, 5, 4, 3, 3, 7, 6, 5, 4, 4), 42, 5, byrow = T)
  } else if (selection == 48) {
    sequences <- matrix(c(1, 2, 5, 7, 6, 6, 2, 3, 6, 1, 7, 7, 3, 4, 7, 2, 1, 1,
                          4, 5, 1, 3, 2, 2, 5, 6, 2, 4, 3, 3, 6, 7, 3, 5, 4, 4,
                          7, 1, 4, 6, 5, 5, 1, 3, 2, 6, 4, 4, 2, 4, 3, 7, 5, 5,
                          3, 5, 4, 1, 6, 6, 4, 6, 5, 2, 7, 7, 5, 7, 6, 3, 1, 1,
                          6, 1, 7, 4, 2, 2, 7, 2, 1, 5, 3, 3, 1, 5, 3, 4, 7, 7,
                          2, 6, 4, 5, 1, 1, 3, 7, 5, 6, 2, 2, 4, 1, 6, 7, 3, 3,
                          5, 2, 7, 1, 4, 4, 6, 3, 1, 2, 5, 5, 7, 4, 2, 3, 6, 6),
                        21, 6, byrow = T)
  } else if (selection == 49) {
    sequences <- matrix(c(1, 2, 3, 4, 5, 5, 2, 3, 4, 5, 6, 6, 3, 4, 5, 6, 7, 7,
                          4, 5, 6, 7, 1, 1, 5, 6, 7, 1, 2, 2, 6, 7, 1, 2, 3, 3,
                          7, 1, 2, 3, 4, 4, 1, 3, 5, 7, 2, 2, 2, 4, 6, 1, 3, 3,
                          3, 5, 7, 2, 4, 4, 4, 6, 1, 3, 5, 5, 5, 7, 2, 4, 6, 6,
                          6, 1, 3, 5, 7, 7, 7, 2, 4, 6, 1, 1, 1, 4, 7, 3, 6, 6,
                          2, 5, 1, 4, 7, 7, 3, 6, 2, 5, 1, 1, 4, 7, 3, 6, 2, 2,
                          5, 1, 4, 7, 3, 3, 6, 2, 5, 1, 4, 4, 7, 3, 6, 2, 5, 5,
                          1, 5, 2, 6, 3, 3, 2, 6, 3, 7, 4, 4, 3, 7, 4, 1, 5, 5,
                          4, 1, 5, 2, 6, 6, 5, 2, 6, 3, 7, 7, 6, 3, 7, 4, 1, 1,
                          7, 4, 1, 5, 2, 2, 1, 6, 4, 2, 7, 7, 2, 7, 5, 3, 1, 1,
                          3, 1, 6, 4, 2, 2, 4, 2, 7, 5, 3, 3, 5, 3, 1, 6, 4, 4,
                          6, 4, 2, 7, 5, 5, 7, 5, 3, 1, 6, 6, 1, 7, 6, 5, 4, 4,
                          2, 1, 7, 6, 5, 5, 3, 2, 1, 7, 6, 6, 4, 3, 2, 1, 7, 7,
                          5, 4, 3, 2, 1, 1, 6, 5, 4, 3, 2, 2, 7, 6, 5, 4, 3, 3),
                        42, 6, byrow = T)
  } else if (selection == 86) {
    sequences <- matrix(c(1, 2, 4, 7, 7, 2, 3, 5, 1, 1, 3, 4, 6, 2, 2, 4, 5, 7,
                          3, 3, 5, 6, 1, 4, 4, 6, 7, 2, 5, 5, 7, 1, 3, 6, 6, 2,
                          7, 1, 4, 4, 3, 1, 2, 5, 5, 4, 2, 3, 6, 6, 5, 3, 4, 7,
                          7, 6, 4, 5, 1, 1, 7, 5, 6, 2, 2, 1, 6, 7, 3, 3, 4, 1,
                          7, 2, 2, 5, 2, 1, 3, 3, 6, 3, 2, 4, 4, 7, 4, 3, 5, 5,
                          1, 5, 4, 6, 6, 2, 6, 5, 7, 7, 3, 7, 6, 1, 1, 7, 4, 2,
                          1, 1, 1, 5, 3, 2, 2, 2, 6, 4, 3, 3, 3, 7, 5, 4, 4, 4,
                          1, 6, 5, 5, 5, 2, 7, 6, 6, 6, 3, 1, 7, 7), 28, 5,
                        byrow = T)
  } else if (selection == 99) {
    sequences <- matrix(c(1, 2, 2, 3, 3, 1, 1, 3, 2, 1, 3, 2, 1, 5, 5, 6, 6, 1,
                          1, 6, 5, 1, 6, 5, 2, 4, 4, 6, 6, 2, 2, 6, 4, 2, 6, 4,
                          3, 4, 4, 5, 5, 3, 3, 5, 4, 3, 5, 4), 24, 2, byrow = T)
  } else if (selection == 100) {
    sequences <- matrix(c(1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 3, 2, 2, 1, 3, 3, 2, 1,
                          1, 5, 6, 5, 6, 1, 6, 1, 5, 1, 6, 5, 5, 1, 6, 6, 5, 1,
                          2, 4, 6, 4, 6, 2, 6, 2, 4, 2, 6, 4, 4, 2, 6, 6, 4, 2,
                          3, 4, 5, 4, 5, 3, 5, 3, 4, 3, 5, 4, 4, 3, 5, 5, 4, 3),
                        24, 3, byrow = T)
  } else if (selection == 101) {
    sequences <- matrix(c(1, 4, 2, 5, 4, 5, 1, 2, 2, 1, 5, 4, 5, 2, 4, 1, 2, 5,
                          3, 6, 5, 6, 2, 3, 3, 2, 6, 5, 6, 3, 5, 2, 3, 6, 1, 4,
                          6, 4, 3, 1, 1, 3, 4, 6, 4, 1, 6, 3), 12, 4, byrow = T)
  } else if (selection == 102) {
    sequences <- matrix(c(1, 2, 2, 4, 4, 1, 1, 4, 2, 1, 4, 2, 2, 3, 3, 5, 5, 2,
                          2, 5, 3, 2, 5, 3, 3, 4, 4, 6, 6, 3, 3, 6, 4, 3, 6, 4,
                          4, 5, 5, 7, 7, 4, 4, 7, 5, 4, 7, 5, 5, 6, 6, 8, 8, 5,
                          5, 8, 6, 5, 8, 6, 6, 7, 7, 1, 1, 6, 6, 1, 7, 6, 1, 7,
                          7, 8, 8, 2, 2, 7, 7, 2, 8, 7, 2, 8, 8, 1, 1, 3, 3, 8,
                          8, 3, 1, 8, 3, 1), 48, 3, byrow = T)
  } else if (selection == 103) {
    sequences <- matrix(c(1, 2, 4, 2, 4, 1, 4, 1, 2, 1, 4, 2, 2, 1, 4, 4, 2, 1,
                          2, 3, 5, 3, 5, 2, 5, 2, 3, 2, 5, 3, 3, 2, 5, 5, 3, 2,
                          3, 4, 6, 4, 6, 3, 6, 3, 4, 3, 6, 4, 4, 3, 6, 6, 4, 3,
                          4, 5, 7, 5, 7, 4, 7, 4, 5, 4, 7, 5, 5, 4, 7, 7, 5, 4,
                          5, 6, 8, 6, 8, 5, 8, 5, 6, 5, 8, 6, 6, 5, 8, 8, 6, 5,
                          6, 7, 1, 7, 1, 6, 1, 6, 7, 6, 1, 7, 7, 6, 1, 1, 7, 6,
                          7, 8, 2, 8, 2, 7, 2, 7, 8, 7, 2, 8, 8, 7, 2, 2, 8, 7,
                          8, 1, 3, 1, 3, 8, 3, 8, 1, 8, 3, 1, 1, 8, 3, 3, 1, 8),
                        48, 3, byrow = T)
  } else if (selection == 104) {
    sequences <- matrix(c(1, 5, 2, 6, 5, 6, 1, 2, 2, 1, 6, 5, 6, 2, 5, 1, 3, 7,
                          4, 8, 7, 8, 3, 4, 4, 3, 8, 7, 8, 4, 7, 3, 1, 5, 3, 7,
                          5, 7, 1, 3, 3, 1, 7, 5, 7, 3, 5, 1, 2, 6, 4, 8, 6, 8,
                          2, 4, 4, 2, 8, 6, 8, 4, 6, 2, 1, 5, 4, 8, 5, 8, 1, 4,
                          4, 1, 8, 5, 8, 4, 5, 1, 2, 6, 3, 7, 6, 7, 2, 3, 3, 2,
                          7, 6, 7, 3, 6, 2), 24, 4, byrow = T)
  } else if (selection == 105) {
    sequences <- matrix(c(1, 5, 6, 2, 3, 7, 5, 2, 1, 7, 6, 3, 2, 7, 5, 3, 1, 6,
                          7, 3, 2, 6, 5, 1, 3, 6, 7, 1, 2, 5, 6, 1, 3, 5, 7, 2,
                          2, 6, 8, 1, 4, 5, 6, 1, 2, 5, 8, 4, 1, 5, 6, 4, 2, 8,
                          5, 4, 1, 8, 6, 2, 4, 8, 5, 2, 1, 6, 8, 2, 4, 6, 5, 1,
                          3, 7, 5, 4, 1, 8, 7, 4, 3, 8, 5, 1, 4, 8, 7, 1, 3, 5,
                          8, 1, 4, 5, 7, 3, 1, 5, 8, 3, 4, 7, 5, 3, 1, 7, 8, 4,
                          4, 8, 7, 3, 2, 6, 8, 3, 4, 6, 7, 2, 3, 6, 8, 2, 4, 7,
                          6, 2, 3, 7, 8, 4, 2, 7, 6, 4, 3, 8, 7, 4, 2, 8, 6, 3),
                        24, 6, byrow = T)
  } else if (selection == 106) {
    sequences <- matrix(c(1, 6, 9, 2, 6, 2, 1, 9, 9, 1, 2, 6, 2, 9, 6, 1, 6, 8,
                          2, 4, 8, 4, 6, 2, 2, 6, 4, 8, 4, 2, 8, 6, 8, 1, 4, 9,
                          1, 9, 8, 4, 4, 8, 9, 1, 9, 4, 1, 8, 9, 2, 5, 7, 2, 7,
                          9, 5, 5, 9, 7, 2, 7, 5, 2, 9, 2, 4, 7, 3, 4, 3, 2, 7,
                          7, 2, 3, 4, 3, 7, 4, 2, 4, 9, 3, 5, 9, 5, 4, 3, 3, 4,
                          5, 9, 5, 3, 9, 4, 5, 7, 1, 6, 7, 6, 5, 1, 1, 5, 6, 7,
                          6, 1, 7, 5, 7, 3, 6, 8, 3, 8, 7, 6, 6, 7, 8, 3, 8, 6,
                          3, 7, 3, 5, 8, 1, 5, 1, 3, 8, 8, 3, 1, 5, 1, 8, 5, 3),
                        36, 4, byrow = T)
  } else if (selection == 107) {
    sequences <- matrix(c(1, 4, 8, 7, 5, 2, 4, 7, 1, 2, 8, 5, 7, 2, 4, 5, 1, 8,
                          2, 5, 7, 8, 4, 1, 5, 8, 2, 1, 7, 4, 8, 1, 5, 4, 2, 7,
                          2, 5, 9, 8, 6, 3, 5, 8, 2, 3, 9, 6, 8, 3, 5, 6, 2, 9,
                          3, 6, 8, 9, 5, 2, 6, 9, 3, 2, 8, 5, 9, 2, 6, 5, 3, 8,
                          3, 6, 7, 9, 4, 1, 6, 9, 3, 1, 7, 4, 9, 1, 6, 4, 3, 7,
                          1, 4, 9, 7, 6, 3, 4, 7, 1, 3, 9, 6, 7, 3, 4, 6, 1, 9),
                        18, 6, byrow = T)
  } else if (selection == 125) {
    sequences <- matrix(c(1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2, 4, 3, 5, 4, 1, 5, 2,
                          1, 3, 4, 1, 5, 2, 1, 3, 2, 4, 3, 5, 1, 4, 2, 5, 3, 1,
                          4, 2, 5, 3, 2, 1, 3, 2, 4, 3, 5, 4, 1, 5, 4, 2, 5, 3,
                          1, 4, 2, 5, 3, 1), 30, 2, byrow = T)
  } else if (selection == 126) {
    sequences <- matrix(c(1, 2, 4, 2, 3, 5, 3, 4, 1, 4, 5, 2, 5, 1, 3, 2, 4, 1,
                          3, 5, 2, 4, 1, 3, 5, 2, 4, 1, 3, 5, 4, 1, 2, 5, 2, 3,
                          1, 3, 4, 2, 4, 5, 3, 5, 1, 1, 4, 2, 2, 5, 3, 3, 1, 4,
                          4, 2, 5, 5, 3, 1, 2, 1, 4, 3, 2, 5, 4, 3, 1, 5, 4, 2,
                          1, 5, 3, 4, 2, 1, 5, 3, 2, 1, 4, 3, 2, 5, 4, 3, 1, 5),
                        30, 3, byrow = T)
  } else if (selection == 127) {
    sequences <- matrix(c(1, 2, 2, 3, 3, 1, 1, 3, 2, 1, 3, 2, 4, 5, 5, 6, 6, 4,
                          4, 6, 5, 4, 6, 5, 7, 8, 8, 9, 9, 7, 7, 9, 8, 7, 9, 8,
                          1, 4, 4, 7, 7, 1, 1, 7, 4, 1, 7, 4, 2, 5, 5, 8, 8, 2,
                          2, 8, 5, 2, 8, 5, 3, 6, 6, 9, 9, 3, 3, 9, 6, 3, 9, 6),
                        36, 2, byrow = T)
  } else if (selection == 128) {
    sequences <- matrix(c(1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 3, 2, 2, 1, 3, 3, 2, 1,
                          4, 5, 6, 5, 6, 4, 6, 4, 5, 4, 6, 5, 5, 4, 6, 6, 5, 4,
                          7, 8, 9, 8, 9, 7, 9, 7, 8, 7, 9, 8, 8, 7, 9, 9, 8, 7,
                          1, 4, 7, 4, 7, 1, 7, 1, 4, 1, 7, 4, 4, 1, 7, 7, 4, 1,
                          2, 5, 8, 5, 8, 2, 8, 2, 5, 2, 8, 5, 5, 2, 8, 8, 5, 2,
                          3, 6, 9, 6, 9, 3, 9, 3, 6, 3, 9, 6, 6, 3, 9, 9, 6, 3),
                        36, 3, byrow = T)
  } else if (selection == 131) {
    sequences <- matrix(c(1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 1, 1, 2, 4, 4,
                          3, 5, 5, 4, 1, 1, 5, 2, 2, 1, 3, 3, 4, 1, 1, 5, 2, 2,
                          1, 3, 3, 2, 4, 4, 3, 5, 5, 1, 4, 4, 2, 5, 5, 3, 1, 1,
                          4, 2, 2, 5, 3, 3, 2, 1, 1, 3, 2, 2, 4, 3, 3, 5, 4, 4,
                          1, 5, 5, 4, 2, 2, 5, 3, 3, 1, 4, 4, 2, 5, 5, 3, 1, 1),
                        30, 3, byrow = T)
  } else if (selection == 132) {
    sequences <- matrix(c(1, 2, 4, 4, 2, 3, 5, 5, 3, 4, 1, 1, 4, 5, 2, 2, 5, 1,
                          3, 3, 2, 4, 1, 1, 3, 5, 2, 2, 4, 1, 3, 3, 5, 2, 4, 4,
                          1, 3, 5, 5, 4, 1, 2, 2, 5, 2, 3, 3, 1, 3, 4, 4, 2, 4,
                          5, 5, 3, 5, 1, 1, 1, 4, 2, 2, 2, 5, 3, 3, 3, 1, 4, 4,
                          4, 2, 5, 5, 5, 3, 1, 1, 2, 1, 4, 4, 3, 2, 5, 5, 4, 3,
                          1, 1, 5, 4, 2, 2, 1, 5, 3, 3, 4, 2, 1, 1, 5, 3, 2, 2,
                          1, 4, 3, 3, 2, 5, 4, 4, 3, 1, 5, 5), 30, 4, byrow = T)
  } else if (selection == 133) {
    sequences <- matrix(c(1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 3, 3, 2, 1, 1, 3, 2, 2,
                          1, 5, 5, 5, 6, 6, 6, 1, 1, 1, 6, 6, 5, 1, 1, 6, 5, 5,
                          2, 4, 4, 4, 6, 6, 6, 2, 2, 2, 6, 6, 4, 2, 2, 6, 4, 4,
                          3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 5, 5, 4, 3, 3, 5, 4, 4),
                        24, 3, byrow = T)
  } else if (selection == 134) {
    sequences <- matrix(c(1, 2, 3, 3, 2, 3, 1, 1, 3, 1, 2, 2, 1, 3, 2, 2, 2, 1,
                          3, 3, 3, 2, 1, 1, 1, 5, 6, 6, 5, 6, 1, 1, 6, 1, 5, 5,
                          1, 6, 5, 5, 5, 1, 6, 6, 6, 5, 1, 1, 2, 4, 6, 6, 4, 6,
                          2, 2, 6, 2, 4, 4, 2, 6, 4, 4, 4, 2, 6, 6, 6, 4, 2, 2,
                          3, 4, 5, 5, 4, 5, 3, 3, 5, 3, 4, 4, 3, 5, 4, 4, 4, 3,
                          5, 5, 5, 4, 3, 3), 24, 4, byrow = T)
  } else if (selection == 135) {
    sequences <- matrix(c(1, 4, 2, 5, 5, 4, 5, 1, 2, 2, 2, 1, 5, 4, 4, 5, 2, 4,
                          1, 1, 2, 5, 3, 6, 6, 5, 6, 2, 3, 3, 3, 2, 6, 5, 5, 6,
                          3, 5, 2, 2, 3, 6, 1, 4, 4, 6, 4, 3, 1, 1, 1, 3, 4, 6,
                          6, 4, 1, 6, 3, 3), 12, 5, byrow = T)
  } else if (selection == 136) {
    sequences <- matrix(c(1, 2, 2, 2, 4, 4, 4, 1, 1, 1, 4, 4, 2, 1, 1, 4, 2, 2,
                          2, 3, 3, 3, 5, 5, 5, 2, 2, 2, 5, 5, 3, 2, 2, 5, 3, 3,
                          3, 4, 4, 4, 6, 6, 6, 3, 3, 3, 6, 6, 4, 3, 3, 6, 4, 4,
                          4, 5, 5, 5, 7, 7, 7, 4, 4, 4, 7, 7, 5, 4, 4, 7, 5, 5,
                          5, 6, 6, 6, 8, 8, 8, 5, 5, 5, 8, 8, 6, 5, 5, 8, 6, 6,
                          6, 7, 7, 7, 1, 1, 1, 6, 6, 6, 1, 1, 7, 6, 6, 1, 7, 7,
                          7, 8, 8, 8, 2, 2, 2, 7, 7, 7, 2, 2, 8, 7, 7, 2, 8, 8,
                          8, 1, 1, 1, 3, 3, 3, 8, 8, 8, 3, 3, 1, 8, 8, 3, 1, 1),
                        48, 3, byrow = T)
  } else if (selection == 137) {
    sequences <- matrix(c(1, 2, 4, 4, 2, 4, 1, 1, 4, 1, 2, 2, 1, 4, 2, 2, 2, 1,
                          4, 4, 4, 2, 1, 1, 2, 3, 5, 5, 3, 5, 2, 2, 5, 2, 3, 3,
                          2, 5, 3, 3, 3, 2, 5, 5, 5, 3, 2, 2, 3, 4, 6, 6, 4, 6,
                          3, 3, 6, 3, 4, 4, 3, 6, 4, 4, 4, 3, 6, 6, 6, 4, 3, 3,
                          4, 5, 7, 7, 5, 7, 4, 4, 1, 4, 5, 5, 4, 7, 5, 5, 5, 4,
                          7, 7, 7, 5, 4, 4, 5, 6, 8, 8, 6, 8, 5, 5, 8, 5, 6, 6,
                          5, 8, 6, 6, 6, 5, 8, 8, 8, 6, 5, 5, 6, 7, 1, 1, 7, 1,
                          6, 6, 1, 6, 7, 7, 6, 1, 7, 7, 7, 6, 1, 1, 1, 7, 6, 6,
                          7, 8, 2, 2, 8, 2, 7, 7, 2, 7, 8, 8, 7, 2, 8, 8, 8, 7,
                          2, 2, 2, 8, 7, 7, 8, 1, 3, 3, 1, 3, 8, 8, 3, 8, 1, 1,
                          8, 3, 1, 1, 1, 8, 3, 3, 3, 1, 8, 8), 48, 4, byrow = T)
  } else if (selection == 138) {
    sequences <- matrix(c(1, 5, 2, 6, 6, 5, 6, 1, 2, 2, 2, 1, 6, 5, 5, 6, 2, 5,
                          1, 1, 3, 7, 4, 8, 8, 7, 8, 3, 4, 4, 4, 4, 8, 7, 7, 8,
                          3, 7, 3, 3, 1, 5, 3, 7, 7, 5, 7, 1, 3, 3, 3, 1, 7, 5,
                          5, 7, 3, 5, 1, 1, 2, 6, 4, 8, 8, 6, 8, 2, 4, 4, 4, 2,
                          8, 6, 6, 8, 4, 6, 2, 2, 1, 5, 4, 8, 8, 5, 8, 1, 4, 4,
                          4, 1, 8, 5, 5, 8, 4, 5, 1, 1, 2, 6, 3, 7, 7, 6, 7, 2,
                          3, 3, 3, 2, 7, 6, 6, 7, 3, 6, 2, 2), 24, 5, byrow = T)
  } else if (selection == 139) {
    sequences <- matrix(c(1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 3, 3, 2, 1, 1, 3, 2, 2,
                          4, 5, 5, 5, 6, 6, 6, 4, 4, 4, 6, 6, 5, 4, 4, 6, 5, 5,
                          7, 8, 8, 8, 9, 9, 9, 7, 7, 7, 9, 9, 8, 7, 7, 9, 8, 8,
                          1, 4, 4, 4, 7, 7, 7, 1, 1, 1, 7, 7, 4, 1, 1, 7, 4, 4,
                          2, 5, 5, 5, 8, 8, 8, 2, 2, 2, 8, 8, 5, 2, 2, 8, 5, 5,
                          3, 6, 6, 6, 9, 9, 9, 3, 3, 3, 9, 9, 6, 3, 3, 9, 6, 6),
                        36, 3, byrow = T)
  } else if (selection == 140) {
    sequences <- matrix(c(1, 2, 3, 3, 2, 3, 1, 1, 3, 1, 2, 2, 1, 3, 2, 2, 2, 1,
                          3, 3, 3, 2, 1, 1, 4, 5, 6, 6, 5, 6, 4, 4, 6, 4, 5, 5,
                          4, 6, 5, 5, 5, 4, 6, 6, 6, 5, 4, 4, 7, 8, 9, 9, 8, 9,
                          7, 7, 9, 7, 8, 8, 7, 9, 8, 8, 8, 7, 9, 9, 9, 8, 7, 7,
                          1, 4, 7, 7, 4, 7, 1, 1, 7, 1, 4, 4, 1, 7, 4, 4, 4, 1,
                          7, 7, 7, 4, 1, 1, 2, 5, 8, 8, 5, 8, 2, 2, 8, 2, 5, 5,
                          2, 8, 5, 5, 5, 2, 8, 8, 8, 5, 2, 2, 3, 6, 9, 9, 6, 9,
                          3, 3, 9, 3, 6, 6, 3, 9, 6, 6, 6, 3, 9, 9, 9, 6, 3, 3),
                        36, 4, byrow = T)
  } else if (selection == 141) {
    sequences <- matrix(c(1, 6, 9, 2, 2, 6, 2, 1, 9, 9, 9, 1, 2, 6, 6, 2, 9, 6,
                          1, 1, 6, 8, 2, 4, 4, 8, 4, 6, 2, 2, 2, 6, 4, 8, 8, 4,
                          2, 8, 6, 6, 8, 1, 4, 9, 9, 1, 9, 8, 4, 4, 4, 8, 9, 1,
                          1, 9, 4, 1, 8, 8, 9, 2, 5, 7, 7, 2, 7, 9, 5, 5, 5, 9,
                          7, 2, 2, 7, 5, 2, 9, 9, 2, 4, 7, 3, 3, 4, 3, 2, 7, 7,
                          7, 2, 3, 4, 4, 3, 7, 4, 2, 2, 4, 9, 3, 5, 5, 9, 5, 4,
                          3, 3, 3, 4, 5, 9, 9, 5, 3, 9, 4, 4, 5, 7, 1, 6, 6, 7,
                          6, 5, 1, 1, 1, 5, 6, 7, 7, 6, 1, 7, 5, 5, 7, 3, 6, 8,
                          8, 3, 8, 7, 6, 6, 6, 7, 8, 3, 3, 8, 6, 3, 7, 7, 3, 5,
                          8, 1, 1, 5, 1, 3, 8, 8, 8, 3, 1, 5, 5, 1, 8, 5, 3, 3),
                        36, 5, byrow = T)
  } else if (selection == 153) {
    sequences <- matrix(c(1, 2, 2, 2, 1, 1, 2, 3, 3, 3, 2, 2, 3, 4, 4, 4, 3, 3,
                          4, 1, 1, 1, 4, 4), 8, 3, byrow = T)
  } else if (selection == 154) {
    sequences <- matrix(c(1, 3, 3, 2, 4, 4, 3, 5, 5, 4, 1, 1, 5, 2, 2, 3, 1, 1,
                          4, 2, 2, 5, 3, 3, 1, 4, 4, 2, 5, 5), 10, 3, byrow = T)
  } else if (selection == 155) {
    sequences <- matrix(c(1, 4, 4, 4, 1, 1, 1, 5, 5, 5, 1, 1, 1, 6, 6, 6, 1, 1,
                          2, 4, 4, 4, 2, 2, 2, 5, 5, 5, 2, 2, 2, 6, 6, 6, 2, 2,
                          3, 4, 4, 4, 3, 3, 3, 5, 5, 5, 3, 3, 3, 6, 6, 6, 3, 3),
                        18, 3, byrow = T)
  } else {
    sequences <- matrix(c(1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7,
                          7, 8, 8, 8, 1, 1, 2, 1, 1, 3, 2, 2, 4, 3, 3, 5, 4, 4,
                          6, 5, 5, 7, 6, 6, 8, 7, 7, 1, 8, 8, 1, 4, 4, 2, 5, 5,
                          3, 6, 6, 4, 7, 7, 5, 8, 8, 6, 1, 1, 7, 2, 2, 8, 3, 3,
                          4, 1, 1, 5, 2, 2, 6, 3, 3, 7, 4, 4, 8, 5, 5, 1, 6, 6,
                          2, 7, 7, 3, 8, 8), 32, 3, byrow = T)
  }
  if (summary) {
    message("...completed the design specification. Preparing outputs...")
  }
  D           <- length(unique(as.vector(sequences)))
  if (!missing(labels)) {
    check_labels(labels, D)
  } else {
    labels    <- 0:(D - 1)
  }
  sequences   <- convert_labels(sequences, D, labels, 1:D)
  sequences   <- transform_to_xover(sequences, labels, as_matrix)

  ##### Outputting #############################################################

  if (summary) {
    message("...outputting.")
  }
  return(sequences)

}
mjg211/xover documentation built on Oct. 16, 2019, 10:46 a.m.