File: getParamTypeCounts.R

package info (click to toggle)
r-cran-paramhelpers 1.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 992 kB
  • sloc: ansic: 102; sh: 13; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#' Returns information on the number of parameters of a each type.
#'
#' @template arg_parset
#' @return [`list`]
#'  Named list which contains for each supported parameter type the
#'  number of parameters of this type in the given ParamSet.
#' @export
getParamTypeCounts = function(par.set) {
  assertClass(par.set, "ParamSet")
  supported.types = getTypeStringsAll()
  par.types = getParamTypes(par.set)
  count = lapply(supported.types, function(type) {
    sum(par.types == type)
  })
  names(count) = supported.types
  return(count)
}