File: isForbidden.R

package info (click to toggle)
r-cran-paramhelpers 1.12-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 984 kB
  • sloc: ansic: 260; sh: 13; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 538 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#' @title Check whether parameter setting lies in forbidden region of parameter set.
#'
#' @description
#' Parameter sets without a forbidden region always return \code{FALSE}.
#'
#' @template arg_parset
#' @param x [named \code{list}] \cr
#'   Parameter setting to check.
#' @return [\code{logical(1)}].
#' @export
isForbidden = function(par.set, x) {
  assertClass(par.set, "ParamSet")
  #FIXME: check for correct names here
  assertList(x)
  if (!hasForbidden(par.set))
    return(FALSE)
  return(eval(par.set$forbidden, envir = x))
}