Learn R Programming

kergp (version 0.5.7)

checkPar: Check Length and Names of a Vector of Values for Parameters or Bounds

Description

Check length/names for a vector of values for parameters or bounds.

Usage

checkPar(value, parN, parNames, default)

Value

A numeric vector.

Arguments

value

Numeric vector of values.

parN

Number of wanted values.

parNames

character. Names of the wanted values.

default

numeric. Default value.

Examples

Run this code
checkPar(value = c(1, 2), parN = 2L, parNames = c("theta", "sigma2"),
         default = 1.0)
checkPar(value = NULL, parN = 2L, parNames = c("theta", "sigma2"),
         default = 1.0)
checkPar(value = c("sigma2" = 100, "theta" = 1),
         parN = 2L, parNames = c("theta", "sigma2"),
         default = 1.0)

Run the code above in your browser using DataLab