R/order.R

Defines functions canonicalOrder

Documented in canonicalOrder

#' Sorts sequences of a design into a canonical order
#' 
#' Sorts sequences of a design into a canonical order.
#' 
#' When comparing bigger designs this ordering easily allows to check whether two
#' designs are equal.
#' 
#' @param design Cross-over design.
#' @author Kornelius Rohmeyer \email{rohmeyer@@small-projects.de}
#' @keywords misc
#' @examples
#' 
#' getDesign("switchback5t")
#' canonicalOrder(getDesign("switchback5t"))
#' 
#' @export canonicalOrder
canonicalOrder <- function(design) {
  design[, do.call(order, lapply(1:NROW(design), function(i) design[i, ]))]
}

Try the Crossover package in your browser

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

Crossover documentation built on March 31, 2023, 9:50 p.m.