When extracting objects from a list using the $ operator, R does not seem to match all characters of the name of the object.
For example:
args <- list(nIndicator = rep(3,4), loadMinMax = c(.5, .6))
args$loadM
[1] 0.5 0.6 # extracts loadMinMax because the first characters are the same
args[['loadM']]
NULL # this works
This issue caused problems with input validation in genLambda
if(!is.null(loadMinMax) && (!is.null(loadM) || !is.null(loadSD))) stop('Either specify mean and SD of loadings or specify min-max loading, both not both.')
Argh. Partial matching is the root of all evil. We'll need to check the remaining parts of the code and replace any usage of $x for lists with [[x]] to avoid that changes introduce hard to find bugs.
When extracting objects from a list using the $ operator, R does not seem to match all characters of the name of the object.
For example: args <- list(nIndicator = rep(3,4), loadMinMax = c(.5, .6)) args$loadM [1] 0.5 0.6 # extracts loadMinMax because the first characters are the same
args[['loadM']] NULL # this works
This issue caused problems with input validation in genLambda if(!is.null(loadMinMax) && (!is.null(loadM) || !is.null(loadSD))) stop('Either specify mean and SD of loadings or specify min-max loading, both not both.')