Skip to content

Fix undefined object p in metamodel parameter validation #177

Description

@jurjoroa

Goal

metamodel()'s invalid-parameter branch computes setdiff(p, pnames), but p is never defined in that scope — it only exists as a loop variable in the oneway branch further down. Passing a parameter name absent from the PSA therefore raises object 'p' not found instead of the intended informative message, and the same path is reachable through calc_evppi() and calc_evsi().

Scope

  • Change setdiff(p, pnames) to setdiff(params, pnames) at R/metamodel.R:59
  • Add a regression test asserting the intended message when params names a parameter absent from the PSA
  • Confirm the corrected message also surfaces when the path is reached via calc_evppi() and calc_evsi()

Version: #172

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions