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

Rows with empty values are filtered out, even when '<empty field>' is selected #65

Closed bellma-lilly closed 1 year ago

bellma-lilly commented 1 year ago

I am having a problem where empty items in my data are being filtered out, even when <empty fields> is selected. This appears to be caused in filter-data.R, line 475:

        if ("<empty field>" %in% values)
          values[which(values == "<empty field>")] <- ""

Because the value is &lt;empty field&gt; rather than <empty field> I can make things work as expected with:

emptyField = as.character(as.tags("<empty field>")) 
if(emptyField %in% values)
           values[which(values == emptyField)] <- ""

But I suspect the "right" thing to do is make sure value is <empty field> instead. But I'm not sure how to do that.

pvictor commented 1 year ago

Thanks for reporting this, <empty field> was interpreted like HTML tag and escaped. That's fixed if you re-install from GitHub, soon on CRAN.

Victor