maelstrom-research / Rmonize

3 stars 0 forks source link

harmonized_dossier_visualize() report shows variable labels in English but categories in French #29

Open zchenmr opened 8 months ago

zchenmr commented 8 months ago

R Maelstrom: Rmonize 1.0.0.9004, madshapR 1.0.2.9004, fabR 2.0.0

The "Variables summary" of harmonized_dossier_visualize() automatically displays variable labels in English but category labels in French when labels in both languages are available: image

For individual harmonized variables, both variable labels are included but only the French category labels are displayed: image

image

Input DataSchema (variables and categories): image

image

GuiFabre commented 8 months ago

The solution might not work for all the cases, but we will see ;)

zchenmr commented 8 months ago

"Variables summary" is now showing the English variable and category labels by default, but the category labels in the individual harmonized variable summaries (including figures) are still in French:

image image
zchenmr commented 8 months ago

R Maelstrom: Rmonize v1.0.0.9008, madshapR v1.0.2.9009, fabR 2.0.0

The French category labels for individual harmonized variables are still showing up in the visual report for me instead of the English labels. Maybe it's due to something in my configuration files or in the pre-processing steps prior to harmonization?

image

GuiFabre commented 8 months ago

thank you again for your contribution. The bug was in madshapR

image

This should work now !

zchenmr commented 8 months ago

Yes, it's mostly working now! The individual harmonized variable summaries now show the labels in the same language consistently. However, when I swapped the columns "label:en" and "label:fr" in the Variables tab of the DataSchema (so that "label:fr" is on the left), the Variables summary of the report still has differing languages:

image

image

GuiFabre commented 8 months ago

indeed. that will stay like that:

the user may have the same order in Variables and Categories (:en, then :fr for both of them). But for any reason, them might also want them backward. So for that reason, the first label (:fr here) in Variable is taken, but also the first label (:en there) in Categories. If it seems backward to them, then they need to arrange them accordingly

zchenmr commented 8 months ago

Okay, that works. I do think there's still some inconsistency in the report in that case, since "Variables summary" shows the category labels in English (since it's the leftmost column in the DataSchema) but then in the individual harmonized variable summaries, all of the category labels are in French. It might also be a good idea to include a note in the documentation about column order so that users know to arrange the columns in the proper order.

image image

DS - Variables:

image

DS - Categories:

image
GuiFabre commented 8 months ago

thank you, to be discussed for another version