mlegp (version 3.1.8)

mlegp-parameter-lookup: Parameter Lookup Functions

Description

These functions are used to match the name of a parameter with its position in a parameter list

Usage

toParamIndexes(m, string)
matchIndexes(m, string)

Arguments

m

a vector of names of the parameters of interest

string

a vector of parameter names

Value

a vector where element i contains the position of m[i] in string

if m contains integers and toParamIndexes is called, m will be returned, without a check of whether or not the indices are valid

if m[i] is not an element of string, toParamIndexes will display an error, whereas matchIndexes will return NA

References

https://github.com/gdancik/mlegp/

Examples

Run this code
# NOT RUN {
param.names = c("one", "two", "three")
toParamIndexes(c("one", "three"), param.names)
#toParamIndexes(c("four"), param.names) # will give an error
# }

Run the code above in your browser using DataCamp Workspace