R/hasTrafo.R

Defines functions hasTrafo hasTrafo.Param hasTrafo.ParamSet

Documented in hasTrafo

#' @title Check parameter / parameter set for trafos.
#'
#' @description
#' `TRUE` iff the parameter has any trafos or any parameter in the set has
#' trafos.
#'
#' @template arg_par_or_set
#' @return `logical(1)`.
#' @export
hasTrafo = function(par) {
  UseMethod("hasTrafo")
}

#' @export
hasTrafo.Param = function(par) {
  return(!is.null(par$trafo))
}

#' @export
hasTrafo.ParamSet = function(par) {
  return(any(vlapply(par$pars, hasTrafo)))
}

Try the ParamHelpers package in your browser

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

ParamHelpers documentation built on March 26, 2020, 7:40 p.m.