-
Notifications
You must be signed in to change notification settings - Fork 119
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
ggcoef() redesign #392
ggcoef() redesign #392
Conversation
and better examples not relying on gtsummary::trial
Codecov Report
@@ Coverage Diff @@
## master #392 +/- ##
==========================================
+ Coverage 92.05% 92.25% +0.20%
==========================================
Files 34 36 +2
Lines 4054 4353 +299
==========================================
+ Hits 3732 4016 +284
- Misses 322 337 +15
Continue to review full report at Codecov.
|
Merge branch 'master' of github.com:ggobi/ggally into ggcoef_model # Conflicts: # DESCRIPTION
Hello @larmarange ! I was playing around with
|
Thanks a lot for your feedback
Good idea. Implemented through f5743c8
This is a choice by design. library(GGally)
#> Le chargement a nécessité le package : ggplot2
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
library(broom.helpers)
mod <- lm(Sepal.Length ~ ., iris)
res <- mod %>%
tidy_plus_plus() %>%
dplyr::mutate(stars = signif_stars(p.value))
ggcoef_plot(res, shape = "stars", shape_values = 16:19) As you can see, any custom variable could be mapped to
This is a good question. One label is needed for facets (the bold ones are in fact labels) and one is required for y-axis. I guess I found a solution implemented in 732f5fd library(GGally)
#> Le chargement a nécessité le package : ggplot2
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
library(broom.helpers)
mod <- lm(Sepal.Length ~ ., iris)
ggcoef_model(mod) ggcoef_model(mod, group_one_row_variables = TRUE) mod1 <- lm(Fertility ~ ., data = swiss)
mod2 <- step(mod1, trace = 0)
mod3 <- lm(Fertility ~ Agriculture + Education * Catholic, data = swiss)
models <- list("Full model" = mod1, "Simplified model" = mod2, "With interaction" = mod3)
ggcoef_compare(models) ggcoef_compare(models, group_one_row_variables = TRUE) Created on 2020-10-30 by the reprex package (v0.3.0) |
This is all great! I am thinking I can pass |
@ddsjoberg If you want to pass |
What should be the rule when p values are printed on y levels? Should they
stay on y axis or be moved to the facet label?
Joseph Larmarange
Le sam. 31 oct. 2020 à 13:26, Daniel Sjoberg <notifications@github.com> a
écrit :
… I like the facetted grouping of the variables. I think it is quite
visually appealing. Perhaps something like this could work, where the
y-axis label is omitted when it is re-printing the variable label?
I know there is a lot going on in the background, so this may not be
possible (I see this messes with the striping). Just wanted to share some
thoughts...this is your baby and you know best :)
library(GGally)
lm(Sepal.Length ~ ., iris) %>%
broom.helpers::tidy_plus_plus() %>%
dplyr::mutate(label = ifelse(var_type == "continuous", " ", label)) %>%
ggcoef_plot()
<https://camo.githubusercontent.com/df1a302cdcff5de97b53143555f4160067b128be/68747470733a2f2f692e696d6775722e636f6d2f624b4d596b624a2e706e67>
Created on 2020-10-31 by the reprex package <https://reprex.tidyverse.org>
(v0.3.0)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#392 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHL5I4WZOQT5M6S5TXJPUTSNP67XANCNFSM4SVBX7BQ>
.
|
@ddsjoberg I have implemented an alternative to group_one_row_variables. The functions compute a |
@larmarange I think these plots look fantastic! |
@larmarange one more question. Is it possible to get this kind of output from library(GGally)
lm(Sepal.Length ~ ., iris) %>%
broom.helpers::tidy_plus_plus() %>%
dplyr::mutate(label = ifelse(var_type == "continuous", " ", label)) %>%
ggcoef_plot() Created on 2020-10-31 by the reprex package (v0.3.0) |
The problem here is that due to the relabel, all empty y values have the same value (in terms of factor) and therefore have the same strip. |
I have added a little trick using term column for computing strips colour. library(GGally)
#> Le chargement a nécessité le package : ggplot2
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
lm(Sepal.Length ~ ., iris) %>%
broom.helpers::tidy_plus_plus() %>%
dplyr::mutate(label = ifelse(var_type == "continuous", "", label)) %>%
ggcoef_plot() Note: your assumption |
These figures are amazing! Thank you for your work on them! |
|
Hi @schloerke
This PR is now ready for being merged. Only one check failed (ubuntu 16.04 oldrel) but it seems unrelated to the PR. It fails with the installation of 'r-hub/sysreqs'. Best regards |
@larmarange Will look through this later tonight. Thank you! |
Thanks to you @schloerke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes.
Great code! Thank you for awesome formatting. It was very easy to read! Your ggplot2 integrations are getting / have been beyond my working knowledge. 😳
The vignette looks great! Thank you!
Co-authored-by: Barret Schloerke <barret@rstudio.com>
Thank you very much for your careful review. I have merged your proposed corrections. See my answer regarding Best regards |
Following #372 this PR proposes a complete redesign of
ggcoef()
based onbroom.helpers
package (also now used bygtsummary::tbl_regression()
).The PR includes 3 main functions:
ggcoef_model()
,ggcoef_compare()
andggcoef_multinom()
. The originalggcoef()
remains unchanged.The PR also includes two new geoms:
geom_stripped_rows()
andgeom_stripped_cols()
.Pre-requisite before merging this PR:
broom.helpers
version 1.1.0 released on CRAN