dreamRs / esquisse

RStudio add-in to make plots interactively with ggplot2
https://dreamrs.github.io/esquisse
Other
1.77k stars 229 forks source link

Columns populated by singletons cannot be filtered #76

Closed rspreafico-vir closed 4 years ago

rspreafico-vir commented 4 years ago

Hi there,

if a categorical variable/column is populated by singletons (that is, each factor level is only represented once), esquisse does not give the option to filter that column. If this is intentional, would it be possible to add an option to enable filtering columns populated by singletons?

Thank you, Roberto

pvictor commented 4 years ago

Yes, it's intentional, I didn't see the point of making a graph from a single row, not much to visualize... What's your use case ? However, I can add an option in filterDF because it can be useful.

The exact rule used is to discard column that have 90% of single values as well as those with more than 50 distinct values.

Thanks for your inputs on that,

Victor

rspreafico-vir commented 4 years ago

Thanks Victor,

yes graph-wise I understand it makes sense, but I am using the dedicated filterDF module to let users subset a dataset and they may want to remove singletons from one column, and then visualize results from other columns that have no singletons.

It would be great if there was an option to deactivate the default behavior. Thanks so much!

pvictor commented 4 years ago

Ah yes that makes sense! I'm going to add an option to do that. Thanks Roberto

pvictor commented 4 years ago

I added two new arguments to filterDF :

Victor

rspreafico-vir commented 4 years ago

Awesome, thank you!

rspreafico-vir commented 4 years ago

Tested, works great! Thank you for the quick fix!