pik-piam / piamInterfaces

0 stars 18 forks source link

checkSummation plots do not include totals for multiple summations cases of the same variable #180

Closed Renato-Rodrigues closed 1 year ago

Renato-Rodrigues commented 1 year ago

Reproduction:

Consider two group summations like for example:

Summation deviations charts will be created perfectly in the pdf for the first group. However, the chart for the second group will have the total black line missing, most probably because the total variable passed to the showAreaAndBarPlots function in the following line is Emissions|Kyoto Gases 2 instead of Emissions|Kyoto Gases.

https://github.com/pik-piam/piamInterfaces/blob/011e72eab3a580371a5fdfcce686eaec1ff42014/R/checkSummations.R#L207

Renato-Rodrigues commented 1 year ago

My work-around locally was to add gsub(" [1-9]$", "", p), instead of p in the function call to fix the issue, but I am not sure if you have a more elegant solution for that.

fbenke-pik commented 1 year ago

Had a look and don't think there is a more elegant way to fix that issue, so created a PR here: https://github.com/pik-piam/piamInterfaces/pull/181