R/isVector.R

Defines functions isVector isVector.Param isVector.ParamSet

Documented in isVector

#' @title Check parameter / parameter set for vector params.
#'
#' @description
#' `TRUE` if the parameter is a vector parameter or all parameters in the
#' set are vector parameters.
#'
#' @template arg_par_or_set
#' @return `logical(1)`.
#' @export
isVector = function(par) {
  UseMethod("isVector")
}

#' @export
isVector.Param = function(par) {
  isVectorTypeString(par$type)
}

#' @export
isVector.ParamSet = function(par) {
  all(vlapply(par$pars, isVector))
}

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.