insightsengineering / insightsengineering/teal.widgets
[Bug]: custom ggplot2 theme
- Dominant language
- R
- Stars
- 6
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
### What happened?
_I have tried to use the following code;_
` ggplot2_args = teal.widgets::ggplot2_args(
lab = list(title = "TITLE"),
theme = list(title = ggplot2::element_text(size = 20))
)`
_But however the following error appears,_
The `title` theme element must be a object.
when evaluating qenv code:
print(p)
### sessionInfo()
```R
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.6 (Ootpa)
Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.15.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices datasets utils methods base
other attached packages:
[1] ggthemes_4.2.4 scales_1.2.1 dplyr_1.1.3
[4] markdown_1.4 nloptr_1.2.2.3 glmnet_4.1-2
[7] Matrix_1.5-3 haven_2.5.1 teal.reporter_0.2.1.9012
[10] teal.modules.clinical_0.8.14.9014 tern_0.7.10.9024 rtables_0.6.5.9012
[13] formatters_0.5.4.9002 teal.modules.general_0.2.15.9012 shinyTree_0.2.7
[16] ggmosaic_0.3.3 ggplot2_3.4.4 teal_0.14.0.9017
[19] teal.transform_0.4.0.9006 magrittr_2.0.3 teal.slice_0.4.0.9022
[22] teal.data_0.3.0.9009 shiny_1.7.5.1
loaded via a namespace (and not attached):
[1] colorspace_2.1-0 ellipsis_0.3.2 mmrm_0.2.2 estimability_1.4.1
[5] farver_2.1.1 ggrepel_0.9.2 DT_0.26 fansi_1.0.5
[9] mvtnorm_1.1-3 codetools_0.2-18 splines_4.2.1 R.methodsS3_1.8.2
[13] cachem_1.0.8 knitr_1.45 jsonlite_1.8.7 broom_1.0.1
[17] geepack_1.3.9 R.oo_1.25.0 readr_2.1.3 compiler_4.2.1
[21] httr_1.4.7 emmeans_1.8.3 backports_1.4.1 assertthat_0.2.1
[25] fastmap_1.1.1 lazyeval_0.2.2 cli_3.6.1 later_1.3.1
[29] htmltools_0.5.7 tools_4.2.1 gtable_0.3.4 glue_1.6.2
[33] Rcpp_1.0.11 jquerylib_0.1.4 styler_1.10.2 vctrs_0.6.4
[37] nlme_3.1-160 teal.logger_0.1.3.9007 crosstalk_1.2.0 iterators_1.0.14
[41] xfun_0.41 stringr_1.5.1 rbibutils_2.2.11 shinyvalidate_0.1.3
[45] mime_0.12 lifecycle_1.0.4 renv_0.16.0 shinycssloaders_1.0.0
[49] MASS_7.3-58.1 hms_1.1.2 promises_1.2.1 parallel_4.2.1
[53] tern.gee_0.1.0.9000 yaml_2.3.7 memoise_2.0.1 gridExtra_2.3
[57] teal.widgets_0.4.1.9007 sass_0.4.7 stringi_1.8.1 foreach_1.5.2
[61] checkmate_2.3.0 shape_1.4.6 Rdpack_2.4 rlang_1.1.2
[65] pkgconfig_2.0.3 commonmark_1.9.0 evaluate_0.23 lattice_0.20-45
[69] teal.code_0.4.1.9007 fontawesome_0.5.2 purrr_1.0.2 labeling_0.4.3
[73] htmlwidgets_1.6.2 cowplot_1.1.1 tidyselect_1.2.0 logger_0.2.2
[77] R6_2.5.1 generics_0.1.3 pillar_1.9.0 withr_2.5.2
[81] survival_3.4-0 tibble_3.2.1 crayon_1.5.2 shinyWidgets_0.8.0
[85] utf8_1.2.4 plotly_4.10.3 tzdb_0.3.0 rmarkdown_2.25
[89] data.table_1.14.8 forcats_0.5.2 digest_0.6.33 tern.mmrm_0.2.1.9004
[93] xtable_1.8-4 R.cache_0.16.0 numDeriv_2016.8-1.1 tidyr_1.3.0
[97] httpuv_1.6.12 R.utils_2.12.2 munsell_0.5.0 viridisLite_0.4.2
[101] bslib_0.5.1 shinyjs_2.1.0
```
### Relevant log output
```R
Warning: Error in : The `title` theme element must be a object.
when evaluating qenv code:
print(p)
126:
125: stop
124: [[.qenv.error
122:
106: plot_r
97: renderUI
96: func
83: renderFunc
82: output$teal-main_ui-root-response_plots__pgis_-module-myplot-plot_out_main
1: runApp
```
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct.
### Contribution Guidelines
- [X] I agree to follow this project's Contribution Guidelines.
### Security Policy
- [X] I agree to follow this project's Security Policy.
Contributor guide
Assessment
This issue has not been assessed yet.