R/initModel.R

"initModel" <-
  # initializes the model class based on a match of the named argument "mod_type" to one of the supported model types
  # Variables directly affected by this function:
  # Initialized: model@clpType
  # Modified: model@clpType, model@datCall
  function(...) {
    dots <- list(...)
    if ("mod_type" %in% names(dots)) {
      if (dots$mod_type == "kin") {
        model <- kin(...)
      }
      if (dots$mod_type == "spec") {
        model <- spec(...)
      }
      if (dots$mod_type == "mass") {
        model <- mass(...)
      }
      if (dots$mod_type == "amp") {
        model <- amp(...)
      }
    }
    if (model@mod_type == "spec") {
      model@clpType <- "x"
    } else {
      model@clpType <- "x2"
    }
    model@datCall <- append(model@datCall, match.call())
    model <- initOneModel(model)
    model
  }

Try the TIMP package in your browser

Any scripts or data that you put into this service are public.

TIMP documentation built on Dec. 28, 2022, 3:06 a.m.