Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for filtered correlation plots #24

Closed
RoelVerbelen opened this issue Feb 21, 2020 · 2 comments
Closed

Allow for filtered correlation plots #24

RoelVerbelen opened this issue Feb 21, 2020 · 2 comments
Labels

Comments

@RoelVerbelen
Copy link

@RoelVerbelen RoelVerbelen commented Feb 21, 2020

Great package for exploratory data analysis, thanks for sharing!

Could the package enable filtering results before plotting? I'd love to be able to do something like this:

# Load packages
library(inspectdf)
library(dplyr)

# Single dataframe summary
inspect_cor(starwars)
#> # A tibble: 3 x 7
#>   col_1      col_2    corr p_value  lower  upper pcnt_nna
#>   <chr>      <chr>   <dbl>   <dbl>  <dbl>  <dbl>    <dbl>
#> 1 birth_year mass    0.478 0.00602  0.177  0.697     41.4
#> 2 birth_year height -0.400 0.0114  -0.625 -0.113     49.4
#> 3 mass       height  0.134 0.316   -0.127  0.377     67.8

# Filter
inspect_cor(starwars) %>% 
  filter(abs(corr) > 0.2)
#> # A tibble: 2 x 7
#>   col_1      col_2    corr p_value  lower  upper pcnt_nna
#>   <chr>      <chr>   <dbl>   <dbl>  <dbl>  <dbl>    <dbl>
#> 1 birth_year mass    0.478 0.00602  0.177  0.697     41.4
#> 2 birth_year height -0.400 0.0114  -0.625 -0.113     49.4

# Filter and plot
inspect_cor(starwars) %>% 
  filter(abs(corr) > 0.2) %>% 
  show_plot()
#> Error: Tibble columns must have consistent sizes, only values of size one are recycled:
#> * Size 2: Existing data
#> * Size 3: Column `pair`

Created on 2020-02-21 by the reprex package (v0.3.0)

When you have a lot of features, you want to focus only on relevant correlations and avoid clutter.

@alastairrushworth alastairrushworth added bug enhancement and removed bug labels Mar 9, 2020
@alastairrushworth
Copy link
Owner

@alastairrushworth alastairrushworth commented Jun 18, 2020

Hi @RoelVerbelen thanks a lot for the report, this should now work on the GH version. CRAN update to follow in a week or so.

Thanks! Alastair

@RoelVerbelen
Copy link
Author

@RoelVerbelen RoelVerbelen commented Jun 18, 2020

Fantastic, thanks Alastair!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.