I am able to use factor() to set the scenario or chart order successfully with regular plots. However, the diff plots default to alphabetical order, and when I attempt to use factor() to set the order explicitly, I get the following error:
prim_en_map <- prim_en_map %>%
+ mutate(scenario = factor(scenario, levels = c("2015 primary energy","GCAM-core","dynamic CCS","growth rate constraints")))
> rmap::map(data=prim_en_map,
+ folder = dir,
+ palette = "pal_hot",
+ scenRef = "2015 primary energy",
+ paletteDiff = 'pal_div_RdBl',
+ scenDiff = c("GCAM-core","dynamic CCS","growth rate constraints"),
+ ncol=1,
+ diffOnly=T,
+ title = 'Difference in 2050 Fossil Primary Energy Fraction relative to 2015') -> b
Starting map...
scenRef chosen: 2015 primary energy is not in any of the available scenarios:
3, 1, 2, 4
Setting scenRef to first scenario: 3.
None of the scenDiff are in any of the available scenarios:
1, 2, 4
Skipping Diff.
map run completed.
I am able to use factor() to set the scenario or chart order successfully with regular plots. However, the diff plots default to alphabetical order, and when I attempt to use factor() to set the order explicitly, I get the following error: