Comments (2)
If I may, some additional thoughts.
If the "theme env" is saved with the tbl object, you could consider two different options: set_gtsummary_theme()
to change overall the theme elements for the future gtsummary objects that will be created, and a modify_gtsummary_theme()
that could be applied on an existing table, e.g. tbl %>% modify_gtsummary_theme()
.
Another thought is the question of inheritance of theme elements. It exists in the code in many places, without being explicit. An example:
Lines 153 to 157 in 30ef717
We could think about a better naming of the theme elements, showing the inheritance. An example:
pvalue_fun
(overall default)pvalue_fun.regression
(value fortbl_regression()
)pvalue_fun.summary
(value for all summary functions)pvalue_fun.summary.regular
(value fortbl_summary()
only)pvalue_fun.summary.survey
(value fortbl_svysummary()
only)pvalue_fun.summary.custom
(value fortbl_custom_summary()
only)
Then the code could be simplify in many places. We could simply call get_theme_element("pvalue_fun.summary.custom")
. If this element is not defined (i.e. NULL
) then get_theme_element()
will look at "pvalue_fun.summary"
and eventually at "pvalue_fun"
. With such naming (also used by ggplot2
), inheritance will be explicit.
Another thought coming from ggplot::theme()
: each theme element should be a named argument of set_gtsummary_theme()
and modify_gtsummary_theme()
. It would allow to use autocompletion to easily identify the name of a theme element, and improve the documentation of all of them.
from gtsummary.
Also, an internal function called when package is loaded to fix the default values at once would be relevant, to avoid indicating default values within each function.
from gtsummary.
Related Issues (20)
- Question / Feature request: type "dichotomous" option in tbl_summary not displaying both levels HOT 3
- v2.0 `modify_footnote()` updates HOT 1
- v2.0 README
- Wording in `tbl_uregression()` documentation: univariable instead of univariate? HOT 2
- Compatibility with VGAM HOT 3
- Improve `style_number()` speed?
- Feature request: Informative caption when using `tbl_regression()` with `mice::mira` HOT 2
- v2.0 Add arguments `style_*(prefix, suffix)` ?
- Feature request: Automated suppression of small counts HOT 1
- v2.0 `tbl_stack()`, `tbl_merge()`, `tbl_strata()`, etc.
- `show_header_names()` updates HOT 1
- Feature request: Extend `tbl_merge` to all `gt` tables HOT 2
- Review `tbl_custom_summary()`
- Bug Report: Factor level with `NA` label causes "Column stat_n doesn't exist" error (e.g. created by forcats). HOT 3
- Improve `tbl_summary()` error message for continuous2 type
- v2.0 Add unit test HOT 1
- tbl_strata coding issues HOT 1
- Bug Report: tbl_strata does not treat the values in a small stratum (i.e. with only 7 values) as continuous (despite specification that it should), treats them as categorical HOT 1
- v2.0 Create `card_continuous()`
- Questions about `card_*()` functions.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtsummary.