File: getParamLengths.Rd

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 (36 lines) | stat: -rw-r--r-- 1,175 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getParamLengths.R
\name{getParamLengths}
\alias{getParamLengths}
\title{Return lengths of single parameters or parameters in parameter set.}
\usage{
getParamLengths(par, dict = NULL)
}
\arguments{
\item{par}{(\link{Param} | \link{ParamSet})\cr
Parameter or parameter set.}

\item{dict}{(\code{environment} | \link{list} | \code{NULL})\cr
Environment or list which will be used for evaluating the variables of
expressions within a parameter, parameter set or list of parameters. The
default is \code{NULL}.}
}
\value{
(\code{integer}). Named and in the same order as the input for \code{\link[=ParamSet]{ParamSet()}} input.
}
\description{
Useful for vector parameters.
}
\examples{
ps = makeParamSet(
  makeNumericParam("u"),
  makeIntegerParam("v", lower = 1, upper = 2),
  makeDiscreteParam("w", values = 1:2),
  makeDiscreteVectorParam("x", len = 2, values = c("a", "b"))
)
getParamLengths(ps)
# the length of the vector x is 2, for all other single value parameters the length is 1.

par = makeNumericVectorParam("x", len = expression(k), lower = 0)
getParamLengths(par, dict = list(k = 4))
}