SWS-Methodology / tradeValidationTool

Trade validation tool
0 stars 0 forks source link

Bug in the plots function #7

Closed baldwinkl closed 7 years ago

baldwinkl commented 7 years ago

Today at 11:22, analyst Del Bello reported that the plot function has a bug, where sometimes when the correction that is applied, the plot shows the old series line as black, and the new series line as red. This occurred with a value measurement factor correction. He reports that the same error has occurred a few times before. image

chrMongeau commented 7 years ago

Unfortunately I cannot replicate. I just did this (of course, correction was not saved):

The initial graph is the following:

image

After the correction it is:

image

Thus, everything works as expected. If you can send me a way to replicate the observed behaviour, I'll be happy to have a look at it.

chrMongeau commented 7 years ago

Sorry, I didn't read carefully and missed "a value measurement factor correction". In any case, even with this kind of correction, I can't reproduce. See below (follows the previous example).

image

baldwinkl commented 7 years ago

The specific example was for Belarus imports of other forage products ne from Russia. A value measurement factor correction of 0.1 replicated this error for me.

Marcella last week had the same problem for Italy. The correction has since been processed, but here is the screenshot:

For Italy imports of jute, raw or retted from Bulgaria, when the value is divided by 10, the unit value graph black series becomes the red one and vice versa: image

chrMongeau commented 7 years ago

Yes, confirmed. Identified what is causing this: https://github.com/SWS-Methodology/tradeValidationTool/blob/4fde428b9385ac53d6f962827222815b1f8579d7/app.R#L2514

chrMongeau commented 7 years ago

Fixed:

https://github.com/SWS-Methodology/tradeValidationTool/blob/abd935db18307903459aa251351e4b660ec0407d/app.R#L2464