R/checkRegularizedMatrixExistance.R

Defines functions checkRegularizedMatrixExistance

Documented in checkRegularizedMatrixExistance

#' checkRegularizedMatrixExistance
#'
#'
#' checks if the matrix that should be regularized actually exists
#' @author Jannik Orzek
#'
#' @export
checkRegularizedMatrixExistance <- function(regOn, mxModelObject, regIndicators){
  for(matrixName in regOn) {
    if(!matrixName %in% names(mxModelObject)){
      stop(paste("Matrix ", matrixName, " provided in regOn was not found in the provided regModel", sep = ""))
    }
    if(!matrixName %in% names(regIndicators)){
      stop(paste("Matrix ", matrixName, " provided in regOn was not found in the regIndicator list.", sep = ""))
    }
  }

}
jhorzek/regmx documentation built on Sept. 19, 2022, 2:30 a.m.