Skip to content

Fix plot_trace parenthesis #249

@sschildhauer

Description

@sschildhauer

One Minor Pre-existing Issue (Non-blocking)
plot_trace.R:79 — typo in the collapse condition
if (sum(lengths(trace_strat_list) == 1)) {
The closing paren is misplaced relative to the sibling functions. This evaluates lengths(trace_strat_list) == 1 (a logical vector marking which sub-lists have exactly one plot), then sum() of that vector is truthy whenever any sub-list has a single plot — not when the total list contains exactly one plot.

Compare the sibling plot functions, which both have the parentheses in the intended position:

plot_rhat.R:82: if (sum(lengths(rhat_strat_list)) == 1) ✅
plot_ess.R:81: if (sum(lengths(eff_strat_list)) == 1) ✅
This is pre-existing — it survived the rename unchanged (the file is a +9/-9 rename) — so it's out of scope for this PR. I'd recommend a follow-up to fix it; in practice the bug means a multi-strat trace plot call where one of the strata happens to have one isotype's plot collapses to that single plot rather than returning the full nested list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions