Skip to content

Return a valid icers object from single-strategy calculate_icers #183

Description

@jurjoroa

Goal

calculate_icers()'s nstrat == 1 early return at R/icers.R:80-83 skips the Status column, the column ordering and the class assignment, so it hands back a bare data.frame instead of an icers object. plot() then dispatches to plot.data.frame and fails with need finite 'ylim' values.

Scope

  • At R/icers.R:80-83, set Status to "ND", assign Inc_Cost/Inc_Effect/ICER as NA, reorder to the same 7-column layout as the multi-strategy return, and set class(df) <- c("icers", "data.frame")
  • Add a regression test asserting the single-strategy return has class icers and the same columns in the same order as a multi-strategy return
  • Add a regression test asserting plot() on a single-strategy result returns a ggplot object
  • Coordinate with Guard calculate_icers empty input and remove stale roxygen #178, which adds the nstrat == 0 guard in the same block

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