dreamRs / datamods

Shiny modules to import and manipulate data into an application or addin
https://dreamrs.github.io/datamods/
GNU General Public License v3.0
138 stars 35 forks source link

Order of filter_data_server variables #87

Closed gvendemiatti closed 10 months ago

gvendemiatti commented 10 months ago

I'm developing an R Shiny app using datamods and it seems like the "vars" argument has some unintended behavior. If I provide a named list to the vars argument, but the order of my variables do not match the order of the columns in my data argument, it will pick the variables in the order of the dataframe provided rather than the order of the "vars" argument. i.e.:

Say my data has 3 columns, variable1, variable2, variable3. And say:

my_vars <- reactive(list("variable3_name" = "variable3", "variable1_name" = "variable1", "variable2_name" = "variable2"))

I'm getting in my filter_data_server container: "variable3_name" filtering variable1 first, then "variable1_name" filtering variable2 second, and "variable2_name" filtering variable3.

I don't think I'm doing something wrong - this seems like a bug.

pvictor commented 10 months ago

Indeed a bug, thanks for reporting the issue! Fixed in dev version, soon on CRAN.

Victor