el-meyer / airship

AIRSHIP - An Interactive R-SHIny apP for visualizing tidy long data
https://el-meyer.github.io/airship/
GNU General Public License v3.0
3 stars 2 forks source link

Allow users to factor/unfactor certain variables in the dataset #108

Open el-meyer opened 1 year ago

el-meyer commented 1 year ago

To make sure this does not happen

image

el-meyer commented 11 months ago

Comment from @majkamichal:

Could be easiest to introduce a widget that allows you to choose variables that should be converted. The choices could be restricted to numeric. Works well with #120 because user would immediately see the effect.

majkamichal commented 11 months ago

In addition to one widget that allows selecting possibly multiple variables, for which the class should be changed, we can also add another widget that selects a specific class. There can be many classes to be chosen from. In order to apply changes (and prevent unwanted immediate conversions), an action button would be implemented.

It would look like more or less like this: changing_the_class_of_variables

majkamichal commented 10 months ago

I have implemented the first version of the interface for the conversion of variables in easyPlot.

It pertains to this issue: https://github.com/majkamichal/easyPlot/issues/18

Here there is a respective commit: https://github.com/majkamichal/easyPlot/commit/eaedbc41604bce05be5e00e8b1bf909736fe781a.

Please play around with the new interface and let me know what could be potentially changed in easyPlot and how you would see it in airship. (For easyPlot I think, one could place all three checkboxes "Recode variables" in one place in a different part of the sidebar panel...maybe lower part of the sidebar panel).

devtools::install_github("majkamichal/easyPlot") easyPlot::easyPlot() easyPlot::easyPlot(iris)

I will then implement an equivalent logic in the Airship with additional feedback.

el-meyer commented 10 months ago

It works great! I especially like the "Reset" button, because when you switch around too often and also to and from "Factor", you can lose the original values.

The only suggestion for improvement I would have: Rather than allowing multiple variables to be converted at once and choosing the new class first, I would firstly allow the selection of variables, then the selection of the new class and before clicking "Convert" have a small overview (e.g. "Sepal.Length (numeric) and Species (factor) will now be converted to "Date". Click 'Convert' if you wish to proceed")

el-meyer commented 10 months ago

In terms of layout, I agree that maybe a different place in the sidebar panel would be better. Since this is in operation that could be performed on all possible datasets, it could be either below all the data upload settings, or in a new tab, e.g. "Data Manipulations". The latter especially makes sense if further data manipulation options are planned (this is e.g. the case in Airship).

el-meyer commented 4 months ago

If possible, it would be great if we could also allow users to change the factor level ordering or the names of the factor levels. In this example e.g. we have three columns where the second column should be the first, the first the second and the third the third (there is a hierarchy in the levels), but they were ordered alphabetically. Also on the x-axis we have factor levels "Var1", "Var2" and "Var3" that are not meaningful.

Screenshot 2024-06-25 at 10 04 09