R/effect_type.R

Defines functions effect_type.breedr_effect effect_type.effect_group

Documented in effect_type.breedr_effect effect_type.effect_group

#' @describeIn effect_type Type of an \code{effect_group}
#' @export
effect_type.effect_group <- function(x) {
  
  types <- sapply(x$effects, effect_type.breedr_effect)
  utypes <- unique(types)
  stopifnot(length(utypes) == 1)
  return(utypes)
}

#' @describeIn effect_type Type of an \code{breedr_effect}
#' @export
effect_type.breedr_effect <- function(x) {
  ifelse(inherits(x, 'random'), 'random', 'fixed')
}
famuvie/breedR documentation built on Sept. 6, 2021, 4:50 a.m.