ropensci / visdat

Preliminary Exploratory Visualisation of Data
https://docs.ropensci.org/visdat/
Other
450 stars 47 forks source link

Implement vis_histogram #163

Closed jrosell closed 1 year ago

jrosell commented 1 year ago

When doing EDA one of the most common tasks is to get sense of the distribution of the values for each of the variables.

Using a new function vis_histogram would I expect to get a grid of histogram plots for each variable in the dataset. I think that the function arguments could be used to specify the shared properties for all plots, or could be specified by variable.

I think something like that could work:

library(visdat)
(vis_histogram(airquality))
(vis_histogram(airquality, bins = 30, options = list(Month = list(bins = 12)))

The previous code should show two plots. The first one showing an histogram for each of the variables using defaults of geom_histogram. And the second one should be similar but the Month variable would be 12 bins.

Are you interested in this kind of feature?

njtierney commented 1 year ago

That sounds awesome! I've got some other features that I would like to work on first but if you'd like to open a PR with some starting code I'm more than happy to provide feedback and contribute via that route - what do you think?

jrosell commented 1 year ago

@njtierney would you like me to create a pull request for the master branch or for a new vis-histogram branch?

njtierney commented 1 year ago

Hi @jrosell !

a pull request for master would be great - if you can entitle it something like vis-histogram?

jrosell commented 1 year ago

You can see my pull request. I know it doesn't implement customization of multiple aesthetics differently, but I think vis_histogram can do what is expected.

matthewingmire commented 1 year ago

Hi! Is vis_histogram available for public consumption?

jrosell commented 1 year ago

Not yet. You can see my pull request code from my fork for here: https://github.com/jrosell/visdat/commit/bb66dda24f944916a81f0ce506287c4a26fac527

matthewingmire commented 1 year ago

Thanks for the quick reply.On Mar 9, 2023, at 8:30 AM, Jordi @.> wrote: Not yet. You can see my pull request from my for here: @.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

njtierney commented 1 year ago

This is now implemented, thanks to #164 - thanks to @jrosell :)