powered by
toParamIndexes(m, string) matchIndexes(m, string)
m[i]
string
if m contains integers and toParamIndexes is called, m will be returned, without a check of whether or not the indices are valid
m
toParamIndexes
if m[i] is not an element of string, toParamIndexes will display an error, whereas matchIndexes will return NA
matchIndexes
NA
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 DataLab