Closed cmkimber closed 2 months ago
A conditional check has been added to the call to mutate()
that relevels the factor containing party names and drops "Other" to the end. This is accomplished using if...else
because if_else()
gave an error must have size 1, not size 8.
despite the fact that the conditional statement should be returning a single TRUE/FALSE value as it does in the approach implemented now.
Issue in dev branch "pane_2".
During the reactive preparation of
panel_2_df()
for plotting, there is a call tomutate()
that includesParty.Temp = fct_relevel(Party.Temp, "Other", after = Inf)
to move the leve "Other" to the end of the order for plotting purposes. As the level "Other" is not present in all years (because parties receiving <0.5% of the vote did not exist in that election), this produces a warning:Caused by warning:! 1 unknown level in
f: Other
.This call to
fct_relevel()
should be wrapped in a conditional that only executes when the level "Other" is present after filtering for Year.