├── .Rbuildignore ├── .covrignore ├── .github ├── .gitignore ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflows │ ├── altdoc.yaml │ ├── check-standard.yaml │ ├── revdep.yaml │ └── rhub.yaml ├── .gitignore ├── .lintr ├── DESCRIPTION ├── LICENSE.md ├── Makefile ├── NAMESPACE ├── NEWS.md ├── NEWS.qmd ├── R ├── bind_est_gof.R ├── coef_rename.R ├── config_modelsummary.R ├── convenience.R ├── datasummary.R ├── datasummary_balance.R ├── datasummary_correlation.R ├── datasummary_crosstab.R ├── datasummary_df.R ├── datasummary_extract.R ├── datasummary_functions.R ├── datasummary_skim.R ├── dvnames.R ├── escape.R ├── factory.R ├── factory_DT.R ├── factory_dataframe.R ├── factory_flextable.R ├── factory_gt.R ├── factory_huxtable.R ├── factory_kableExtra.R ├── factory_markdown.R ├── factory_tinytable.R ├── factory_typst.R ├── fmt_factory.R ├── format_estimates.R ├── format_gof.R ├── format_msg.R ├── get_estimates.R ├── get_gof.R ├── get_vcov.R ├── glance_custom.R ├── gof_map.R ├── hush.R ├── map_estimates.R ├── map_gof.R ├── methods_did.R ├── methods_estimatr.R ├── methods_fixest.R ├── methods_lfe.R ├── methods_stats.R ├── modelplot.R ├── modelsummary.R ├── modelsummary_cbind.R ├── modelsummary_list.R ├── modelsummary_rbind.R ├── poorman.R ├── reexport.R ├── rename_statistics.R ├── sanitize_conf_level.R ├── sanitize_fmt.R ├── sanitize_gof_map.R ├── sanitize_models.R ├── sanitize_output.R ├── sanitize_shape.R ├── sanitize_statistic.R ├── sanitize_vcov.R ├── sanity_checks.R ├── settings.R ├── shape_estimates.R ├── span.R ├── stars.R ├── supported_models.R ├── themes.R ├── tidy_custom.R ├── update_modelsummary.R ├── utils_labels.R ├── utils_pad.R ├── utils_print.R ├── utils_replace.R ├── utils_stats.R ├── utils_warn.R └── zzz.R ├── README.md ├── README.qmd ├── altdoc ├── custom.scss ├── figures │ └── gallery │ │ ├── gallery.sh │ │ ├── gallery_00.png │ │ ├── gallery_01.png │ │ ├── gallery_02.png │ │ ├── gallery_03.png │ │ ├── gallery_04.png │ │ ├── gallery_05.png │ │ ├── gallery_06.png │ │ ├── gallery_07.png │ │ └── modelsummary_gallery.gif ├── images │ └── modelsummary_montage.png ├── pkgdown.yml └── quarto_website.yml ├── codecov.yml ├── docs ├── CITATION.html ├── CNAME ├── LICENSE.html ├── NEWS.html ├── custom.scss ├── figures │ └── gallery │ │ ├── gallery.sh │ │ ├── gallery_00.png │ │ ├── gallery_01.png │ │ ├── gallery_02.png │ │ ├── gallery_03.png │ │ ├── gallery_04.png │ │ ├── gallery_05.png │ │ ├── gallery_06.png │ │ ├── gallery_07.png │ │ └── modelsummary_gallery.gif ├── freeze.rds ├── images │ └── modelsummary_montage.png ├── index.html ├── man │ ├── coef_rename.html │ ├── config_modelsummary.html │ ├── datasummary.html │ ├── datasummary_balance.html │ ├── datasummary_correlation.html │ ├── datasummary_correlation_format.html │ ├── datasummary_crosstab.html │ ├── datasummary_df.html │ ├── datasummary_skim.html │ ├── dvnames.html │ ├── figures │ │ ├── modelsummary_gallery.gif │ │ └── squirrel.png │ ├── fmt_decimal.html │ ├── fmt_equivalence.html │ ├── fmt_sci.html │ ├── fmt_significant.html │ ├── fmt_sprintf.html │ ├── fmt_statistic.html │ ├── fmt_term.html │ ├── get_estimates.html │ ├── get_gof.html │ ├── gof_map.html │ ├── modelplot.html │ ├── modelplot_files │ │ └── figure-html │ │ │ ├── unnamed-chunk-1-1.png │ │ │ ├── unnamed-chunk-1-2.png │ │ │ ├── unnamed-chunk-1-3.png │ │ │ ├── unnamed-chunk-1-4.png │ │ │ ├── unnamed-chunk-1-5.png │ │ │ ├── unnamed-chunk-1-6.png │ │ │ ├── unnamed-chunk-1-7.png │ │ │ ├── unnamed-chunk-1-8.png │ │ │ └── unnamed-chunk-1-9.png │ ├── modelsummary.html │ └── update_modelsummary.html ├── pkgdown.yml ├── quarto_website.yml ├── search.json ├── site_libs │ ├── bootstrap │ │ ├── bootstrap-555d7fa6eb067a0c9d334ac7ef1a20f4.min.css │ │ ├── bootstrap-icons.css │ │ ├── bootstrap-icons.woff │ │ └── bootstrap.min.js │ ├── clipboard │ │ └── clipboard.min.js │ ├── crosstalk-1.2.1 │ │ ├── css │ │ │ └── crosstalk.min.css │ │ ├── js │ │ │ ├── crosstalk.js │ │ │ ├── crosstalk.js.map │ │ │ ├── crosstalk.min.js │ │ │ └── crosstalk.min.js.map │ │ └── scss │ │ │ └── crosstalk.scss │ ├── datatables-binding-0.33 │ │ └── datatables.js │ ├── datatables-css-0.0.0 │ │ └── datatables-crosstalk.css │ ├── dt-core-1.13.6 │ │ ├── css │ │ │ ├── jquery.dataTables.extra.css │ │ │ └── jquery.dataTables.min.css │ │ └── js │ │ │ └── jquery.dataTables.min.js │ ├── htmltools-fill-0.5.8.1 │ │ └── fill.css │ ├── htmlwidgets-1.6.4 │ │ └── htmlwidgets.js │ ├── jquery-3.6.0 │ │ ├── jquery-3.6.0.js │ │ ├── jquery-3.6.0.min.js │ │ └── jquery-3.6.0.min.map │ ├── quarto-html │ │ ├── anchor.min.js │ │ ├── popper.min.js │ │ ├── quarto-syntax-highlighting-0815c480559380816a4d1ea211a47e91.css │ │ ├── quarto.js │ │ ├── tabsets │ │ │ └── tabsets.js │ │ ├── tippy.css │ │ └── tippy.umd.min.js │ ├── quarto-nav │ │ ├── headroom.min.js │ │ └── quarto-nav.js │ └── quarto-search │ │ ├── autocomplete.umd.js │ │ ├── fuse.min.js │ │ └── quarto-search.js └── vignettes │ ├── appearance.html │ ├── datasummary.html │ ├── get_started.html │ ├── get_started_files │ └── figure-html │ │ └── unnamed-chunk-11-1.png │ ├── modelplot.html │ ├── modelplot_files │ └── figure-html │ │ ├── unnamed-chunk-10-1.png │ │ ├── unnamed-chunk-11-1.png │ │ ├── unnamed-chunk-12-1.png │ │ ├── unnamed-chunk-13-1.png │ │ ├── unnamed-chunk-17-1.png │ │ ├── unnamed-chunk-18-1.png │ │ ├── unnamed-chunk-18-2.png │ │ ├── unnamed-chunk-19-1.png │ │ ├── unnamed-chunk-21-1.png │ │ ├── unnamed-chunk-5-1.png │ │ ├── unnamed-chunk-6-1.png │ │ ├── unnamed-chunk-7-1.png │ │ └── unnamed-chunk-9-1.png │ ├── modelsummary.html │ ├── modelsummary_extension.html │ ├── modelsummary_files │ └── figure-html │ │ ├── unnamed-chunk-59-1.png │ │ └── unnamed-chunk-60-1.png │ └── tinytable_assets │ ├── id08c3f8na44kb75612pii.png │ ├── id61auzo1o1rwuwlpketpn.png │ ├── id6p13b7optms3h27luhcl.png │ ├── id8gsv2cx8zsypq391agab.png │ ├── id8tasa3kfjuj7o4k6hhov.png │ ├── idiymggq9dnrgf8usxvy6g.png │ ├── idkaopq13t9xo2lbnh1rwl.png │ ├── idlqg0dd0drzgvdaolj3ur.png │ ├── idn2hdwu10cvbopyoizigb.png │ ├── idna29sk1t9d2i9upkp009.png │ ├── ids90d17nvza4a74e5ihqw.png │ ├── idsvhu239f1jupzve7lrgo.png │ ├── iducm5ggch25zihcagicwx.png │ ├── idupukmeottomd07aer4v6.png │ ├── idvn3svdxnhip1lkbnhlnb.png │ ├── idvw051bbs6p01yk62ywdf.png │ └── idxbblp93zv1lrxpjl6yhr.png ├── examples ├── align.Rmd ├── appearance.Rmd ├── cross_references.Rmd ├── minimal.Rmd └── quarto.qmd ├── inst ├── CITATION ├── WORDLIST └── tinytest │ ├── _tinysnapshot │ ├── add_columns-dataframe.txt │ ├── align-md_dcolumn.txt │ ├── datasummary_balance-escape_FALSE.txt │ ├── datasummary_balance-escape_TRUE.txt │ ├── datasummary_balance-issue711.txt │ ├── escape-caption_notes.txt │ ├── escape-correlation_latex.txt │ ├── escape-correlation_latex_FALSE.txt │ ├── escape-crosstab_latex.txt │ ├── escape-crosstab_latex_FALSE.txt │ ├── escape-datasummary_escape_colnames.txt │ ├── escape-datasummary_escape_colnames_FALSE.txt │ ├── escape-escape.html │ ├── escape-escape_html_false.html │ ├── escape-hat_I_formula.txt │ ├── escape-hat_fixest.txt │ ├── escape-issue707_01.txt │ ├── escape-issue707_02.txt │ ├── escape-issue707_03.txt │ ├── escape-issue707_04.txt │ ├── escape-latex.txt │ ├── escape-latex_tabular_escape_false.txt │ ├── escape-latex_tabular_escape_true.txt │ ├── escape-modelsummary.html │ ├── escape-modelsummary_latex.txt │ ├── escape-modelsummary_latex2.txt │ ├── escape-modelsummary_latex_tabular_FALSE.txt │ ├── escape-panel_escape_FALSE.txt │ ├── escape-panel_escape_TRUE.txt │ ├── fmt-fmt_sci_2.txt │ ├── gt-background_color.html │ ├── gt-complex.html │ ├── gt-title.html │ ├── html-gof_omit.html │ ├── huxtable-md_title_note_stars.txt │ ├── interaction-markdown.txt │ ├── interaction-markdown_no_gof.txt │ ├── kableExtra-markdown_complex.txt │ ├── kableExtra-markdown_fmt.txt │ ├── latex-tabular.txt │ ├── mathmode-html_anything.html │ ├── mathmode-html_dollars.html │ ├── mathmode-latex_anything.txt │ ├── mathmode-latex_dollars.txt │ ├── mathmode-latex_ldd.txt │ ├── mathmode-latex_null.txt │ ├── mathmode-null.html │ ├── modelplot-coef_map_color_shape_background.svg │ ├── modelplot-coef_omit.svg │ ├── modelplot-issue861.svg │ ├── modelplot-multiple_plots_vanilla.svg │ ├── modelplot-vanilla.svg │ ├── modeplot-model_order.svg │ ├── modeplot-multiple_plots_facet.svg │ ├── output-title_not_indented.txt │ ├── pkg-fixest_model_names_single.txt │ ├── rbind-add_rows_rbind.txt │ ├── rbind-issue725_tinytable_hgroup.txt │ ├── rbind-issue849_with_panel_names.txt │ ├── rbind-issue849_without_panel_names.txt │ ├── rounding-datasummary_latex.txt │ ├── shape-multinom_wide.txt │ └── stars-issue798.txt │ ├── _tinysnapshot_review │ ├── modelplot-coef_map_color_shape_background.png │ ├── modelplot-coef_omit.png │ ├── modelplot-multiple_plots_vanilla.png │ ├── modelplot-vanilla.png │ ├── modeplot-model_order.png │ └── modeplot-multiple_plots_facet.png │ ├── helpers.R │ ├── known_output │ ├── add_columns_1.R │ ├── background_color.html │ ├── complex_table.html │ ├── conf.int.html │ ├── datasummary_balance_penguins.html │ ├── datasummary_correlation_1.R │ ├── datasummary_correlation_2.R │ ├── datasummary_correlation_3.R │ ├── datasummary_correlation_4.R │ ├── datasummary_correlation_5.R │ ├── datasummary_skim_1.R │ ├── escape_1.tex │ ├── escape_10.html │ ├── escape_10.tex │ ├── escape_2.tex │ ├── escape_3.html │ ├── escape_4.html │ ├── escape_5.tex │ ├── escape_6.tex │ ├── escape_7.tex │ ├── escape_8.tex │ ├── escape_9.html │ ├── escape_9.tex │ ├── gof_map_fstat.md │ ├── html_1.tex │ ├── huxtable-title-notes.md │ ├── interaction_markdown.md │ ├── kableExtra_markdown_complex.md │ ├── kableExtra_markdown_rounding_stars.md │ ├── latex_1.tex │ ├── mathmode_1.tex │ ├── mathmode_2.tex │ ├── mathmode_3.tex │ ├── mathmode_4.tex │ ├── mathmode_5.tex │ ├── mathmode_6.tex │ ├── mathmode_7.tex │ ├── mathmode_html_1.html │ ├── msummary_add_rows_1.md │ ├── msummary_fixest_i.md │ ├── msummary_interaction.md │ ├── na_1.tex │ ├── output-file.docx │ ├── output-file.jpg │ ├── output-file.md │ ├── output-file.png │ ├── output-file.pptx │ ├── output-file.rtf │ ├── output-file.tex │ ├── output-file.txt │ ├── output_1.tex │ ├── p.value.html │ ├── siunitx1.tex │ ├── statistic-override.rds │ ├── statistic.html │ ├── std.error.html │ ├── title.html │ └── title_subtitle.html │ ├── qayztocfynadtqlpmxceqftkvpwjih.pdf │ ├── test-aaa.R │ ├── test-add_columns.R │ ├── test-add_rows.R │ ├── test-align.R │ ├── test-bad-input.R │ ├── test-coef_map.R │ ├── test-coef_omit.R │ ├── test-coef_rename.R │ ├── test-conf_level.R │ ├── test-corner-cases.R │ ├── test-custom.R │ ├── test-datasummary.R │ ├── test-datasummary_balance.R │ ├── test-datasummary_correlation.R │ ├── test-datasummary_crosstab.R │ ├── test-datasummary_df.R │ ├── test-datasummary_skim.R │ ├── test-dvnames.R │ ├── test-ellipses.R │ ├── test-escape.R │ ├── test-estimate.R │ ├── test-exponentiate.R │ ├── test-extract_estimates.R │ ├── test-flextable.R │ ├── test-fmt.R │ ├── test-fstat.R │ ├── test-get_vcov_type.R │ ├── test-glue.R │ ├── test-gof.R │ ├── test-gof_map.R │ ├── test-gt.R │ ├── test-html.R │ ├── test-huxtable.R │ ├── test-interaction.R │ ├── test-kableExtra.R │ ├── test-labels.R │ ├── test-latex.R │ ├── test-mathmode.R │ ├── test-modelplot.R │ ├── test-modelsummary_list.R │ ├── test-output-file.R │ ├── test-output.R │ ├── test-pkg-MASS.R │ ├── test-pkg-brms.R │ ├── test-pkg-fixest.R │ ├── test-pkg-lavaan.R │ ├── test-pkg-lme4.R │ ├── test-pkg-marginaleffects.R │ ├── test-pkg-mgcv.R │ ├── test-pkg-stats.R │ ├── test-pkg-survival.R │ ├── test-rbind.R │ ├── test-rmarkdown.R │ ├── test-rounding.R │ ├── test-shape.R │ ├── test-stars.R │ ├── test-statistic.R │ ├── test-supported.R │ ├── test-tidy_custom.R │ ├── test-typst.R │ ├── test-unsupported.R │ ├── test-vcov.R │ ├── test-zzz-modelsummary_get.R │ └── test-zzz.R ├── man-roxygen ├── citation.R ├── kableExtra2tinytable.R ├── modelsummary_details.R ├── modelsummary_examples.R ├── modelsummary_parallel.R └── options.R ├── man ├── All.Rd ├── AllObs.Rd ├── Arguments.Rd ├── DropEmpty.Rd ├── Factor.Rd ├── Format.Rd ├── Heading.Rd ├── Histogram.Rd ├── Max.Rd ├── Mean.Rd ├── Median.Rd ├── Min.Rd ├── Multicolumn.Rd ├── N.Rd ├── NPercent.Rd ├── NUnique.Rd ├── Ncol.Rd ├── P0.Rd ├── P100.Rd ├── P25.Rd ├── P50.Rd ├── P75.Rd ├── Paste.Rd ├── Percent.Rd ├── PercentMissing.Rd ├── PlusMinus.Rd ├── RowFactor.Rd ├── RowNum.Rd ├── SD.Rd ├── Var.Rd ├── coef_rename.Rd ├── colLabels.Rd ├── config_modelsummary.Rd ├── datasummary.Rd ├── datasummary_balance.Rd ├── datasummary_correlation.Rd ├── datasummary_correlation_format.Rd ├── datasummary_crosstab.Rd ├── datasummary_df.Rd ├── datasummary_skim.Rd ├── do_call.Rd ├── dsummary.Rd ├── dvnames.Rd ├── escape_html.Rd ├── escape_latex.Rd ├── escape_string.Rd ├── figures │ ├── modelsummary_gallery.gif │ └── squirrel.png ├── fmt_decimal.Rd ├── fmt_equivalence.Rd ├── fmt_sci.Rd ├── fmt_significant.Rd ├── fmt_sprintf.Rd ├── fmt_statistic.Rd ├── fmt_term.Rd ├── get_estimates.Rd ├── get_gof.Rd ├── get_gof_broom.Rd ├── get_gof_parameters.Rd ├── get_vcov.Rd ├── get_vcov.mlm.Rd ├── glance_custom.Rd ├── glance_custom_internal.Rd ├── glance_custom_internal.default.Rd ├── glance_custom_internal.lm.Rd ├── gof_map.Rd ├── hush.Rd ├── labelSubset.Rd ├── map_estimates.Rd ├── map_gof.Rd ├── modelplot.Rd ├── modelsummary.Rd ├── msummary.Rd ├── reexports.Rd ├── rowLabels.Rd ├── supported_models.Rd ├── tidy_custom.Rd ├── tidy_custom_internal.Rd ├── tidy_custom_internal.default.Rd └── update_modelsummary.Rd ├── tests ├── figs │ ├── coef-map-color-shape-background.svg │ ├── coef-omit.svg │ ├── deps.txt │ ├── multiple-plots-facet.svg │ ├── multiple-plots-vanilla.svg │ └── vanilla.svg ├── spelling.R └── tinytest.R ├── utilities └── output_format_table.R └── vignettes ├── appearance.qmd ├── datasummary.qmd ├── get_started.qmd ├── modelplot.qmd ├── modelsummary.qmd └── modelsummary_extension.qmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | tests/testthat/test-output.R 2 | tests/testthat/test-output-file.R 3 | tests/testthat/test-supported.R 4 | tests/testthat/test-tidy_custom.R 5 | ^renv$ 6 | ^renv\.lock$ 7 | ^LICENSE\.md$ 8 | ^.*\.Rproj$ 9 | ^\.Rproj\.user$ 10 | ^examples$ 11 | .covrignore 12 | cran-comments.md 13 | ^CRAN-RELEASE$ 14 | ^appveyor\.yml$ 15 | ^_pkgdown\.yml$ 16 | docs/ 17 | doc/ 18 | vignettes/ 19 | vignettes/modelsummary_rbind.Rmd 20 | vignettes 21 | ^pkgdown$ 22 | ^pkgdown/ 23 | README.Rmd 24 | README.qmd 25 | utilities 26 | utilities/ 27 | ^\.github$ 28 | ^codecov\.yml$ 29 | ^docs$ 30 | calibre.* 31 | .lintr 32 | .projectile 33 | man-roxygen 34 | ^CRAN-SUBMISSION$ 35 | Makefile 36 | trash.* 37 | ^altdoc$ 38 | ^_quarto$ 39 | ^_quarto/ 40 | inst/tinytest/tinytable_assets/ 41 | NEWS.qmd 42 | -------------------------------------------------------------------------------- /.covrignore: -------------------------------------------------------------------------------- 1 | R/convenience.R 2 | R/datasummary_functions.R 3 | R/sanity_checks.R 4 | R/gof_map.R 5 | R/bind.R 6 | R/glance_custom.R # lfe no longer on CRAN 7 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | Before reporting a bug, please update to the latest development version of `modelsummary` and make sure the bug has not been fixed yet. You can update `modelsummary` and all its dependencies with: 10 | 11 | ```r 12 | modelsummary::update_modelsummary() 13 | ``` 14 | 15 | Then, restart your R session completely and try again. 16 | 17 | 18 | Bug reports must include: 19 | 20 | 1. *Concise* description of the bug 21 | 2. *Minimal* reproducible example using publicly available data and the bare minimum code and libraries needed to reproduce the bug. 22 | - Consider using the `mtcars` dataset which is distributed by default with `R`, or one of the [CSV files from the RDatasets archive.](https://vincentarelbundock.github.io/Rdatasets/articles/data.html) 23 | 3. `sessionInfo()` output 24 | 25 | Make sure you are running the *latest development version* of `modelsummary` and its dependencies: https://modelsummary.com/#installation 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .DS_Store 5 | docs 6 | inst/doc 7 | settings.json 8 | renv/ 9 | renv.lock 10 | .Rprofile 11 | trash* 12 | .vscode 13 | man/figures/ 14 | altdoc/freeze.rds 15 | _quarto/ 16 | ^_quarto$ 17 | cran-comments.md 18 | inst/tinytest/tinytable_assets/ 19 | !_quarto/_freeze/ 20 | -------------------------------------------------------------------------------- /.lintr: -------------------------------------------------------------------------------- 1 | linters: with_defaults( 2 | object_name_linter = NULL, 3 | line_length_linter(160), 4 | single_quotes_linter = NULL, 5 | seq_linter = NULL, 6 | open_curly_linter = NULL, 7 | closed_curly_linter = NULL 8 | ) 9 | exclusions: list("tests", "vignettes", "docs", "examples", "inst") 10 | exclude: "^#|warning|stop|sprintf|msg|message" 11 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help testall testone document documentrich check install buildsite deploysite buildpdf 2 | 3 | help: ## Display this help screen 4 | @echo -e "\033[1mAvailable commands:\033[0m\n" 5 | @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort 6 | 7 | testall: ## tinytest::build_install_test() 8 | Rscript -e "tinytest::build_install_test(ncpu = 8)" 9 | 10 | testone: ## make testone testfile="inst/tinytest/test-aaa-warn_once.R" 11 | Rscript -e "pkgload::load_all();tinytest::run_test_file('$(testfile)')" 12 | 13 | document: ## devtools::document() 14 | Rscript -e "devtools::document()" 15 | 16 | check: document ## devtools::check() 17 | Rscript -e "devtools::check()" 18 | 19 | install: document ## devtools::install() 20 | # R CMD INSTALL . 21 | Rscript -e "devtools::install(dependencies = FALSE)" 22 | 23 | deps: ## install dependencies 24 | Rscript -e "devtools::install(dependencies = TRUE)" 25 | 26 | deploy: ## pkgdown::deploy_to_branch() 27 | Rscript -e "pkgdown::deploy_to_branch()" 28 | 29 | website: install ## render vignettes and website 30 | rm -rf docs 31 | Rscript -e "altdoc::render_docs(verbose = TRUE)" 32 | git restore docs/CNAME 33 | 34 | buildpdf: document ## document + R CMD Rd2pdf . 35 | R CMD Rd2pdf . 36 | -------------------------------------------------------------------------------- /R/bind_est_gof.R: -------------------------------------------------------------------------------- 1 | bind_est_gof <- function(est, gof) { 2 | if (!inherits(gof, "data.frame") || nrow(gof) == 0) { 3 | return(est) 4 | } 5 | 6 | if ("model" %in% colnames(est)) { 7 | return(est) 8 | } 9 | 10 | if (!"term" %in% colnames(est)) { 11 | termcol <- setdiff(colnames(est), "part")[1] 12 | data.table::setnames(gof, old = "term", new = termcol) 13 | } 14 | 15 | if (all(colnames(gof) %in% colnames(est))) { 16 | out <- bind_rows(est, gof) 17 | return(out) 18 | } 19 | 20 | # partial matches on model names, but not on known columns 21 | bad <- c("part", "term", "model", "group", "statistic") 22 | bad <- stats::na.omit(match(bad, colnames(est))) 23 | 24 | idx <- sapply(colnames(gof), function(x) { # first matches 25 | setdiff(grep(x, colnames(est), fixed = TRUE), bad)[1] 26 | }) 27 | idx <- stats::na.omit(idx) 28 | if (length(idx) > 0) { 29 | data.table::setnames(gof, old = names(idx), new = names(est)[idx]) 30 | out <- bind_rows(est, gof) 31 | } else { 32 | out <- est 33 | } 34 | 35 | return(out) 36 | } 37 | -------------------------------------------------------------------------------- /R/factory_DT.R: -------------------------------------------------------------------------------- 1 | #' Internal function to build table with `DT` 2 | #' 3 | #' @inheritParams factory_gt 4 | #' @noRd 5 | #' @return DT object 6 | factory_DT <- function( 7 | tab, 8 | align = NULL, 9 | hrule = NULL, 10 | notes = NULL, 11 | title = NULL, 12 | escape = TRUE, 13 | ...) { 14 | 15 | insight::check_if_installed("DT") 16 | 17 | colnames(tab) <- gsub("\\|\\|\\|\\|", " / ", colnames(tab)) 18 | 19 | dots <- list(...) 20 | dots[["internal_call"]] <- NULL 21 | args <- list( 22 | tab, 23 | caption = title, 24 | escape = escape, 25 | rownames = FALSE) 26 | args <- c(args, dots) 27 | do.call(DT::datatable, args) 28 | } 29 | -------------------------------------------------------------------------------- /R/format_msg.R: -------------------------------------------------------------------------------- 1 | format_msg <- function(x) { 2 | x <- strsplit(x, split = "\n")[[1]] 3 | x <- trimws(x) 4 | x <- paste0("\n", paste(x, collapse = "\n"), "\n") 5 | return(x) 6 | } 7 | -------------------------------------------------------------------------------- /R/glance_custom.R: -------------------------------------------------------------------------------- 1 | #' Extract custom information from a model object and turn it into a tidy 2 | #' data.frame or tibble with a single row. 3 | #' 4 | #' To customize the output of a model of class `lm`, you can define a new 5 | #' method called `glance_custom.lm` which returns a one-row data.frame. 6 | #' 7 | #' @param x model or other R object to convert to single-row data frame 8 | #' @param ... ellipsis 9 | #' 10 | #' @keywords internal 11 | #' @export 12 | glance_custom <- function(x, ...) { 13 | UseMethod("glance_custom") 14 | } 15 | 16 | #' @inherit glance_custom 17 | #' @noRd 18 | #' @export 19 | glance_custom.default <- function(x, ...) NULL 20 | 21 | 22 | #' Avoid namespace conflict when we want to customize glance internally and 23 | #' still allow users to do the same with their own functions 24 | #' @keywords internal 25 | glance_custom_internal <- function(x, ...) { 26 | UseMethod("glance_custom_internal") 27 | } 28 | 29 | #' @inherit glance_custom_internal 30 | #' @keywords internal 31 | glance_custom_internal.default <- function(x, ...) NULL 32 | -------------------------------------------------------------------------------- /R/hush.R: -------------------------------------------------------------------------------- 1 | #' Execute code silently 2 | #' 3 | #' @keywords internal 4 | hush <- function(code) { 5 | void <- utils::capture.output({ 6 | out <- invisible( 7 | suppressMessages( 8 | suppressWarnings( 9 | tryCatch(code, error = function(e) NULL)) 10 | ) 11 | ) 12 | }) 13 | return(out) 14 | } 15 | -------------------------------------------------------------------------------- /R/map_gof.R: -------------------------------------------------------------------------------- 1 | #' Internal function to subset, rename and re-order gof statistics 2 | #' 3 | #' @keywords internal 4 | map_gof <- function(gof, gof_omit, gof_map) { 5 | 6 | if (is.null(gof) || isTRUE(nrow(gof) == 0)) { 7 | return(gof) 8 | } 9 | 10 | # row identifier as first column 11 | gof$part <- "gof" 12 | gof <- gof[, unique(c("part", "term", names(gof)))] 13 | 14 | # gof_omit 15 | if (!is.null(gof_omit)) { 16 | idx <- !grepl(gof_omit, gof$term, perl = TRUE) 17 | gof <- gof[idx, , drop = FALSE] 18 | } 19 | 20 | 21 | # map 22 | gm_raw <- sapply(gof_map, function(x) x$raw) 23 | gm_clean <- sapply(gof_map, function(x) x$clean) 24 | gm_omit <- try(sapply(gof_map, function(x) x$omit), silent = TRUE) 25 | 26 | if (is.logical(gm_omit)) { 27 | if (isTRUE(attr(gof_map, "whitelist"))) { 28 | gof <- gof[gof$term %in% gm_clean[gm_omit == FALSE], , drop = FALSE] 29 | } else { 30 | gof <- gof[!gof$term %in% gm_clean[gm_omit == TRUE], , drop = FALSE] 31 | } 32 | } else { 33 | if (isTRUE(attr(gof_map, "whitelist"))) { 34 | gof <- gof[gof$term %in% gm_clean, , drop = FALSE] 35 | } 36 | } 37 | 38 | tmp <- gm_clean[match(gof$term, gm_raw)] 39 | tmp[is.na(tmp)] <- gof$term[is.na(tmp)] 40 | gof$term <- tmp 41 | idx <- match(gof$term, gm_clean) 42 | # hack to keep unmatched gof at the end of the table 43 | # important for unknown glance_custom entries 44 | idx[is.na(idx)] <- 1e6 + 1:sum(is.na(idx)) 45 | gof <- gof[order(idx, gof$term), ] 46 | 47 | # important for modelsummary_get = "all" 48 | gof <- unique(gof) 49 | 50 | return(gof) 51 | } 52 | 53 | -------------------------------------------------------------------------------- /R/methods_did.R: -------------------------------------------------------------------------------- 1 | #' @include glance_custom.R 2 | #' @keywords internal 3 | glance_custom_internal.MP <- function(x, vcov_type = NULL, ...) { 4 | insight::check_if_installed("did") 5 | out <- data.frame(row.names = "firstrow") 6 | if (is.null(vcov_type) || !vcov_type %in% c("vector", "matrix", "function")) { 7 | if (x$DIDparams$bstrap) { 8 | if (!is.null(x$DIDparams$clustervars)) { 9 | cluster_vars = paste(x$DIDparams$clustervars, collapse = " & ") 10 | } else { 11 | cluster_vars = x$DIDparams$idname 12 | } 13 | out[['vcov.type']] <- paste("by:", cluster_vars) 14 | } 15 | } 16 | row.names(out) <- NULL 17 | return(out) 18 | } 19 | 20 | 21 | #' @keywords internal 22 | glance_custom_internal.AGGTEobj <- glance_custom_internal.MP 23 | -------------------------------------------------------------------------------- /R/methods_estimatr.R: -------------------------------------------------------------------------------- 1 | #' @include glance_custom.R 2 | #' @keywords internal 3 | glance_custom_internal.lm_robust <- function(x, vcov_type = NULL, ...) { 4 | insight::check_if_installed("estimatr") 5 | out <- data.frame(row.names = "firstrow") 6 | if (is.null(vcov_type) || !vcov_type %in% c("vector", "matrix", "function")) { 7 | if (x$clustered) { 8 | # use `se_type` otherwise displayed on separate rows from `vcov.type` 9 | out[["se_type"]] <- paste("by:", x$call$clusters) 10 | } 11 | } 12 | row.names(out) <- NULL 13 | return(out) 14 | } 15 | 16 | 17 | #' @keywords internal 18 | glance_custom_internal.iv_robust <- glance_custom_internal.lm_robust 19 | -------------------------------------------------------------------------------- /R/methods_lfe.R: -------------------------------------------------------------------------------- 1 | #' @include glance_custom.R 2 | #' @keywords internal 3 | glance_custom_internal.felm <- function(x, vcov_type = NULL, ...) { 4 | insight::check_if_installed("lfe") 5 | out <- data.frame(row.names = "firstrow") 6 | if (is.null(vcov_type) || !vcov_type %in% c("vector", "matrix", "function")) { 7 | if (!is.null(x$clustervar)) { 8 | cluster_vars <- paste(names(x$clustervar), collapse = " & ") 9 | out[['vcov.type']] <- paste("by:", cluster_vars) 10 | } 11 | } 12 | row.names(out) <- NULL 13 | return(out) 14 | } 15 | -------------------------------------------------------------------------------- /R/modelsummary_cbind.R: -------------------------------------------------------------------------------- 1 | get_span_cbind <- function(models, shape) { 2 | if (!isTRUE(shape == "cbind")) { 3 | out <- list(models = models, shape = shape, span_cbind = NULL) 4 | return(out) 5 | } 6 | 7 | flag <- is.list(models) && 8 | all(sapply(models, function(x) is.list(x))) && 9 | !is.null(names(models)) 10 | msg <- "With `shape='cbind', `models` must be a named list of lists of models." 11 | if (!flag) insight::format_error(msg) 12 | 13 | # spans 14 | model_names <- rep(names(models), sapply(models, length)) 15 | model_indices <- seq_along(model_names) 16 | indices_list <- split(model_indices, model_names) 17 | final_indices <- lapply(indices_list, function(x) range(x)) 18 | spans <- lapply(final_indices, function(x) x + 1) # stub in normal regression table 19 | 20 | # models 21 | # after spans 22 | if (settings_equal("output_factory", "tinytable")) { 23 | models <- do.call(c, unname(models)) 24 | } else { 25 | models <- do.call(c, models) 26 | } 27 | 28 | out <- list( 29 | models = models, 30 | shape = NULL, 31 | span_cbind = spans) 32 | 33 | return(out) 34 | } 35 | 36 | 37 | set_span_cbind <- function(tab, span_cbind) { 38 | out <- tab 39 | if (!is.null(span_cbind) && inherits(tab, "tinytable")) { 40 | out <- tinytable::group_tt(out, j = span_cbind) 41 | } 42 | return(out) 43 | } -------------------------------------------------------------------------------- /R/modelsummary_list.R: -------------------------------------------------------------------------------- 1 | #' Extract parameter estimates from a `modelsummary_list` object. 2 | #' 3 | #' A `modelsummary_list` is a simple list which holds two data.frames names 4 | #' "glance" and "tidy", and to which we have attached the class 5 | #' "modelsummary_list". This allows us to manually create objects that will be 6 | #' printed nicely by `modelsummary` (see Examples section). 7 | #' 8 | #' @param x a list of class `modelsummary_list` (see Examples section) 9 | #' @param ... other parameters are accepted by ignored 10 | #' @examples 11 | #' if (identical(Sys.getenv("pkgdown"), "true")) { 12 | #' mod <- list( 13 | #' tidy = data.frame(term = c("A", "B"), 14 | #' estimate = 1:2, 15 | #' std.error = 3:4), 16 | #' glance = data.frame(nobs = 10)) 17 | #' class(mod) <- c("modelsummary_list", class(mod)) 18 | #' 19 | #' modelsummary(mod) 20 | #' } 21 | #' @noRd 22 | #' @export 23 | tidy.modelsummary_list <- function(x, ...) { 24 | if ("tidy" %in% names(x)) { 25 | x[["tidy"]] 26 | } else { 27 | stop('The `modelsummary_list` list must include an element named "tidy".') 28 | } 29 | } 30 | 31 | #' Extract goodness-of-fit statistics from a `modelsummary_list` object. 32 | #' 33 | #' @inherit tidy.modelsummary_list 34 | #' @noRd 35 | #' @export 36 | glance.modelsummary_list <- function(x, ...) { 37 | if ("glance" %in% names(x)) { 38 | out <- x[["glance"]] 39 | } else { 40 | out <- data.frame(row.names = 1) 41 | } 42 | out 43 | } 44 | -------------------------------------------------------------------------------- /R/rename_statistics.R: -------------------------------------------------------------------------------- 1 | rename_statistics <- function(x, conf_level = 0.95, statistic = NULL, estimate = NULL) { 2 | lb <- (1 - conf_level) / .02 3 | ub <- (conf_level + (1 - conf_level) / 2) * 100 4 | lb <- sprintf("%.1f %%", lb) 5 | ub <- sprintf("%.1f %%", ub) 6 | 7 | dict <- c( 8 | "conf.low" = lb, 9 | "conf.high" = ub, 10 | "estimate" = "Est.", 11 | "std.error" = "S.E.", 12 | "p.value" = "p", 13 | "statistic" = "t", 14 | "{estimate}" = "Est.", 15 | "{std.error}" = "S.E.", 16 | "{p.value}" = "p", 17 | "{statistic}" = "t", 18 | "{stars}" = "" 19 | ) 20 | 21 | if (!is.null(names(estimate))) { 22 | for (i in seq_along(estimate)) { 23 | dict[[estimate[[i]]]] <- names(estimate)[i] 24 | } 25 | } 26 | 27 | if (!is.null(names(statistic))) { 28 | # Otherwise model indentifiers get flatted in things like 29 | # `statistic = c("Confidence interval" = "conf.int")` 30 | names(statistic)[names(statistic) == ""] <- "\u00a0" 31 | for (i in seq_along(statistic)) { 32 | dict[[statistic[[i]]]] <- names(statistic)[i] 33 | } 34 | } 35 | 36 | out <- replace_dict(x, dict) 37 | return(out) 38 | } 39 | -------------------------------------------------------------------------------- /R/sanitize_conf_level.R: -------------------------------------------------------------------------------- 1 | #' sanity check 2 | #' 3 | #' @noRd 4 | sanity_conf_level_modelplot <- function(conf_level) { 5 | flag <- checkmate::check_number( 6 | conf_level, 7 | lower = 0, 8 | upper = .999999999999, 9 | null.ok = TRUE) 10 | if (!isTRUE(flag)) { 11 | msg <- format_msg( 12 | "The `conf_level` argument must be a number between 0 and 1. Type `?modelplot` 13 | for details. This error is sometimes raised when users supply multiple models 14 | to `modelplot` but forget to wrap them in a list. This works: 15 | `modelplot(list(model1, model2))`. This does *not* work: `modelplot(model1, 16 | model2)`") 17 | stop(msg, call. = FALSE) 18 | } 19 | } 20 | 21 | 22 | #' sanity check 23 | #' 24 | #' @noRd 25 | sanitize_conf_level <- function(conf_level, estimate, statistic) { 26 | checkmate::assert_number(conf_level, lower = 0, upper = .999999999999, null.ok = TRUE) 27 | # faster to omit CI when we don't need it 28 | if (any(grepl("conf", unlist(c(estimate, statistic))))) { 29 | return(conf_level) 30 | } else { 31 | return(NULL) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /R/sanitize_fmt.R: -------------------------------------------------------------------------------- 1 | #' sanity check 2 | #' 3 | #' @noRd 4 | sanitize_fmt <- function(fmt, ...) { 5 | checkmate::assert( 6 | checkmate::check_numeric(fmt, len = 1, lower = 0), 7 | checkmate::check_class(fmt, "fmt_factory"), 8 | checkmate::check_function(fmt), 9 | checkmate::check_string(fmt, pattern = "%"), 10 | # checkmate::check_list(fmt, names = "unique"), 11 | checkmate::check_null(fmt)) 12 | 13 | if (inherits(fmt, "fmt_factory")) { 14 | out <- fmt 15 | } else if (isTRUE(checkmate::check_string(fmt))) { 16 | out <- fmt_sprintf(fmt) 17 | } else if (isTRUE(checkmate::check_numeric(fmt))) { 18 | out <- fmt_decimal(fmt) 19 | } else if (isTRUE(checkmate::check_function(fmt))) { 20 | out <- fmt_function(fmt) 21 | } else if (isTRUE(checkmate::check_null(fmt))) { 22 | out <- fmt_identity() 23 | } 24 | return(out) 25 | } 26 | -------------------------------------------------------------------------------- /R/sanitize_models.R: -------------------------------------------------------------------------------- 1 | sanitize_models <- function(models, ...) { 2 | 3 | # before sanity_vcov 4 | # models must be a list use first class rather than `inherits` because some 5 | # models inherit from list 6 | if (class(models)[1] != "list") { 7 | models <- list(models) 8 | } 9 | 10 | # fixest::fixest_multi 11 | # handles cases with `split` or with both `fsplit` and ` do this before 12 | # wrapping into a list vincent personally uses this type of model a lot, 13 | # but he does not want to hard-code a ton of exceptions like this. 14 | fixest_multi_to_list <- function(i) { 15 | if (!inherits(models[[i]], "fixest_multi")) { 16 | # list() because c() later 17 | return(stats::setNames(list(models[[i]]), names(models)[i])) 18 | } 19 | # no names or default names 20 | if (is.null(names(models[[i]])) || all(grepl("^lhs|^sample.var", names(models[[i]])))) { 21 | nam <- paste(names(models)[i], fixest_multi_names(models[[i]])) 22 | } else { 23 | nam <- paste(names(models)[i], names(models[[i]])) 24 | } 25 | stats::setNames(as.list(models[[i]]), nam) 26 | } 27 | 28 | out <- list() 29 | for (i in seq_along(models)) { 30 | out <- c(out, fixest_multi_to_list(i)) 31 | } 32 | 33 | for (m in out) { 34 | sanity_dots(m, ...) 35 | } 36 | 37 | return(out) 38 | } 39 | -------------------------------------------------------------------------------- /R/sanitize_statistic.R: -------------------------------------------------------------------------------- 1 | #' sanity_check 2 | #' 3 | #' @noRd 4 | sanitize_statistic <- function(statistic, shape, conf_level) { 5 | checkmate::assert_character(statistic, null.ok = TRUE) 6 | 7 | if (is.null(conf_level) && any(grepl("conf", statistic))) { 8 | msg <- "Cannot display a confidence interval when `conf_level=NULL`." 9 | stop(msg, call. = FALSE) 10 | } 11 | 12 | if ("statistic" %in% shape$rhs && "conf.int" %in% statistic) { 13 | idx <- grep("conf.int", statistic) 14 | statistic[idx] <- "conf.low" 15 | # conf.int in last position 16 | if (idx == length(statistic)) { 17 | statistic <- c(statistic, "conf.high") 18 | } else { 19 | statistic <- c(statistic[1:idx], "conf.high", statistic[(idx + 1):length(statistic)]) 20 | } 21 | } 22 | return(statistic) 23 | } 24 | -------------------------------------------------------------------------------- /R/shape_estimates.R: -------------------------------------------------------------------------------- 1 | #' internal function to reshape grouped estimates 2 | #' 3 | #' @keywords internal 4 | #' @noRd 5 | shape_estimates <- function(estimates, shape, conf_level, statistic, estimate) { 6 | # default 7 | if (isTRUE(all.equal(shape$shape_formula, term + statistic ~ model))) { 8 | return(estimates) 9 | } 10 | 11 | shape_formula <- shape$shape_formula 12 | 13 | idx <- intersect(colnames(estimates), c("term", "statistic", "group", shape$group_name)) 14 | 15 | # long 16 | out <- data.table::melt(data.table::data.table(estimates), 17 | id.vars = idx, 18 | variable.name = "model", 19 | value.name = "estimate") 20 | 21 | if ("statistic" %in% shape$rhs) { 22 | out$statistic <- rename_statistics(out$statistic, conf_level = conf_level, statistic = statistic, estimate = estimate) 23 | } 24 | 25 | # use factors to preserve order in `dcast` 26 | for (col in c("part", "model", "term", shape$group_name, "statistic")) { 27 | if (col %in% colnames(out)) { 28 | out[[col]] <- factor(out[[col]], unique(out[[col]])) 29 | } 30 | } 31 | 32 | # wide 33 | out <- data.table::dcast(eval(shape_formula), 34 | data = out, 35 | value.var = "estimate", 36 | sep = "||||") 37 | 38 | data.table::setDF(out) 39 | 40 | out[out == "NA"] <- "" 41 | out[is.na(out)] <- "" 42 | 43 | # empty columns 44 | idx <- sapply(out, function(x) !all(x == "")) 45 | out <- out[, idx, drop = FALSE] 46 | 47 | # empty rows 48 | idx <- setdiff(colnames(out), c("part", "term", "statistic", "model")) 49 | tmp <- out[, idx, drop = FALSE] 50 | idx <- apply(tmp, 1, function(x) !all(x == "")) 51 | out <- out[idx, ] 52 | 53 | return(out) 54 | } 55 | -------------------------------------------------------------------------------- /R/stars.R: -------------------------------------------------------------------------------- 1 | #' Internal function to prepare stars 2 | #' 3 | #' @noRd 4 | clean_stars <- function(stars) { 5 | if (is.logical(stars) && isTRUE(stars)) { 6 | out <- c('+' = .1, '*' = .05, '**' = .01, '***' = 0.001) 7 | } else if (is.numeric(stars)) { 8 | out <- sort(stars, decreasing = TRUE) 9 | } else { 10 | out <- NULL 11 | } 12 | return(out) 13 | } 14 | 15 | 16 | #' Internal function to prepare stars 17 | #' 18 | #' @noRd 19 | make_stars <- function(pvalues, stars) { 20 | stars <- clean_stars(stars) 21 | tmp <- "" 22 | for (n in names(stars)) { 23 | tmp <- ifelse(pvalues <= stars[n], n, tmp) 24 | } 25 | 26 | # Remove this code because the new tinytable default uses a better set of options for siunitx by default, which handles *-+() gracefully 27 | # if (identical(output_format, "latex") && settings_equal("dcolumn_stars_mbox", TRUE)) { 28 | # tmp <- sprintf(" \\mbox{%s}", tmp) 29 | # } 30 | 31 | tmp 32 | } 33 | 34 | 35 | #' Internal function to prepare stars footnote 36 | #' 37 | #' @noRd 38 | make_stars_note <- function(stars, output_format = NULL, output_factory = NULL) { 39 | out <- clean_stars(stars) 40 | if (!is.null(out)) { 41 | if (identical(output_format, "latex") && identical(output_factory, "tinytable")) { 42 | out <- paste0(names(out), ' p \\num{< ', out, "}") 43 | } else { 44 | out <- paste0(names(out), ' p < ', out) 45 | } 46 | out <- paste0(out, collapse = ', ') 47 | } 48 | return(out) 49 | } 50 | -------------------------------------------------------------------------------- /R/supported_models.R: -------------------------------------------------------------------------------- 1 | #' List of model objects from which `modelsummary` can extract estimates and 2 | #' statistics 3 | #' 4 | #' @keywords internal 5 | #' @export 6 | supported_models <- function() { 7 | broom_tidy <- ls(getNamespace("broom")) 8 | broom_tidy <- broom_tidy[grepl("^tidy", broom_tidy)] 9 | broom_supported <- gsub("^tidy.", "", broom_tidy) 10 | easystats_tidy <- ls(getNamespace("parameters")) 11 | easystats_tidy <- easystats_tidy[grepl("^model_parameters", easystats_tidy)] 12 | easystats_supported <- gsub("^model_parameters.", "", easystats_tidy) 13 | supported <- sort(unique(c(broom_supported, easystats_supported))) 14 | return(supported) 15 | } 16 | -------------------------------------------------------------------------------- /R/tidy_custom.R: -------------------------------------------------------------------------------- 1 | #' Extract custom information from a model object and turn it into a tidy 2 | #' data.frame or tibble 3 | #' 4 | #' To customize the output of a model of class `lm`, you can define a method 5 | #' called `tidy_custom.lm` which returns a data.frame with a column called 6 | #' "term", and the other columns you want to use as "estimate" or "statistic" 7 | #' in your `modelsummary()` call. The output of this method must be similar to 8 | #' the result of `tidy(model)`. 9 | #' 10 | #' @param x An object to be converted into a tidy data.frame or tibble. 11 | #' @return A data.frame or tibble with information about model components. 12 | #' @keywords internal 13 | #' @export 14 | tidy_custom <- function(x) { 15 | UseMethod("tidy_custom") 16 | } 17 | 18 | #' @inherit tidy_custom 19 | #' @noRd 20 | #' @export 21 | tidy_custom.default <- function(x) NULL 22 | 23 | #' Avoid namespace conflict when we want to customize glance internally and 24 | #' still allow users to do the same with their own functions 25 | #' @keywords internal 26 | tidy_custom_internal <- function(x, ...) { 27 | UseMethod("tidy_custom_internal") 28 | } 29 | 30 | #' @inherit tidy_custom_internal 31 | #' @keywords internal 32 | tidy_custom_internal.default <- function(x, ...) NULL 33 | -------------------------------------------------------------------------------- /R/update_modelsummary.R: -------------------------------------------------------------------------------- 1 | #' Update `modelsummary` and its dependencies 2 | #' 3 | #' Update `modelsummary` and its dependencies to the latest R-Universe or CRAN versions. The R session needs to be restarted after install. 4 | #' 5 | #' @param source one of two strings: "development" or "cran" 6 | #' @export 7 | update_modelsummary <- function(source = "development") { 8 | checkmate::assert_choice(source, choices = c("development", "cran")) 9 | if (source == "development") { 10 | repo_easystats <- "https://easystats.r-universe.dev" 11 | repo_vab <- "https://vincentarelbundock.r-universe.dev" 12 | } else { 13 | repo_vab <- repo_easystats <- getOption("repos")["CRAN"] 14 | } 15 | utils::install.packages("insight", repos = repo_easystats) 16 | utils::install.packages("parameters", repos = repo_easystats) 17 | utils::install.packages("performance", repos = repo_easystats) 18 | utils::install.packages("modelsummary", repos = repo_vab) 19 | utils::install.packages("tinytable", repos = repo_vab) 20 | msg <- "Please restart your R session" 21 | msg <- c("", strrep("#", nchar(msg)), msg, strrep("#", nchar(msg))) 22 | insight::format_alert(msg) 23 | } 24 | -------------------------------------------------------------------------------- /R/utils_print.R: -------------------------------------------------------------------------------- 1 | #' internal print method for raw html and latex 2 | #' 3 | #' @export 4 | #' @keywords internal 5 | #' @noRd 6 | print.modelsummary_string <- function(x, ...) { 7 | cat(x, "\n", sep = "", ...) 8 | invisible(x) 9 | } 10 | -------------------------------------------------------------------------------- /R/utils_replace.R: -------------------------------------------------------------------------------- 1 | #' replace character vector entries using a named vector dictionary 2 | #' @noRd 3 | #' 4 | replace_dict <- function(x, dict, interaction = FALSE) { 5 | for (i in seq_along(dict)) { 6 | x[x == names(dict)[i]] <- dict[i] 7 | # substitute each side of the interaction only if the coef_map doesn't 8 | # include interactions, which means that the user specified them the long 9 | # explicit way. 10 | if (interaction && !any(grepl(":", names(dict)))) { 11 | # can't use regex because of "(Intercept)" and similar user-defined arbitrary strings 12 | x <- gsub(sprintf(":%s:", names(dict)[i]), paste0(":", dict[i], ":"), x, fixed = TRUE) 13 | x <- gsub(sprintf(":%s", names(dict)[i]), paste0(":", dict[i]), x, fixed = TRUE) 14 | x <- gsub(sprintf("%s:", names(dict)[i]), paste0(dict[i], ":"), x, fixed = TRUE) 15 | } 16 | } 17 | 18 | return(x) 19 | } 20 | -------------------------------------------------------------------------------- /R/utils_stats.R: -------------------------------------------------------------------------------- 1 | weighted_sd <- function(x, w) { 2 | # Adapted from `vtable` by Nick Huntington-Klein under MIT license 3 | if (min(w) < 0) { 4 | stop('Negative weights found.') 5 | } 6 | idx <- !is.na(x) & !is.na(w) 7 | x <- x[idx] 8 | w <- w[idx] 9 | weightsum <- sum(w) 10 | if (weightsum == 0) { 11 | stop('Weights sum to 0 among nonmissing data.') 12 | } 13 | mean_x <- sum(w * x) / weightsum 14 | num_nonzero <- sum(w > 0) 15 | var_x <- sum(w * ((x - mean_x)^2)) / (weightsum * (num_nonzero - 1) / num_nonzero) 16 | sd_x <- sqrt(var_x) 17 | return(sd_x) 18 | } -------------------------------------------------------------------------------- /R/utils_warn.R: -------------------------------------------------------------------------------- 1 | warn_once <- function(msg, id) { 2 | id <- paste0("modelsummary_warning_", id) 3 | msg <- paste(msg, "This warning appears once per session.") 4 | if (isTRUE(getOption(id, default = TRUE))) { 5 | warning(msg, call. = FALSE) 6 | opts <- list(FALSE) 7 | names(opts) <- id 8 | options(opts) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | .onAttach <- function(libname, pkgname) { 2 | if (isTRUE(config_get("startup_message"))) { 3 | # packageStartupMessage(msg) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /altdoc/custom.scss: -------------------------------------------------------------------------------- 1 | /*-- scss:defaults --*/ 2 | @import url(http://fonts.googleapis.com/css?family=Lato|Roboto|Open+Sans:400italic,700italic,400,700); 3 | @import url(http://fonts.googleapis.com/css?family=Source+Code+Pro:400italic,700italic,400,700); 4 | $font-family-sans-serif: 'Lato'; 5 | 6 | $body-color: #222 !default; 7 | $link-color: #5e7ca1; 8 | $code-color: #222; 9 | $navbar-bg: #ececec; 10 | $navbar-fg: #222; 11 | $navbar-hl: #5e7ca1; 12 | $sidebar-fg: #222; 13 | $sidebar-hl: #5e7ca1; 14 | $toc-color: #222; 15 | $toc-hl: #5e7ca1; 16 | 17 | .table { 18 | font-size: .8em; 19 | } 20 | -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Define the output GIF filename 4 | output_gif="modelsummary_gallery.gif" 5 | 6 | # Use ImageMagick to create an animated GIF from images starting with 'tinytable_gallery_' 7 | # -delay is increased for a slower animation (e.g., 100 equals 1 second per frame) 8 | # -resize option is used to fit images within a 1280x720 frame (16:9 aspect ratio) 9 | # convert -delay 250 -loop 0 tinytable_gallery_*.png -resize 1250x690 -gravity center -extent 1280x720 "$output_gif" 10 | # convert -delay 250 -loop 0 tinytable_gallery_*.png -resize 1000x500 -gravity center -extent 1025x576 "$output_gif" 11 | convert -delay 400 -loop 0 gallery_*.png -resize 1000x500 -gravity center -extent 1025x576 -layers Optimize -colors 128 "$output_gif" 12 | 13 | # Display a message when done 14 | echo "Animated GIF created: $output_gif" 15 | -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/gallery_00.png -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/gallery_01.png -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/gallery_02.png -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/gallery_03.png -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/gallery_04.png -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/gallery_05.png -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/gallery_06.png -------------------------------------------------------------------------------- /altdoc/figures/gallery/gallery_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/gallery_07.png -------------------------------------------------------------------------------- /altdoc/figures/gallery/modelsummary_gallery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/figures/gallery/modelsummary_gallery.gif -------------------------------------------------------------------------------- /altdoc/images/modelsummary_montage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/altdoc/images/modelsummary_montage.png -------------------------------------------------------------------------------- /altdoc/pkgdown.yml: -------------------------------------------------------------------------------- 1 | urls: 2 | reference: https://modelsummary.com/man 3 | article: https://modelsummary.com/vignettes -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | 3 | coverage: 4 | status: 5 | project: 6 | default: 7 | target: auto 8 | threshold: 1% 9 | informational: true 10 | patch: 11 | default: 12 | target: auto 13 | threshold: 1% 14 | informational: true 15 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | modelsummary.com -------------------------------------------------------------------------------- /docs/custom.scss: -------------------------------------------------------------------------------- 1 | /*-- scss:defaults --*/ 2 | @import url(http://fonts.googleapis.com/css?family=Lato|Roboto|Open+Sans:400italic,700italic,400,700); 3 | @import url(http://fonts.googleapis.com/css?family=Source+Code+Pro:400italic,700italic,400,700); 4 | $font-family-sans-serif: 'Lato'; 5 | 6 | $body-color: #222 !default; 7 | $link-color: #5e7ca1; 8 | $code-color: #222; 9 | $navbar-bg: #ececec; 10 | $navbar-fg: #222; 11 | $navbar-hl: #5e7ca1; 12 | $sidebar-fg: #222; 13 | $sidebar-hl: #5e7ca1; 14 | $toc-color: #222; 15 | $toc-hl: #5e7ca1; 16 | 17 | .table { 18 | font-size: .8em; 19 | } 20 | -------------------------------------------------------------------------------- /docs/figures/gallery/gallery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Define the output GIF filename 4 | output_gif="modelsummary_gallery.gif" 5 | 6 | # Use ImageMagick to create an animated GIF from images starting with 'tinytable_gallery_' 7 | # -delay is increased for a slower animation (e.g., 100 equals 1 second per frame) 8 | # -resize option is used to fit images within a 1280x720 frame (16:9 aspect ratio) 9 | # convert -delay 250 -loop 0 tinytable_gallery_*.png -resize 1250x690 -gravity center -extent 1280x720 "$output_gif" 10 | # convert -delay 250 -loop 0 tinytable_gallery_*.png -resize 1000x500 -gravity center -extent 1025x576 "$output_gif" 11 | convert -delay 400 -loop 0 gallery_*.png -resize 1000x500 -gravity center -extent 1025x576 -layers Optimize -colors 128 "$output_gif" 12 | 13 | # Display a message when done 14 | echo "Animated GIF created: $output_gif" 15 | -------------------------------------------------------------------------------- /docs/figures/gallery/gallery_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/gallery_00.png -------------------------------------------------------------------------------- /docs/figures/gallery/gallery_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/gallery_01.png -------------------------------------------------------------------------------- /docs/figures/gallery/gallery_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/gallery_02.png -------------------------------------------------------------------------------- /docs/figures/gallery/gallery_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/gallery_03.png -------------------------------------------------------------------------------- /docs/figures/gallery/gallery_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/gallery_04.png -------------------------------------------------------------------------------- /docs/figures/gallery/gallery_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/gallery_05.png -------------------------------------------------------------------------------- /docs/figures/gallery/gallery_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/gallery_06.png -------------------------------------------------------------------------------- /docs/figures/gallery/gallery_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/gallery_07.png -------------------------------------------------------------------------------- /docs/figures/gallery/modelsummary_gallery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/figures/gallery/modelsummary_gallery.gif -------------------------------------------------------------------------------- /docs/freeze.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/freeze.rds -------------------------------------------------------------------------------- /docs/images/modelsummary_montage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/images/modelsummary_montage.png -------------------------------------------------------------------------------- /docs/man/figures/modelsummary_gallery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/figures/modelsummary_gallery.gif -------------------------------------------------------------------------------- /docs/man/figures/squirrel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/figures/squirrel.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-2.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-3.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-4.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-5.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-6.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-7.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-8.png -------------------------------------------------------------------------------- /docs/man/modelplot_files/figure-html/unnamed-chunk-1-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/man/modelplot_files/figure-html/unnamed-chunk-1-9.png -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | urls: 2 | reference: https://modelsummary.com/man 3 | article: https://modelsummary.com/vignettes -------------------------------------------------------------------------------- /docs/site_libs/bootstrap/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/site_libs/bootstrap/bootstrap-icons.woff -------------------------------------------------------------------------------- /docs/site_libs/crosstalk-1.2.1/css/crosstalk.min.css: -------------------------------------------------------------------------------- 1 | .container-fluid.crosstalk-bscols{margin-left:-30px;margin-right:-30px;white-space:normal}body>.container-fluid.crosstalk-bscols{margin-left:auto;margin-right:auto}.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:inline-block;padding-right:12px;vertical-align:top}@media only screen and (max-width: 480px){.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:block;padding-right:inherit}}.crosstalk-input{margin-bottom:15px}.crosstalk-input .control-label{margin-bottom:0;vertical-align:middle}.crosstalk-input input[type="checkbox"]{margin:4px 0 0;margin-top:1px;line-height:normal}.crosstalk-input .checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.crosstalk-input .checkbox>label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.crosstalk-input .checkbox input[type="checkbox"],.crosstalk-input .checkbox-inline input[type="checkbox"]{position:absolute;margin-top:2px;margin-left:-20px}.crosstalk-input .checkbox+.checkbox{margin-top:-5px}.crosstalk-input .checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.crosstalk-input .checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px} 2 | -------------------------------------------------------------------------------- /docs/site_libs/datatables-css-0.0.0/datatables-crosstalk.css: -------------------------------------------------------------------------------- 1 | .dt-crosstalk-fade { 2 | opacity: 0.2; 3 | } 4 | 5 | html body div.DTS div.dataTables_scrollBody { 6 | background: none; 7 | } 8 | 9 | 10 | /* 11 | Fix https://github.com/rstudio/DT/issues/563 12 | If the `table.display` is set to "block" (e.g., pkgdown), the browser will display 13 | datatable objects strangely. The search panel and the page buttons will still be 14 | in full-width but the table body will be "compact" and shorter. 15 | In therory, having this attributes will affect `dom="t"` 16 | with `display: block` users. But in reality, there should be no one. 17 | We may remove the below lines in the future if the upstream agree to have this there. 18 | See https://github.com/DataTables/DataTablesSrc/issues/160 19 | */ 20 | 21 | table.dataTable { 22 | display: table; 23 | } 24 | 25 | 26 | /* 27 | When DTOutput(fill = TRUE), it receives a .html-fill-item class (via htmltools::bindFillRole()), which effectively amounts to `flex: 1 1 auto`. That's mostly fine, but the case where `fillContainer=TRUE`+`height:auto`+`flex-basis:auto` and the container (e.g., a bslib::card()) doesn't have a defined height is a bit problematic since the table wants to fit the parent but the parent wants to fit the table, which results pretty small table height (maybe because there is a minimum height somewhere?). It seems better in this case to impose a 400px height default for the table, which we can do by setting `flex-basis` to 400px (the table is still allowed to grow/shrink when the container has an opinionated height). 28 | */ 29 | 30 | .html-fill-container > .html-fill-item.datatables { 31 | flex-basis: 400px; 32 | } 33 | -------------------------------------------------------------------------------- /docs/site_libs/dt-core-1.13.6/css/jquery.dataTables.extra.css: -------------------------------------------------------------------------------- 1 | /* Selected rows/cells */ 2 | table.dataTable tr.selected td, table.dataTable td.selected { 3 | background-color: #b0bed9 !important; 4 | } 5 | /* In case of scrollX/Y or FixedHeader */ 6 | .dataTables_scrollBody .dataTables_sizing { 7 | visibility: hidden; 8 | } 9 | 10 | /* The datatables' theme CSS file doesn't define 11 | the color but with white background. It leads to an issue that 12 | when the HTML's body color is set to 'white', the user can't 13 | see the text since the background is white. One case happens in the 14 | RStudio's IDE when inline viewing the DT table inside an Rmd file, 15 | if the IDE theme is set to "Cobalt". 16 | 17 | See https://github.com/rstudio/DT/issues/447 for more info 18 | 19 | This fixes should have little side-effects because all the other elements 20 | of the default theme use the #333 font color. 21 | 22 | TODO: The upstream may use relative colors for both the table background 23 | and the color. It means the table can display well without this patch 24 | then. At that time, we need to remove the below CSS attributes. 25 | */ 26 | div.datatables { 27 | color: #333; 28 | } 29 | -------------------------------------------------------------------------------- /docs/site_libs/htmltools-fill-0.5.8.1/fill.css: -------------------------------------------------------------------------------- 1 | @layer htmltools { 2 | .html-fill-container { 3 | display: flex; 4 | flex-direction: column; 5 | /* Prevent the container from expanding vertically or horizontally beyond its 6 | parent's constraints. */ 7 | min-height: 0; 8 | min-width: 0; 9 | } 10 | .html-fill-container > .html-fill-item { 11 | /* Fill items can grow and shrink freely within 12 | available vertical space in fillable container */ 13 | flex: 1 1 auto; 14 | min-height: 0; 15 | min-width: 0; 16 | } 17 | .html-fill-container > :not(.html-fill-item) { 18 | /* Prevent shrinking or growing of non-fill items */ 19 | flex: 0 0 auto; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/tippy.css: -------------------------------------------------------------------------------- 1 | .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} -------------------------------------------------------------------------------- /docs/vignettes/get_started_files/figure-html/unnamed-chunk-11-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/get_started_files/figure-html/unnamed-chunk-11-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-10-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-10-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-11-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-11-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-17-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-18-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-18-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-18-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-18-2.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-21-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-21-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-6-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-7-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelplot_files/figure-html/unnamed-chunk-9-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelplot_files/figure-html/unnamed-chunk-9-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelsummary_files/figure-html/unnamed-chunk-59-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelsummary_files/figure-html/unnamed-chunk-59-1.png -------------------------------------------------------------------------------- /docs/vignettes/modelsummary_files/figure-html/unnamed-chunk-60-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/modelsummary_files/figure-html/unnamed-chunk-60-1.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/id08c3f8na44kb75612pii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/id08c3f8na44kb75612pii.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/id61auzo1o1rwuwlpketpn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/id61auzo1o1rwuwlpketpn.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/id6p13b7optms3h27luhcl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/id6p13b7optms3h27luhcl.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/id8gsv2cx8zsypq391agab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/id8gsv2cx8zsypq391agab.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/id8tasa3kfjuj7o4k6hhov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/id8tasa3kfjuj7o4k6hhov.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idiymggq9dnrgf8usxvy6g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idiymggq9dnrgf8usxvy6g.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idkaopq13t9xo2lbnh1rwl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idkaopq13t9xo2lbnh1rwl.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idlqg0dd0drzgvdaolj3ur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idlqg0dd0drzgvdaolj3ur.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idn2hdwu10cvbopyoizigb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idn2hdwu10cvbopyoizigb.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idna29sk1t9d2i9upkp009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idna29sk1t9d2i9upkp009.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/ids90d17nvza4a74e5ihqw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/ids90d17nvza4a74e5ihqw.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idsvhu239f1jupzve7lrgo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idsvhu239f1jupzve7lrgo.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/iducm5ggch25zihcagicwx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/iducm5ggch25zihcagicwx.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idupukmeottomd07aer4v6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idupukmeottomd07aer4v6.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idvn3svdxnhip1lkbnhlnb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idvn3svdxnhip1lkbnhlnb.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idvw051bbs6p01yk62ywdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idvw051bbs6p01yk62ywdf.png -------------------------------------------------------------------------------- /docs/vignettes/tinytable_assets/idxbblp93zv1lrxpjl6yhr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/docs/vignettes/tinytable_assets/idxbblp93zv1lrxpjl6yhr.png -------------------------------------------------------------------------------- /examples/align.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: pdf_document 3 | --- 4 | 5 | ```{r} 6 | library(modelsummary) 7 | 8 | mod <- list( 9 | 'One variable' = lm(mpg ~ hp, mtcars), 10 | 'Two variables' = lm(mpg ~ hp + drat, mtcars) 11 | ) 12 | 13 | modelsummary( 14 | mod, 15 | statistic = c("t = {statistic}", "conf.int", "{std.error} ({p.value})"), 16 | stars = TRUE, 17 | align = "ldd") 18 | ``` -------------------------------------------------------------------------------- /examples/cross_references.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Cross-references with `Rmarkdown`, `bookdown` and `modelsummary` 3 | output: 4 | bookdown::pdf_document2: 5 | toc: false 6 | --- 7 | 8 | The `bookdown` package allows you to compile PDF documents with table numbers and cross references. To do this, you must include a title in your table, use the `\@ref{tab:name}` construct, and give a name to the `R` chunk where `modelsummary` is called. 9 | 10 | For example, see Table \@ref(tab:test). 11 | 12 | ```{r} 13 | library(modelsummary) 14 | mod <- lm(hp ~ mpg, mtcars) 15 | modelsummary(mod, title = '(#tab:test) This title describes the content of this table.') 16 | ``` 17 | -------------------------------------------------------------------------------- /examples/minimal.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | pdf_document: default 4 | rtf_document: default 5 | html_document: default 6 | --- 7 | 8 | ```{r} 9 | library(modelsummary) 10 | 11 | mod <- list() 12 | mod[['One variable']] <- lm(mpg ~ hp, mtcars) 13 | mod[['Two variables']] <- lm(mpg ~ hp + drat, mtcars) 14 | 15 | modelsummary(mod) 16 | ``` 17 | -------------------------------------------------------------------------------- /examples/quarto.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | format: pdf 3 | --- 4 | 5 | 6 | @tbl-quarto shows a simple model using the built-in Quarto cross-referencing system. 7 | 8 | ```{r} 9 | #| label: tbl-quarto 10 | #| tbl-cap: "Blah blah" 11 | library(modelsummary) 12 | library(plm) 13 | 14 | data("Grunfeld", package = "plm") 15 | mod <- plm(inv ~ value + capital, data = Grunfeld, model = "within", effect = "twoways") 16 | 17 | modelsummary(mod, align = "ld") 18 | ``` 19 | 20 | Table \ref{tab:latex} shows a simple model using the LaTeX cross-referencing system. Note that specifying `\label{}` in the `title` argument is not recommended in Quarto or Rmarkdown documents. One should use chunk options instead. 21 | 22 | ```{r} 23 | modelsummary(mod, align = "ld", title = "Blah blah \\label{tab:latex}", escape = FALSE) 24 | ``` -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | bibentry(bibtype = "Article", 2 | title = "{modelsummary}: Data and Model Summaries in {R}", 3 | author = person(given = "Vincent", 4 | family = "Arel-Bundock", 5 | email = "vincent.arel-bundock@umontreal.ca"), 6 | journal = "Journal of Statistical Software", 7 | year = "2022", 8 | volume = "103", 9 | number = "1", 10 | pages = "1--23", 11 | doi = "10.18637/jss.v103.i01", 12 | header = "To cite modelsummary in publications use:" 13 | ) 14 | 15 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/add_columns-dataframe.txt: -------------------------------------------------------------------------------- 1 | first mean sd last 2 | 1 blah mpg 20.09 6.03 2.00 3 | 2 junk hp 146.69 68.56 4.00 4 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/align-md_dcolumn.txt: -------------------------------------------------------------------------------- 1 | 2 | +--------------+----------+ 3 | | | (1) | 4 | +==============+==========+ 5 | | (Intercept) | 24.447 | 6 | +--------------+----------+ 7 | | | (2.571) | 8 | +--------------+----------+ 9 | | I(hp/1000) | -46.879 | 10 | +--------------+----------+ 11 | | | (14.515) | 12 | +--------------+----------+ 13 | | am | 5.163 | 14 | +--------------+----------+ 15 | | | (1.454) | 16 | +--------------+----------+ 17 | | vs | 2.569 | 18 | +--------------+----------+ 19 | | | (1.942) | 20 | +--------------+----------+ 21 | | factor(cyl)6 | -2.652 | 22 | +--------------+----------+ 23 | | | (1.796) | 24 | +--------------+----------+ 25 | | factor(cyl)8 | -0.277 | 26 | +--------------+----------+ 27 | | | (3.487) | 28 | +--------------+----------+ 29 | | Num.Obs. | 32 | 30 | +--------------+----------+ 31 | | R2 | 0.836 | 32 | +--------------+----------+ 33 | | R2 Adj. | 0.804 | 34 | +--------------+----------+ 35 | | AIC | 160.9 | 36 | +--------------+----------+ 37 | | BIC | 171.2 | 38 | +--------------+----------+ 39 | | Log.Lik. | -73.460 | 40 | +--------------+----------+ 41 | | F | 26.491 | 42 | +--------------+----------+ 43 | | RMSE | 2.40 | 44 | +--------------+----------+ 45 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-caption_notes.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{talltblr}[ %% tabularray outer open 4 | caption={banana\_fish}, 5 | note{}={foo\_bar}, 6 | note{ }={hello\_world}, 7 | ] %% tabularray outer close 8 | { %% tabularray inner open 9 | colspec={Q[]Q[]}, 10 | column{2}={}{halign=c,}, 11 | column{1}={}{halign=l,}, 12 | hline{10}={1,2}{solid, black, 0.05em}, 13 | } %% tabularray inner close 14 | \toprule 15 | & (1) \\ \midrule %% TinyTableHeader 16 | (Intercept) & \num{13.315} \\ 17 | & (\num{5.545}) \\ 18 | xfoo\_bar & \num{6.051} \\ 19 | & (\num{1.712}) \\ 20 | xhello\_world & \num{-4.004} \\ 21 | & (\num{1.576}) \\ 22 | drat & \num{1.793} \\ 23 | & (\num{1.509}) \\ 24 | Num.Obs. & \num{32} \\ 25 | R2 & \num{0.745} \\ 26 | R2 Adj. & \num{0.718} \\ 27 | AIC & \num{171.0} \\ 28 | BIC & \num{178.3} \\ 29 | Log.Lik. & \num{-80.495} \\ 30 | RMSE & \num{2.99} \\ 31 | \bottomrule 32 | \end{talltblr} 33 | \end{table} 34 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-correlation_latex.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]}, 7 | column{1}={}{halign=l,}, 8 | column{2,3,4,5,6,7,8,9,10,11,12}={}{halign=r,}, 9 | } %% tabularray inner close 10 | \toprule 11 | & under\_score & oh\&yeah2 & disp & hp & drat & wt & qsec & vs & am & gear & carb \\ \midrule %% TinyTableHeader 12 | under\_score & 1 & . & . & . & . & . & . & . & . & . & . \\ 13 | oh\&yeah2 & \num{-.85} & 1 & . & . & . & . & . & . & . & . & . \\ 14 | disp & \num{-.85} & \num{.90} & 1 & . & . & . & . & . & . & . & . \\ 15 | hp & \num{-.78} & \num{.83} & \num{.79} & 1 & . & . & . & . & . & . & . \\ 16 | drat & \num{.68} & \num{-.70} & \num{-.71} & \num{-.45} & 1 & . & . & . & . & . & . \\ 17 | wt & \num{-.87} & \num{.78} & \num{.89} & \num{.66} & \num{-.71} & 1 & . & . & . & . & . \\ 18 | qsec & \num{.42} & \num{-.59} & \num{-.43} & \num{-.71} & \num{.09} & \num{-.17} & 1 & . & . & . & . \\ 19 | vs & \num{.66} & \num{-.81} & \num{-.71} & \num{-.72} & \num{.44} & \num{-.55} & \num{.74} & 1 & . & . & . \\ 20 | am & \num{.60} & \num{-.52} & \num{-.59} & \num{-.24} & \num{.71} & \num{-.69} & \num{-.23} & \num{.17} & 1 & . & . \\ 21 | gear & \num{.48} & \num{-.49} & \num{-.56} & \num{-.13} & \num{.70} & \num{-.58} & \num{-.21} & \num{.21} & \num{.79} & 1 & . \\ 22 | carb & \num{-.55} & \num{.53} & \num{.39} & \num{.75} & \num{-.09} & \num{.43} & \num{-.66} & \num{-.57} & \num{.06} & \num{.27} & 1 \\ 23 | \bottomrule 24 | \end{tblr} 25 | \end{table} 26 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-correlation_latex_FALSE.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]Q[]}, 7 | column{1}={}{halign=l,}, 8 | column{2,3,4,5,6,7,8,9,10,11,12}={}{halign=r,}, 9 | } %% tabularray inner close 10 | \toprule 11 | & under_score & oh&yeah2 & disp & hp & drat & wt & qsec & vs & am & gear & carb \\ \midrule %% TinyTableHeader 12 | under_score & 1 & . & . & . & . & . & . & . & . & . & . \\ 13 | oh&yeah2 & \num{-.85} & 1 & . & . & . & . & . & . & . & . & . \\ 14 | disp & \num{-.85} & \num{.90} & 1 & . & . & . & . & . & . & . & . \\ 15 | hp & \num{-.78} & \num{.83} & \num{.79} & 1 & . & . & . & . & . & . & . \\ 16 | drat & \num{.68} & \num{-.70} & \num{-.71} & \num{-.45} & 1 & . & . & . & . & . & . \\ 17 | wt & \num{-.87} & \num{.78} & \num{.89} & \num{.66} & \num{-.71} & 1 & . & . & . & . & . \\ 18 | qsec & \num{.42} & \num{-.59} & \num{-.43} & \num{-.71} & \num{.09} & \num{-.17} & 1 & . & . & . & . \\ 19 | vs & \num{.66} & \num{-.81} & \num{-.71} & \num{-.72} & \num{.44} & \num{-.55} & \num{.74} & 1 & . & . & . \\ 20 | am & \num{.60} & \num{-.52} & \num{-.59} & \num{-.24} & \num{.71} & \num{-.69} & \num{-.23} & \num{.17} & 1 & . & . \\ 21 | gear & \num{.48} & \num{-.49} & \num{-.56} & \num{-.13} & \num{.70} & \num{-.58} & \num{-.21} & \num{.21} & \num{.79} & 1 & . \\ 22 | carb & \num{-.55} & \num{.53} & \num{.39} & \num{.75} & \num{-.09} & \num{.43} & \num{-.66} & \num{-.57} & \num{.06} & \num{.27} & 1 \\ 23 | \bottomrule 24 | \end{tblr} 25 | \end{table} 26 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-crosstab_latex.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]Q[]Q[]Q[]}, 7 | column{1,2,3}={}{halign=l,}, 8 | column{4,5,6}={}{halign=r,}, 9 | } %% tabularray inner close 10 | \toprule 11 | under\_score1 & under\_score2 & & 0 & 1 & All \\ \midrule %% TinyTableHeader 12 | 0 & 3 & N & 12 & 0 & 12 \\ 13 | & & \% row & \num{100.0} & \num{0.0} & \num{100.0} \\ 14 | & 4 & N & 0 & 2 & 2 \\ 15 | & & \% row & \num{0.0} & \num{100.0} & \num{100.0} \\ 16 | & 5 & N & 0 & 4 & 4 \\ 17 | & & \% row & \num{0.0} & \num{100.0} & \num{100.0} \\ 18 | 1 & 3 & N & 3 & 0 & 3 \\ 19 | & & \% row & \num{100.0} & \num{0.0} & \num{100.0} \\ 20 | & 4 & N & 4 & 6 & 10 \\ 21 | & & \% row & \num{40.0} & \num{60.0} & \num{100.0} \\ 22 | & 5 & N & 0 & 1 & 1 \\ 23 | & & \% row & \num{0.0} & \num{100.0} & \num{100.0} \\ 24 | & All & N & 19 & 13 & 32 \\ 25 | & & \% row & \num{59.4} & \num{40.6} & \num{100.0} \\ 26 | \bottomrule 27 | \end{tblr} 28 | \end{table} 29 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-crosstab_latex_FALSE.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]Q[]Q[]Q[]}, 7 | column{1,2,3}={}{halign=l,}, 8 | column{4,5,6}={}{halign=r,}, 9 | } %% tabularray inner close 10 | \toprule 11 | under_score1 & under_score2 & & 0 & 1 & All \\ \midrule %% TinyTableHeader 12 | 0 & 3 & N & 12 & 0 & 12 \\ 13 | & & % row & \num{100.0} & \num{0.0} & \num{100.0} \\ 14 | & 4 & N & 0 & 2 & 2 \\ 15 | & & % row & \num{0.0} & \num{100.0} & \num{100.0} \\ 16 | & 5 & N & 0 & 4 & 4 \\ 17 | & & % row & \num{0.0} & \num{100.0} & \num{100.0} \\ 18 | 1 & 3 & N & 3 & 0 & 3 \\ 19 | & & % row & \num{100.0} & \num{0.0} & \num{100.0} \\ 20 | & 4 & N & 4 & 6 & 10 \\ 21 | & & % row & \num{40.0} & \num{60.0} & \num{100.0} \\ 22 | & 5 & N & 0 & 1 & 1 \\ 23 | & & % row & \num{0.0} & \num{100.0} & \num{100.0} \\ 24 | & All & N & 19 & 13 & 32 \\ 25 | & & % row & \num{59.4} & \num{40.6} & \num{100.0} \\ 26 | \bottomrule 27 | \end{tblr} 28 | \end{table} 29 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-datasummary_escape_colnames.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{1}={}{halign=l,}, 8 | column{2,3}={}{halign=r,}, 9 | } %% tabularray inner close 10 | \toprule 11 | & \% & Money \$\$ \\ \midrule %% TinyTableHeader 12 | under\_score & \num{20.09} & \num{6.03} \\ 13 | hp & \num{146.69} & \num{68.56} \\ 14 | \bottomrule 15 | \end{tblr} 16 | \end{table} 17 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-datasummary_escape_colnames_FALSE.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{1}={}{halign=l,}, 8 | column{2,3}={}{halign=r,}, 9 | } %% tabularray inner close 10 | \toprule 11 | & % & Money $$ \\ \midrule %% TinyTableHeader 12 | under_score & \num{20.09} & \num{6.03} \\ 13 | hp & \num{146.69} & \num{68.56} \\ 14 | \bottomrule 15 | \end{tblr} 16 | \end{table} 17 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-hat_I_formula.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]}, 7 | column{2}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{10}={1,2}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) \\ \midrule %% TinyTableHeader 13 | (Intercept) & \num{36.016} \\ 14 | & (\num{1.774}) \\ 15 | I(wt\textasciicircum{}2) & \num{-1.219} \\ 16 | & (\num{0.268}) \\ 17 | disp & \num{-0.043} \\ 18 | & (\num{0.008}) \\ 19 | I(wt\textasciicircum{}2) × disp & \num{0.002} \\ 20 | & (\num{0.001}) \\ 21 | Num.Obs. & \num{32} \\ 22 | R2 & \num{0.840} \\ 23 | R2 Adj. & \num{0.823} \\ 24 | AIC & \num{156.2} \\ 25 | BIC & \num{163.5} \\ 26 | Log.Lik. & \num{-73.088} \\ 27 | F & \num{48.886} \\ 28 | RMSE & \num{2.38} \\ 29 | \bottomrule 30 | \end{tblr} 31 | \end{table} 32 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-hat_fixest.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]}, 7 | column{2}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{4}={1,2}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) \\ \midrule %% TinyTableHeader 13 | x1 & \num{0.791} \\ 14 | & (\num{0.127}) \\ 15 | Num.Obs. & \num{150} \\ 16 | R2 & \num{0.735} \\ 17 | R2 Adj. & \num{0.714} \\ 18 | R2 Within & \num{0.275} \\ 19 | R2 Within Adj. & \num{0.269} \\ 20 | AIC & \num{192.8} \\ 21 | BIC & \num{228.9} \\ 22 | RMSE & \num{0.42} \\ 23 | Std.Errors & by: fe1\textasciicircum{}fe2 \\ 24 | FE: fe1 & X \\ 25 | FE: fe2 & X \\ 26 | FE: fe3 & X \\ 27 | \bottomrule 28 | \end{tblr} 29 | \end{table} 30 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-issue707_01.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{talltblr}[ %% tabularray outer open 4 | caption={blah\_blah}, 5 | ] %% tabularray outer close 6 | { %% tabularray inner open 7 | colspec={Q[]Q[]}, 8 | column{2}={}{halign=c,}, 9 | column{1}={}{halign=l,}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) \\ \midrule %% TinyTableHeader 13 | (Intercept) & \num{30.099} \\ 14 | & (\num{1.634}) \\ 15 | hp & \num{-0.068} \\ 16 | & (\num{0.010}) \\ 17 | \bottomrule 18 | \end{talltblr} 19 | \end{table} 20 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-issue707_02.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{talltblr}[ %% tabularray outer open 4 | caption={blah\_blah}, 5 | ] %% tabularray outer close 6 | { %% tabularray inner open 7 | colspec={Q[]Q[]Q[]}, 8 | column{1}={}{halign=l,}, 9 | column{2,3}={}{halign=r,}, 10 | } %% tabularray inner close 11 | \toprule 12 | & mean & sd \\ \midrule %% TinyTableHeader 13 | mpg & \num{20.09} & \num{6.03} \\ 14 | hp & \num{146.69} & \num{68.56} \\ 15 | \bottomrule 16 | \end{talltblr} 17 | \end{table} 18 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-issue707_03.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{talltblr}[ %% tabularray outer open 4 | caption={blah_blah}, 5 | ] %% tabularray outer close 6 | { %% tabularray inner open 7 | colspec={Q[]Q[]}, 8 | column{2}={}{halign=c,}, 9 | column{1}={}{halign=l,}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) \\ \midrule %% TinyTableHeader 13 | (Intercept) & \num{30.099} \\ 14 | & (\num{1.634}) \\ 15 | hp & \num{-0.068} \\ 16 | & (\num{0.010}) \\ 17 | \bottomrule 18 | \end{talltblr} 19 | \end{table} 20 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-issue707_04.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{talltblr}[ %% tabularray outer open 4 | caption={blah_blah}, 5 | ] %% tabularray outer close 6 | { %% tabularray inner open 7 | colspec={Q[]Q[]Q[]}, 8 | column{1}={}{halign=l,}, 9 | column{2,3}={}{halign=r,}, 10 | } %% tabularray inner close 11 | \toprule 12 | & mean & sd \\ \midrule %% TinyTableHeader 13 | mpg & \num{20.09} & \num{6.03} \\ 14 | hp & \num{146.69} & \num{68.56} \\ 15 | \bottomrule 16 | \end{talltblr} 17 | \end{table} 18 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-latex.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{2,3}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{10}={1,2,3}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & First\&Second & Third\_Fourth \\ \midrule %% TinyTableHeader 13 | (Intercept) & \num{-103.772} & \num{-103.772} \\ 14 | & (\num{103.551}) & (\num{103.551}) \\ 15 | under\_score & \num{-3.899} & \num{-3.899} \\ 16 | & (\num{2.072}) & (\num{2.072}) \\ 17 | oh\&yeah2 & \num{29.329} & \num{29.329} \\ 18 | & (\num{7.169}) & (\num{7.169}) \\ 19 | drat & \num{40.961} & \num{40.961} \\ 20 | & (\num{17.115}) & (\num{17.115}) \\ 21 | Num.Obs. & \num{32} & \num{32} \\ 22 | R2 & \num{0.759} & \num{0.759} \\ 23 | R2 Adj. & \num{0.733} & \num{0.733} \\ 24 | AIC & \num{324.9} & \num{324.9} \\ 25 | BIC & \num{332.2} & \num{332.2} \\ 26 | Log.Lik. & \num{-157.443} & \num{-157.443} \\ 27 | RMSE & \num{33.15} & \num{33.15} \\ 28 | \bottomrule 29 | \end{tblr} 30 | \end{table} 31 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-latex_tabular_escape_false.txt: -------------------------------------------------------------------------------- 1 | \begin{tabular}{ll} 2 | \hline 3 | a & {} \\ \hline 4 | \num{1.00} & 4 \\ 5 | \num{2.00} & \times 5 \\ 6 | \num{3.00} & 6 \\ 7 | \hline 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-latex_tabular_escape_true.txt: -------------------------------------------------------------------------------- 1 | \begin{tabular}{ll} 2 | \hline 3 | a & \{\} \\ \hline 4 | \num{1.00} & 4 \\ 5 | \num{2.00} & \textbackslash{}times 5 \\ 6 | \num{3.00} & 6 \\ 7 | \hline 8 | \end{tabular} 9 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-modelsummary_latex.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]Q[]}, 7 | column{2,3,4}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{6}={1,2,3,4}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) & (2) & (3) \\ \midrule %% TinyTableHeader 13 | disp\_x & \num{-0.041} & \num{-0.018} & \num{-0.018} \\ 14 | & (\num{0.005}) & (\num{0.009}) & (\num{0.009}) \\ 15 | wt & & \num{-3.351} & \num{-3.279} \\ 16 | & & (\num{1.164}) & (\num{1.328}) \\ 17 | Num.Obs. & \num{32} & \num{32} & \num{32} \\ 18 | R2 & \num{0.718} & \num{0.781} & \num{0.781} \\ 19 | R2 Adj. & \num{0.709} & \num{0.766} & \num{0.758} \\ 20 | AIC & \num{170.2} & \num{164.2} & \num{166.2} \\ 21 | BIC & \num{174.6} & \num{170.0} & \num{173.5} \\ 22 | Log.Lik. & \num{-82.105} & \num{-78.084} & \num{-78.076} \\ 23 | RMSE & \num{3.15} & \num{2.78} & \num{2.78} \\ 24 | \bottomrule 25 | \end{tblr} 26 | \end{table} 27 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-modelsummary_latex2.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]Q[]}, 7 | column{2,3,4}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{6}={1,2,3,4}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) & (2) & (3) \\ \midrule %% TinyTableHeader 13 | disp\_x & \num{-0.041} & \num{-0.018} & \num{-0.018} \\ 14 | & (\num{0.005}) & (\num{0.009}) & (\num{0.009}) \\ 15 | wt\_x & & \num{-3.351} & \num{-3.279} \\ 16 | & & (\num{1.164}) & (\num{1.328}) \\ 17 | Num.Obs. & \num{32} & \num{32} & \num{32} \\ 18 | R2 & \num{0.718} & \num{0.781} & \num{0.781} \\ 19 | R2 Adj. & \num{0.709} & \num{0.766} & \num{0.758} \\ 20 | AIC & \num{170.2} & \num{164.2} & \num{166.2} \\ 21 | BIC & \num{174.6} & \num{170.0} & \num{173.5} \\ 22 | Log.Lik. & \num{-82.105} & \num{-78.084} & \num{-78.076} \\ 23 | RMSE & \num{3.15} & \num{2.78} & \num{2.78} \\ 24 | \bottomrule 25 | \end{tblr} 26 | \end{table} 27 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-modelsummary_latex_tabular_FALSE.txt: -------------------------------------------------------------------------------- 1 | \begin{tabular}{ll} 2 | \hline 3 | & OLS 1 \\ \hline 4 | Literacy (\%) & \num{22.472} \\ 5 | & (\num{43.212}) \\ 6 | Patents per capita & \num{78.055} \\ 7 | & (\num{29.979}) \\ 8 | Constant & \num{2852.466} \\ 9 | & (\num{2724.293}) \\ 10 | Num.Obs. & \num{86} \\ 11 | R2 & \num{0.091} \\ 12 | R2 Adj. & \num{0.069} \\ 13 | AIC & \num{1734.4} \\ 14 | BIC & \num{1744.2} \\ 15 | Log.Lik. & \num{-863.198} \\ 16 | RMSE & \num{5531.68} \\ 17 | \hline 18 | \end{tabular} 19 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-panel_escape_FALSE.txt: -------------------------------------------------------------------------------- 1 | \begin{tabular}{lll} 2 | \hline 3 | & A_B & B_C \\ \hline 4 | Panel B: $\log(3)^2$ && \\ 5 | (Intercept) & -5.114 & 48.324 \\ 6 | & (10.030) & (11.103) \\ 7 | a_b & 1.412 & -0.887 \\ 8 | & (0.559) & (0.535) \\ 9 | b_c & & -0.085 \\ 10 | & & (0.014) \\ 11 | Num.Obs. & 32 & 32 \\ 12 | R2 & 0.175 & 0.637 \\ 13 | R2 Adj. & 0.148 & 0.612 \\ 14 | AIC & 204.6 & 180.3 \\ 15 | BIC & 209.0 & 186.2 \\ 16 | Log.Lik. & -99.294 & -86.170 \\ 17 | RMSE & 5.39 & 3.57 \\ 18 | Panel B: $\log(3)_2$ && \\ 19 | (Intercept) & 767.619 & -340.780 \\ 20 | & (204.642) & (221.689) \\ 21 | a_b & -30.080 & 17.599 \\ 22 | & (11.410) & (10.674) \\ 23 | b_c & & 1.755 \\ 24 | & & (0.278) \\ 25 | Num.Obs. & 32 & 32 \\ 26 | R2 & 0.188 & 0.658 \\ 27 | R2 Adj. & 0.161 & 0.634 \\ 28 | AIC & 397.6 & 372.0 \\ 29 | BIC & 402.0 & 377.8 \\ 30 | Log.Lik. & -195.797 & -181.979 \\ 31 | RMSE & 109.92 & 71.37 \\ 32 | \hline 33 | \end{tabular} 34 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/escape-panel_escape_TRUE.txt: -------------------------------------------------------------------------------- 1 | \begin{tabular}{lll} 2 | \hline 3 | & A\_B & B\_C \\ \hline 4 | Panel B: $\log(3)^2$ && \\ 5 | (Intercept) & -5.114 & 48.324 \\ 6 | & (10.030) & (11.103) \\ 7 | a\_b & 1.412 & -0.887 \\ 8 | & (0.559) & (0.535) \\ 9 | b\_c & & -0.085 \\ 10 | & & (0.014) \\ 11 | Num.Obs. & 32 & 32 \\ 12 | R2 & 0.175 & 0.637 \\ 13 | R2 Adj. & 0.148 & 0.612 \\ 14 | AIC & 204.6 & 180.3 \\ 15 | BIC & 209.0 & 186.2 \\ 16 | Log.Lik. & -99.294 & -86.170 \\ 17 | RMSE & 5.39 & 3.57 \\ 18 | Panel B: $\log(3)_2$ && \\ 19 | (Intercept) & 767.619 & -340.780 \\ 20 | & (204.642) & (221.689) \\ 21 | a\_b & -30.080 & 17.599 \\ 22 | & (11.410) & (10.674) \\ 23 | b\_c & & 1.755 \\ 24 | & & (0.278) \\ 25 | Num.Obs. & 32 & 32 \\ 26 | R2 & 0.188 & 0.658 \\ 27 | R2 Adj. & 0.161 & 0.634 \\ 28 | AIC & 397.6 & 372.0 \\ 29 | BIC & 402.0 & 377.8 \\ 30 | Log.Lik. & -195.797 & -181.979 \\ 31 | RMSE & 109.92 & 71.37 \\ 32 | \hline 33 | \end{tabular} 34 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/fmt-fmt_sci_2.txt: -------------------------------------------------------------------------------- 1 | 2 | +-------------------+-----------+ 3 | | | (1) | 4 | +===================+===========+ 5 | | (Intercept) | 1.3e+21 | 6 | +-------------------+-----------+ 7 | | | (6.9e+20) | 8 | +-------------------+-----------+ 9 | | Year | -6.6e+17 | 10 | +-------------------+-----------+ 11 | | | (3.4e+17) | 12 | +-------------------+-----------+ 13 | | SD (Intercept ID) | 1.0e+18 | 14 | +-------------------+-----------+ 15 | | SD (Observations) | 2.3e+18 | 16 | +-------------------+-----------+ 17 | | Num.Obs. | 30 | 18 | +-------------------+-----------+ 19 | | R2 Marg. | 0.096 | 20 | +-------------------+-----------+ 21 | | R2 Cond. | 0.252 | 22 | +-------------------+-----------+ 23 | | AIC | 2466.3 | 24 | +-------------------+-----------+ 25 | | BIC | 2471.9 | 26 | +-------------------+-----------+ 27 | | ICC | 0.2 | 28 | +-------------------+-----------+ 29 | | RMSE | 2.1e+18 | 30 | +-------------------+-----------+ 31 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/interaction-markdown_no_gof.txt: -------------------------------------------------------------------------------- 1 | 2 | +-------------+----------+ 3 | | | (1) | 4 | +=============+==========+ 5 | | (Intercept) | 3.219 | 6 | +-------------+----------+ 7 | | | (7.919) | 8 | +-------------+----------+ 9 | | Solar.R | 0.115 | 10 | +-------------+----------+ 11 | | | (0.030) | 12 | +-------------+----------+ 13 | | Month = 6 | 5.069 | 14 | +-------------+----------+ 15 | | | (10.980) | 16 | +-------------+----------+ 17 | | Month = 7 | 31.042 | 18 | +-------------+----------+ 19 | | | (8.018) | 20 | +-------------+----------+ 21 | | Month = 8 | 36.903 | 22 | +-------------+----------+ 23 | | | (8.201) | 24 | +-------------+----------+ 25 | | Month = 9 | 8.912 | 26 | +-------------+----------+ 27 | | | (7.763) | 28 | +-------------+----------+ 29 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/latex-tabular.txt: -------------------------------------------------------------------------------- 1 | \begin{tabular}{lll} 2 | \hline 3 | & (1) & (2) \\ \hline 4 | (Intercept) & \num{324.082} & \num{278.515} \\ 5 | & (\num{27.433}) & (\num{55.415}) \\ 6 | mpg & \num{-8.830} & \num{-9.985} \\ 7 | & (\num{1.310}) & (\num{1.792}) \\ 8 | drat & & \num{19.126} \\ 9 | & & (\num{20.198}) \\ 10 | Num.Obs. & \num{32} & \num{32} \\ 11 | R2 & \num{0.602} & \num{0.614} \\ 12 | R2 Adj. & \num{0.589} & \num{0.588} \\ 13 | AIC & \num{336.9} & \num{337.9} \\ 14 | BIC & \num{341.3} & \num{343.7} \\ 15 | Log.Lik. & \num{-165.428} & \num{-164.940} \\ 16 | F & \num{45.460} & \num{23.100} \\ 17 | RMSE & \num{42.55} & \num{41.91} \\ 18 | \hline 19 | \end{tabular} 20 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/mathmode-latex_anything.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{2,3}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{8}={1,2,3}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) & (2) \\ \midrule %% TinyTableHeader 13 | (Intercept) & 30.099 & 10.790 \\ 14 | & (1.634) & (5.078) \\ 15 | hp & -0.068 & -0.052 \\ 16 | & (0.010) & (0.009) \\ 17 | drat & & 4.698 \\ 18 | & & (1.192) \\ 19 | Num.Obs. & 32 & 32 \\ 20 | R2 & 0.602 & 0.741 \\ 21 | R2 Adj. & 0.589 & 0.723 \\ 22 | AIC & 181.2 & 169.5 \\ 23 | BIC & 185.6 & 175.4 \\ 24 | Log.Lik. & -87.619 & -80.752 \\ 25 | F & 45.460 & 41.522 \\ 26 | RMSE & 3.74 & 3.02 \\ 27 | \bottomrule 28 | \end{tblr} 29 | \end{table} 30 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/mathmode-latex_dollars.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{2,3}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{8}={1,2,3}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) & (2) \\ \midrule %% TinyTableHeader 13 | (Intercept) & $30.099$ & $10.790$ \\ 14 | & ($1.634$) & ($5.078$) \\ 15 | hp & $-0.068$ & $-0.052$ \\ 16 | & ($0.010$) & ($0.009$) \\ 17 | drat & & $4.698$ \\ 18 | & & ($1.192$) \\ 19 | Num.Obs. & $32$ & $32$ \\ 20 | R2 & $0.602$ & $0.741$ \\ 21 | R2 Adj. & $0.589$ & $0.723$ \\ 22 | AIC & $181.2$ & $169.5$ \\ 23 | BIC & $185.6$ & $175.4$ \\ 24 | Log.Lik. & $-87.619$ & $-80.752$ \\ 25 | F & $45.460$ & $41.522$ \\ 26 | RMSE & $3.74$ & $3.02$ \\ 27 | \bottomrule 28 | \end{tblr} 29 | \end{table} 30 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/mathmode-latex_ldd.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{2}={si={table-format=-3.3,table-align-text-before=false,table-align-text-after=false,input-symbols={-,\*+()}},}, 8 | cell{1}{2}={guard,halign=c,}, 9 | column{3}={si={table-format=-3.3,table-align-text-before=false,table-align-text-after=false,input-symbols={-,\*+()}},}, 10 | cell{1}{3}={guard,halign=c,}, 11 | column{1}={}{halign=l,}, 12 | hline{8}={1,2,3}{solid, black, 0.05em}, 13 | } %% tabularray inner close 14 | \toprule 15 | & (1) & (2) \\ \midrule %% TinyTableHeader 16 | (Intercept) & 30.099 & 10.790 \\ 17 | & (1.634) & (5.078) \\ 18 | hp & -0.068 & -0.052 \\ 19 | & (0.010) & (0.009) \\ 20 | drat & & 4.698 \\ 21 | & & (1.192) \\ 22 | Num.Obs. & 32 & 32 \\ 23 | R2 & 0.602 & 0.741 \\ 24 | R2 Adj. & 0.589 & 0.723 \\ 25 | AIC & 181.2 & 169.5 \\ 26 | BIC & 185.6 & 175.4 \\ 27 | Log.Lik. & -87.619 & -80.752 \\ 28 | F & 45.460 & 41.522 \\ 29 | RMSE & 3.74 & 3.02 \\ 30 | \bottomrule 31 | \end{tblr} 32 | \end{table} 33 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/mathmode-latex_null.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{2,3}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{8}={1,2,3}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) & (2) \\ \midrule %% TinyTableHeader 13 | (Intercept) & \num{30.099} & \num{10.790} \\ 14 | & (\num{1.634}) & (\num{5.078}) \\ 15 | hp & \num{-0.068} & \num{-0.052} \\ 16 | & (\num{0.010}) & (\num{0.009}) \\ 17 | drat & & \num{4.698} \\ 18 | & & (\num{1.192}) \\ 19 | Num.Obs. & \num{32} & \num{32} \\ 20 | R2 & \num{0.602} & \num{0.741} \\ 21 | R2 Adj. & \num{0.589} & \num{0.723} \\ 22 | AIC & \num{181.2} & \num{169.5} \\ 23 | BIC & \num{185.6} & \num{175.4} \\ 24 | Log.Lik. & \num{-87.619} & \num{-80.752} \\ 25 | F & \num{45.460} & \num{41.522} \\ 26 | RMSE & \num{3.74} & \num{3.02} \\ 27 | \bottomrule 28 | \end{tblr} 29 | \end{table} 30 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/output-title_not_indented.txt: -------------------------------------------------------------------------------- 1 | 2 | +-------------+----------+ 3 | | | (1) | 4 | +=============+==========+ 5 | | (Intercept) | 8.284 | 6 | +-------------+----------+ 7 | | | (0.874) | 8 | +-------------+----------+ 9 | | dist | 0.166 | 10 | +-------------+----------+ 11 | | | (0.017) | 12 | +-------------+----------+ 13 | | Num.Obs. | 50 | 14 | +-------------+----------+ 15 | | R2 | 0.651 | 16 | +-------------+----------+ 17 | | R2 Adj. | 0.644 | 18 | +-------------+----------+ 19 | | AIC | 260.8 | 20 | +-------------+----------+ 21 | | BIC | 266.5 | 22 | +-------------+----------+ 23 | | Log.Lik. | -127.388 | 24 | +-------------+----------+ 25 | | F | 89.567 | 26 | +-------------+----------+ 27 | | RMSE | 3.09 | 28 | +-------------+----------+ 29 | 30 | Table: test 31 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/pkg-fixest_model_names_single.txt: -------------------------------------------------------------------------------- 1 | 2 | +-------------+---------+---------+ 3 | | | A | K | 4 | +=============+=========+=========+ 5 | | (Intercept) | 4.778 | 4.778 | 6 | +-------------+---------+---------+ 7 | | | (0.073) | (0.073) | 8 | +-------------+---------+---------+ 9 | | x1 | 0.889 | 0.889 | 10 | +-------------+---------+---------+ 11 | | | (0.051) | (0.051) | 12 | +-------------+---------+---------+ 13 | | Num.Obs. | 150 | 150 | 14 | +-------------+---------+---------+ 15 | | R2 | 0.669 | 0.669 | 16 | +-------------+---------+---------+ 17 | | R2 Adj. | 0.667 | 0.667 | 18 | +-------------+---------+---------+ 19 | | AIC | 206.2 | 206.2 | 20 | +-------------+---------+---------+ 21 | | BIC | 212.2 | 212.2 | 22 | +-------------+---------+---------+ 23 | | RMSE | 0.47 | 0.47 | 24 | +-------------+---------+---------+ 25 | | Std.Errors | IID | IID | 26 | +-------------+---------+---------+ 27 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/rbind-add_rows_rbind.txt: -------------------------------------------------------------------------------- 1 | +-------------+---------+---------+ 2 | | | (1) | (2) | 3 | +=============+=========+=========+ 4 | | Panel A | 5 | +-------------+---------+---------+ 6 | | (Intercept) | 20.09 | -5.11 | 7 | +-------------+---------+---------+ 8 | | | (1.07) | (10.03) | 9 | +-------------+---------+---------+ 10 | | qsec | | 1.41 | 11 | +-------------+---------+---------+ 12 | | | | (0.56) | 13 | +-------------+---------+---------+ 14 | | R2 | 0.000 | 0.175 | 15 | +-------------+---------+---------+ 16 | | Info | ??? | XYZ | 17 | +-------------+---------+---------+ 18 | | Num.Obs. | 32 | 32 | 19 | +-------------+---------+---------+ 20 | | RMSE | 5.93 | 5.39 | 21 | +-------------+---------+---------+ 22 | | Panel B | 23 | +-------------+---------+---------+ 24 | | (Intercept) | 146.69 | 631.70 | 25 | +-------------+---------+---------+ 26 | | | (12.12) | (88.70) | 27 | +-------------+---------+---------+ 28 | | qsec | | -27.17 | 29 | +-------------+---------+---------+ 30 | | | | (4.95) | 31 | +-------------+---------+---------+ 32 | | R2 | 0.000 | 0.502 | 33 | +-------------+---------+---------+ 34 | | Num.Obs. | 32 | 32 | 35 | +-------------+---------+---------+ 36 | | RMSE | 67.48 | 47.64 | 37 | +-------------+---------+---------+ 38 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/rbind-issue725_tinytable_hgroup.txt: -------------------------------------------------------------------------------- 1 | +-------------+----------+----------+ 2 | | | (1) | (2) | 3 | +=============+==========+==========+ 4 | | Panel A | 5 | +-------------+----------+----------+ 6 | | (Intercept) | 20.091 | -5.114 | 7 | +-------------+----------+----------+ 8 | | | (1.065) | (10.030) | 9 | +-------------+----------+----------+ 10 | | qsec | | 1.412 | 11 | +-------------+----------+----------+ 12 | | | | (0.559) | 13 | +-------------+----------+----------+ 14 | | R2 | 0.000 | 0.175 | 15 | +-------------+----------+----------+ 16 | | Num.Obs. | 32 | 32 | 17 | +-------------+----------+----------+ 18 | | RMSE | 5.93 | 5.39 | 19 | +-------------+----------+----------+ 20 | | Panel B | 21 | +-------------+----------+----------+ 22 | | (Intercept) | 146.688 | 631.704 | 23 | +-------------+----------+----------+ 24 | | | (12.120) | (88.700) | 25 | +-------------+----------+----------+ 26 | | qsec | | -27.174 | 27 | +-------------+----------+----------+ 28 | | | | (4.946) | 29 | +-------------+----------+----------+ 30 | | R2 | 0.000 | 0.502 | 31 | +-------------+----------+----------+ 32 | | Num.Obs. | 32 | 32 | 33 | +-------------+----------+----------+ 34 | | RMSE | 67.48 | 47.64 | 35 | +-------------+----------+----------+ 36 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/rbind-issue849_with_panel_names.txt: -------------------------------------------------------------------------------- 1 | +----------------------------------------+------------+ 2 | | | (1) | 3 | +========================================+============+ 4 | | a | 5 | +----------------------------------------+------------+ 6 | | `factor(cyl)6`+`factor(cyl)6 × disp`=0 | -21.651*** | 7 | +----------------------------------------+------------+ 8 | | | (5.272) | 9 | +----------------------------------------+------------+ 10 | | b | 11 | +----------------------------------------+------------+ 12 | | `factor(cyl)8`+`factor(cyl)8 × disp`=0 | -18.724*** | 13 | +----------------------------------------+------------+ 14 | | | (4.587) | 15 | +========================================+============+ 16 | | + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001 | 17 | +========================================+============+ 18 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/rbind-issue849_without_panel_names.txt: -------------------------------------------------------------------------------- 1 | 2 | +----------------------------------------+------------+ 3 | | | (1) | 4 | +========================================+============+ 5 | | `factor(cyl)6`+`factor(cyl)6 × disp`=0 | -21.651*** | 6 | +----------------------------------------+------------+ 7 | | | (5.272) | 8 | +----------------------------------------+------------+ 9 | | `factor(cyl)8`+`factor(cyl)8 × disp`=0 | -18.724*** | 10 | +----------------------------------------+------------+ 11 | | | (4.587) | 12 | +========================================+============+ 13 | | + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001 | 14 | +========================================+============+ 15 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/rounding-datasummary_latex.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{1}={}{halign=l,}, 8 | column{2,3}={}{halign=r,}, 9 | } %% tabularray inner close 10 | \toprule 11 | cyl & SD & N \\ \midrule %% TinyTableHeader 12 | 4 & & 11 \\ 13 | 6 & & 7 \\ 14 | 8 & & 14 \\ 15 | mpg & \num{6.03} & 32 \\ 16 | \bottomrule 17 | \end{tblr} 18 | \end{table} 19 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot/stars-issue798.txt: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{talltblr}[ %% tabularray outer open 4 | entry=none,label=none, 5 | note{}={+ p \num{< 0.1}, * p \num{< 0.05}, ** p \num{< 0.01}, *** p \num{< 0.001}}, 6 | ] %% tabularray outer close 7 | { %% tabularray inner open 8 | colspec={Q[]Q[]Q[]}, 9 | column{2,3}={}{halign=c,}, 10 | column{1}={}{halign=l,}, 11 | hline{8}={1,2,3}{solid, black, 0.05em}, 12 | } %% tabularray inner close 13 | \toprule 14 | & OLS & Logit \\ \midrule %% TinyTableHeader 15 | (Intercept) & \num{-1.986}*** & \num{4.739} \\ 16 | & (\num{0.434}) & (\num{4.045}) \\ 17 | drat & \num{0.665}*** & \\ 18 | & (\num{0.120}) & \\ 19 | qsec & & \num{-0.288} \\ 20 | & & (\num{0.228}) \\ 21 | Num.Obs. & \num{32} & \num{32} \\ 22 | R2 & \num{0.508} & \\ 23 | R2 Adj. & \num{0.492} & \\ 24 | AIC & \num{28.6} & \num{45.5} \\ 25 | BIC & \num{33.0} & \num{48.4} \\ 26 | Log.Lik. & \num{-11.306} & \num{-20.733} \\ 27 | F & \num{30.970} & \num{1.599} \\ 28 | RMSE & \num{0.34} & \num{0.48} \\ 29 | \bottomrule 30 | \end{talltblr} 31 | \end{table} 32 | -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot_review/modelplot-coef_map_color_shape_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/_tinysnapshot_review/modelplot-coef_map_color_shape_background.png -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot_review/modelplot-coef_omit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/_tinysnapshot_review/modelplot-coef_omit.png -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot_review/modelplot-multiple_plots_vanilla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/_tinysnapshot_review/modelplot-multiple_plots_vanilla.png -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot_review/modelplot-vanilla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/_tinysnapshot_review/modelplot-vanilla.png -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot_review/modeplot-model_order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/_tinysnapshot_review/modeplot-model_order.png -------------------------------------------------------------------------------- /inst/tinytest/_tinysnapshot_review/modeplot-multiple_plots_facet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/_tinysnapshot_review/modeplot-multiple_plots_facet.png -------------------------------------------------------------------------------- /inst/tinytest/known_output/add_columns_1.R: -------------------------------------------------------------------------------- 1 | structure(list(first = c("blah", "junk"), ` ` = c("mpg", "hp" 2 | ), mean = c("20.09", "146.69"), sd = c("6.03", "68.56"), last = c("2.00", 3 | "4.00")), class = "data.frame", row.names = c(NA, -2L), align = c("l", 4 | "r", "r", "r", "r")) 5 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/datasummary_correlation_1.R: -------------------------------------------------------------------------------- 1 | structure(list(` ` = c("(1) mpg", "(2) hp", "(3) vs"), `(1)` = c("1.00", 2 | "-.78", ".66"), `(2)` = c("-.78", "1.00", "-.72"), `(3)` = c(".66", 3 | "-.72", "1.00")), row.names = c(NA, -3L), class = "data.frame", align = c("l", 4 | "r", "r", "r")) 5 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/datasummary_correlation_2.R: -------------------------------------------------------------------------------- 1 | structure(list(` ` = c("mpg", "hp"), mpg = c("1", "-.78"), hp = c(".", 2 | "1")), row.names = c(NA, -2L), class = "data.frame", align = c("l", 3 | "r", "r")) 4 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/datasummary_correlation_3.R: -------------------------------------------------------------------------------- 1 | structure(list(` ` = c("mpg", "hp"), mpg = c("1", "-.74"), hp = c(".", 2 | "1")), row.names = c(NA, -2L), class = "data.frame", align = c("l", 3 | "r", "r")) 4 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/datasummary_correlation_4.R: -------------------------------------------------------------------------------- 1 | structure(list(` ` = c("mpg", "hp"), mpg = c("1", "-.89"), hp = c(".", 2 | "1")), row.names = c(NA, -2L), class = "data.frame", align = c("l", 3 | "r", "r")) 4 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/datasummary_correlation_5.R: -------------------------------------------------------------------------------- 1 | structure(list(` ` = c("mpg", "hp"), mpg = c("1", "-.89"), hp = c("-.78", 2 | "1")), row.names = c(NA, -2L), class = "data.frame", align = c("l", 3 | "r", "r")) 4 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/datasummary_skim_1.R: -------------------------------------------------------------------------------- 1 | structure(list(` ` = c("vs", "", "gear", "", ""), ` ` = c("FALSE", 2 | "TRUE", "3", "4", "5"), N = c("18", "14", "15", "12", "5"), `%` = c("56.2", 3 | "43.8", "46.9", "37.5", "15.6")), row.names = c(NA, -5L), class = "data.frame", stub_width = 2L, align = c("l", 4 | "l", "r", "r"), output_format = "dataframe") 5 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/escape_1.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lcc} 4 | \toprule 5 | & First\&Second & Third\_Fourth\\ 6 | \midrule 7 | (Intercept) & \num{-103.772} & \num{-103.772}\\ 8 | & (\num{103.551}) & (\num{103.551})\\ 9 | under\_score & \num{-3.899} & \num{-3.899}\\ 10 | & (\num{2.072}) & (\num{2.072})\\ 11 | `oh\&yeah2` & \num{29.329} & \num{29.329}\\ 12 | & (\num{7.169}) & (\num{7.169})\\ 13 | drat & \num{40.961} & \num{40.961}\\ 14 | & (\num{17.115}) & (\num{17.115})\\ 15 | \midrule 16 | Num.Obs. & \num{32} & \num{32}\\ 17 | R2 & \num{0.759} & \num{0.759}\\ 18 | R2 Adj. & \num{0.733} & \num{0.733}\\ 19 | AIC & \num{324.9} & \num{324.9}\\ 20 | BIC & \num{332.2} & \num{332.2}\\ 21 | Log.Lik. & \num{-157.443} & \num{-157.443}\\ 22 | F & \num{29.335} & \num{29.335}\\ 23 | \bottomrule 24 | \end{tabular} 25 | \end{table} 26 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/escape_10.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lrrrrrrrrrrr} 4 | \toprule 5 | & under_score & oh&yeah2 & disp & hp & drat & wt & qsec & vs & am & gear & carb\\ 6 | \midrule 7 | under_score & 1 & . & . & . & . & . & . & . & . & . & .\\ 8 | oh&yeah2 & \num{-.85} & 1 & . & . & . & . & . & . & . & . & .\\ 9 | disp & \num{-.85} & \num{.90} & 1 & . & . & . & . & . & . & . & .\\ 10 | hp & \num{-.78} & \num{.83} & \num{.79} & 1 & . & . & . & . & . & . & .\\ 11 | drat & \num{.68} & \num{-.70} & \num{-.71} & \num{-.45} & 1 & . & . & . & . & . & .\\ 12 | wt & \num{-.87} & \num{.78} & \num{.89} & \num{.66} & \num{-.71} & 1 & . & . & . & . & .\\ 13 | qsec & \num{.42} & \num{-.59} & \num{-.43} & \num{-.71} & \num{.09} & \num{-.17} & 1 & . & . & . & .\\ 14 | vs & \num{.66} & \num{-.81} & \num{-.71} & \num{-.72} & \num{.44} & \num{-.55} & \num{.74} & 1 & . & . & .\\ 15 | am & \num{.60} & \num{-.52} & \num{-.59} & \num{-.24} & \num{.71} & \num{-.69} & \num{-.23} & \num{.17} & 1 & . & .\\ 16 | gear & \num{.48} & \num{-.49} & \num{-.56} & \num{-.13} & \num{.70} & \num{-.58} & \num{-.21} & \num{.21} & \num{.79} & 1 & .\\ 17 | carb & \num{-.55} & \num{.53} & \num{.39} & \num{.75} & \num{-.09} & \num{.43} & \num{-.66} & \num{-.57} & \num{.06} & \num{.27} & 1\\ 18 | \bottomrule 19 | \end{tabular} 20 | \end{table} 21 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/escape_2.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lcc} 4 | \toprule 5 | & First&Second & Third_Fourth\\ 6 | \midrule 7 | (Intercept) & \num{-103.772} & \num{-103.772}\\ 8 | & (\num{103.551}) & (\num{103.551})\\ 9 | under_score & \num{-3.899} & \num{-3.899}\\ 10 | & (\num{2.072}) & (\num{2.072})\\ 11 | `oh&yeah2` & \num{29.329} & \num{29.329}\\ 12 | & (\num{7.169}) & (\num{7.169})\\ 13 | drat & \num{40.961} & \num{40.961}\\ 14 | & (\num{17.115}) & (\num{17.115})\\ 15 | \midrule 16 | Num.Obs. & \num{32} & \num{32}\\ 17 | R2 & \num{0.759} & \num{0.759}\\ 18 | R2 Adj. & \num{0.733} & \num{0.733}\\ 19 | AIC & \num{324.9} & \num{324.9}\\ 20 | BIC & \num{332.2} & \num{332.2}\\ 21 | Log.Lik. & \num{-157.443} & \num{-157.443}\\ 22 | F & \num{29.335} & \num{29.335}\\ 23 | \bottomrule 24 | \end{tabular} 25 | \end{table} 26 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/escape_5.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lrr} 4 | \toprule 5 | & \% & Money \$\$\\ 6 | \midrule 7 | under\_score & \num{20.09} & \num{6.03}\\ 8 | hp & \num{146.69} & \num{68.56}\\ 9 | \bottomrule 10 | \end{tabular} 11 | \end{table} 12 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/escape_6.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lrr} 4 | \toprule 5 | & % & Money $$\\ 6 | \midrule 7 | under_score & \num{20.09} & \num{6.03}\\ 8 | hp & \num{146.69} & \num{68.56}\\ 9 | \bottomrule 10 | \end{tabular} 11 | \end{table} 12 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/escape_7.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lllrrr} 4 | \toprule 5 | under\_score1 & under\_score2 & & 0 & 1 & All\\ 6 | \midrule 7 | 0 & 3 & N & 12 & 0 & 12\\ 8 | & & \% row & \num{100.0} & \num{0.0} & \num{100.0}\\ 9 | & 4 & N & 0 & 2 & 2\\ 10 | & & \% row & \num{0.0} & \num{100.0} & \num{100.0}\\ 11 | & 5 & N & 0 & 4 & 4\\ 12 | & & \% row & \num{0.0} & \num{100.0} & \num{100.0}\\ 13 | 1 & 3 & N & 3 & 0 & 3\\ 14 | & & \% row & \num{100.0} & \num{0.0} & \num{100.0}\\ 15 | & 4 & N & 4 & 6 & 10\\ 16 | & & \% row & \num{40.0} & \num{60.0} & \num{100.0}\\ 17 | & 5 & N & 0 & 1 & 1\\ 18 | & & \% row & \num{0.0} & \num{100.0} & \num{100.0}\\ 19 | & All & N & 19 & 13 & 32\\ 20 | & & \% row & \num{59.4} & \num{40.6} & \num{100.0}\\ 21 | \bottomrule 22 | \end{tabular} 23 | \end{table} 24 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/escape_8.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lllrrr} 4 | \toprule 5 | under_score1 & under_score2 & & 0 & 1 & All\\ 6 | \midrule 7 | 0 & 3 & N & 12 & 0 & 12\\ 8 | & & % row & \num{100.0} & \num{0.0} & \num{100.0}\\ 9 | & 4 & N & 0 & 2 & 2\\ 10 | & & % row & \num{0.0} & \num{100.0} & \num{100.0}\\ 11 | & 5 & N & 0 & 4 & 4\\ 12 | & & % row & \num{0.0} & \num{100.0} & \num{100.0}\\ 13 | 1 & 3 & N & 3 & 0 & 3\\ 14 | & & % row & \num{100.0} & \num{0.0} & \num{100.0}\\ 15 | & 4 & N & 4 & 6 & 10\\ 16 | & & % row & \num{40.0} & \num{60.0} & \num{100.0}\\ 17 | & 5 & N & 0 & 1 & 1\\ 18 | & & % row & \num{0.0} & \num{100.0} & \num{100.0}\\ 19 | & All & N & 19 & 13 & 32\\ 20 | & & % row & \num{59.4} & \num{40.6} & \num{100.0}\\ 21 | \bottomrule 22 | \end{tabular} 23 | \end{table} 24 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/escape_9.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lrrrrrrrrrrr} 4 | \toprule 5 | & under\_score & oh\&yeah2 & disp & hp & drat & wt & qsec & vs & am & gear & carb\\ 6 | \midrule 7 | under\_score & 1 & . & . & . & . & . & . & . & . & . & .\\ 8 | oh\&yeah2 & \num{-.85} & 1 & . & . & . & . & . & . & . & . & .\\ 9 | disp & \num{-.85} & \num{.90} & 1 & . & . & . & . & . & . & . & .\\ 10 | hp & \num{-.78} & \num{.83} & \num{.79} & 1 & . & . & . & . & . & . & .\\ 11 | drat & \num{.68} & \num{-.70} & \num{-.71} & \num{-.45} & 1 & . & . & . & . & . & .\\ 12 | wt & \num{-.87} & \num{.78} & \num{.89} & \num{.66} & \num{-.71} & 1 & . & . & . & . & .\\ 13 | qsec & \num{.42} & \num{-.59} & \num{-.43} & \num{-.71} & \num{.09} & \num{-.17} & 1 & . & . & . & .\\ 14 | vs & \num{.66} & \num{-.81} & \num{-.71} & \num{-.72} & \num{.44} & \num{-.55} & \num{.74} & 1 & . & . & .\\ 15 | am & \num{.60} & \num{-.52} & \num{-.59} & \num{-.24} & \num{.71} & \num{-.69} & \num{-.23} & \num{.17} & 1 & . & .\\ 16 | gear & \num{.48} & \num{-.49} & \num{-.56} & \num{-.13} & \num{.70} & \num{-.58} & \num{-.21} & \num{.21} & \num{.79} & 1 & .\\ 17 | carb & \num{-.55} & \num{.53} & \num{.39} & \num{.75} & \num{-.09} & \num{.43} & \num{-.66} & \num{-.57} & \num{.06} & \num{.27} & 1\\ 18 | \bottomrule 19 | \end{tabular} 20 | \end{table} 21 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/gof_map_fstat.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | | | OLS | Logit | 4 | |:-----------|:-------:|:-------:| 5 | |(Intercept) | -1.986 | 4.739 | 6 | | | (0.434) | (4.045) | 7 | |drat | 0.665 | | 8 | | | (0.120) | | 9 | |qsec | | -0.288 | 10 | | | | (0.228) | 11 | |Num.Obs. | 32 | 32 | 12 | |R2 | 0.508 | | 13 | |R2 Adj. | 0.492 | | 14 | |AIC | 28.6 | 45.5 | 15 | |BIC | 33.0 | 48.4 | 16 | |Log.Lik. | -11.306 | -20.733 | 17 | |F | 30.970 | | 18 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/html_1.tex: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
(1)
(Intercept) 324.082
(27.433)
mpg −8.830
(1.310)
27 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/interaction_markdown.md: -------------------------------------------------------------------------------- 1 | | |(1) | 2 | |:---------------|:-------| 3 | |(Intercept) |-2.956 | 4 | | |(2.466) | 5 | |drat |0.884 | 6 | | |(0.712) | 7 | |drat × mpg |-0.006 | 8 | | |(0.038) | 9 | |drat × mpg × vs |-0.003 | 10 | | |(0.054) | 11 | |drat × vs |-0.404 | 12 | | |(1.149) | 13 | |mpg |0.039 | 14 | | |(0.139) | 15 | |mpg × vs |0.054 | 16 | | |(0.207) | 17 | |vs |0.189 | 18 | | |(4.317) | 19 | |Num.Obs. |32 | 20 | |R2 |0.662 | 21 | |R2 Adj. |0.563 | 22 | |AIC |28.6 | 23 | |BIC |41.8 | 24 | |Log.Lik. |-5.298 | 25 | |F |6.715 | 26 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/latex_1.tex: -------------------------------------------------------------------------------- 1 | 2 | \begin{tabular}[t]{lcc} 3 | \toprule 4 | & (1) & (2)\\ 5 | \midrule 6 | (Intercept) & \num{324.082} & \num{278.515}\\ 7 | & (\num{27.433}) & (\num{55.415})\\ 8 | mpg & \num{-8.830} & \num{-9.985}\\ 9 | & (\num{1.310}) & (\num{1.792})\\ 10 | drat & & \num{19.126}\\ 11 | & & (\num{20.198})\\ 12 | \midrule 13 | Num.Obs. & \num{32} & \num{32}\\ 14 | R2 & \num{0.602} & \num{0.614}\\ 15 | R2 Adj. & \num{0.589} & \num{0.588}\\ 16 | AIC & \num{336.9} & \num{337.9}\\ 17 | BIC & \num{341.3} & \num{343.7}\\ 18 | Log.Lik. & \num{-165.428} & \num{-164.940}\\ 19 | F & \num{45.460} & \num{23.100}\\ 20 | \bottomrule 21 | \end{tabular} 22 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/mathmode_1.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{ldd} 4 | \toprule 5 | & {(1)} & {(2)}\\ 6 | \midrule 7 | (Intercept) & 30.099 & 10.790\\ 8 | & (1.634) & (5.078)\\ 9 | hp & -0.068 & -0.052\\ 10 | & (0.010) & (0.009)\\ 11 | drat & {} & 4.698\\ 12 | & {} & (1.192)\\ 13 | \midrule 14 | Num.Obs. & 32 & 32\\ 15 | R2 & 0.602 & 0.741\\ 16 | R2 Adj. & 0.589 & 0.723\\ 17 | AIC & 181.2 & 169.5\\ 18 | BIC & 185.6 & 175.4\\ 19 | Log.Lik. & -87.619 & -80.752\\ 20 | F & 45.460 & 41.522\\ 21 | \bottomrule 22 | \end{tabular} 23 | \end{table} 24 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/mathmode_5.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lcc} 4 | \toprule 5 | & (1) & (2)\\ 6 | \midrule 7 | (Intercept) & \num{30.099} & \num{10.790}\\ 8 | & (\num{1.634}) & (\num{5.078})\\ 9 | hp & \num{-0.068} & \num{-0.052}\\ 10 | & (\num{0.010}) & (\num{0.009})\\ 11 | drat & & \num{4.698}\\ 12 | & & (\num{1.192})\\ 13 | \midrule 14 | Num.Obs. & \num{32} & \num{32}\\ 15 | R2 & \num{0.602} & \num{0.741}\\ 16 | R2 Adj. & \num{0.589} & \num{0.723}\\ 17 | AIC & \num{181.2} & \num{169.5}\\ 18 | BIC & \num{185.6} & \num{175.4}\\ 19 | Log.Lik. & \num{-87.619} & \num{-80.752}\\ 20 | F & \num{45.460} & \num{41.522}\\ 21 | \bottomrule 22 | \end{tabular} 23 | \end{table} 24 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/mathmode_6.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lcc} 4 | \toprule 5 | & (1) & (2)\\ 6 | \midrule 7 | (Intercept) & $30.099$ & $10.790$\\ 8 | & ($1.634$) & ($5.078$)\\ 9 | hp & $-0.068$ & $-0.052$\\ 10 | & ($0.010$) & ($0.009$)\\ 11 | drat & & $4.698$\\ 12 | & & ($1.192$)\\ 13 | \midrule 14 | Num.Obs. & $32$ & $32$\\ 15 | R2 & $0.602$ & $0.741$\\ 16 | R2 Adj. & $0.589$ & $0.723$\\ 17 | AIC & $181.2$ & $169.5$\\ 18 | BIC & $185.6$ & $175.4$\\ 19 | Log.Lik. & $-87.619$ & $-80.752$\\ 20 | F & $45.460$ & $41.522$\\ 21 | \bottomrule 22 | \end{tabular} 23 | \end{table} 24 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/mathmode_7.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lcc} 4 | \toprule 5 | & (1) & (2)\\ 6 | \midrule 7 | (Intercept) & 30.099 & 10.790\\ 8 | & (1.634) & (5.078)\\ 9 | hp & -0.068 & -0.052\\ 10 | & (0.010) & (0.009)\\ 11 | drat & & 4.698\\ 12 | & & (1.192)\\ 13 | \midrule 14 | Num.Obs. & 32 & 32\\ 15 | R2 & 0.602 & 0.741\\ 16 | R2 Adj. & 0.589 & 0.723\\ 17 | AIC & 181.2 & 169.5\\ 18 | BIC & 185.6 & 175.4\\ 19 | Log.Lik. & -87.619 & -80.752\\ 20 | F & 45.460 & 41.522\\ 21 | \bottomrule 22 | \end{tabular} 23 | \end{table} 24 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/msummary_add_rows_1.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | | | OLS | Logit | 4 | |:-----------|:-------:|:-------:| 5 | |(Intercept) | 0.727 | 0.981 | 6 | | | (0.133) | (0.677) | 7 | |cyl4 | - | - | 8 | |cyl6 | -0.299 | -1.269 | 9 | | | (0.213) | (1.021) | 10 | |cyl8 | -0.584 | -2.773 | 11 | | | (0.177) | (1.021) | 12 | |NEW GOF 1 | ? | ? | 13 | |NEW GOF 2 | X | X | 14 | |Num.Obs. | 32 | 32 | 15 | |R2 | 0.273 | | 16 | |NEW GOF 3 | Y | Y | 17 | |R2 Adj. | 0.223 | | 18 | |AIC | 43.1 | 39.9 | 19 | |BIC | 49.0 | 44.3 | 20 | |Log.Lik. | -17.548 | -16.967 | 21 | |F | 5.449 | | 22 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/msummary_fixest_i.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | | | (1) | 4 | |:-----------|:--------:| 5 | |(Intercept) | 3.219 | 6 | | | (7.919) | 7 | |Solar.R | 0.115 | 8 | | | (0.030) | 9 | |Month = 6 | 5.069 | 10 | | | (10.980) | 11 | |Month = 7 | 31.042 | 12 | | | (8.018) | 13 | |Month = 8 | 36.903 | 14 | | | (8.201) | 15 | |Month = 9 | 8.912 | 16 | | | (7.763) | 17 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/msummary_interaction.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | | | (1) | 4 | |:---------------|:-------:| 5 | |(Intercept) | -2.956 | 6 | | | (2.466) | 7 | |drat | 0.884 | 8 | | | (0.712) | 9 | |mpg | 0.039 | 10 | | | (0.139) | 11 | |vs | 0.189 | 12 | | | (4.317) | 13 | |drat × mpg | -0.006 | 14 | | | (0.038) | 15 | |drat × vs | -0.404 | 16 | | | (1.149) | 17 | |mpg × vs | 0.054 | 18 | | | (0.207) | 19 | |drat × mpg × vs | -0.003 | 20 | | | (0.054) | 21 | |Num.Obs. | 32 | 22 | |R2 | 0.662 | 23 | |R2 Adj. | 0.563 | 24 | |AIC | 28.6 | 25 | |BIC | 41.8 | 26 | |Log.Lik. | -5.298 | 27 | |F | 6.715 | 28 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/na_1.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lc} 4 | \toprule 5 | & (1)\\ 6 | \midrule 7 | (Intercept) & \num{30.666}\\ 8 | & (\num{2.494})\\ 9 | hp & \num{-0.066}\\ 10 | & (\num{0.011})\\ 11 | SD (Intercept) & \num{3.100}\\ 12 | SD (Observations) & \num{1.776}\\ 13 | Num.Obs. & \num{32}\\ 14 | R2 Marg. & \num{0.511}\\ 15 | \midrule 16 | R2 Cond. & \num{0.751}\\ 17 | AIC & \num{181.5}\\ 18 | BIC & \num{187.3}\\ 19 | ICC & \num{0.5}\\ 20 | RMSE & \num{2.96}\\ 21 | \bottomrule 22 | \end{tabular} 23 | \end{table} 24 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/output-file.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/known_output/output-file.docx -------------------------------------------------------------------------------- /inst/tinytest/known_output/output-file.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/known_output/output-file.jpg -------------------------------------------------------------------------------- /inst/tinytest/known_output/output-file.md: -------------------------------------------------------------------------------- 1 | 2 | +-------------+----------+----------+ 3 | | | (1) | (2) | 4 | +=============+==========+==========+ 5 | | (Intercept) | 324.082 | 278.515 | 6 | +-------------+----------+----------+ 7 | | | (27.433) | (55.415) | 8 | +-------------+----------+----------+ 9 | | mpg | -8.830 | -9.985 | 10 | +-------------+----------+----------+ 11 | | | (1.310) | (1.792) | 12 | +-------------+----------+----------+ 13 | | drat | | 19.126 | 14 | +-------------+----------+----------+ 15 | | | | (20.198) | 16 | +-------------+----------+----------+ 17 | | Num.Obs. | 32 | 32 | 18 | +-------------+----------+----------+ 19 | | R2 | 0.602 | 0.614 | 20 | +-------------+----------+----------+ 21 | | R2 Adj. | 0.589 | 0.588 | 22 | +-------------+----------+----------+ 23 | | AIC | 336.9 | 337.9 | 24 | +-------------+----------+----------+ 25 | | BIC | 341.3 | 343.7 | 26 | +-------------+----------+----------+ 27 | | Log.Lik. | -165.428 | -164.940 | 28 | +-------------+----------+----------+ 29 | | F | 45.460 | 23.100 | 30 | +-------------+----------+----------+ 31 | | RMSE | 42.55 | 41.91 | 32 | +-------------+----------+----------+ 33 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/output-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/known_output/output-file.png -------------------------------------------------------------------------------- /inst/tinytest/known_output/output-file.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/known_output/output-file.pptx -------------------------------------------------------------------------------- /inst/tinytest/known_output/output-file.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tblr}[ %% tabularray outer open 4 | ] %% tabularray outer close 5 | { %% tabularray inner open 6 | colspec={Q[]Q[]Q[]}, 7 | column{2,3}={}{halign=c,}, 8 | column{1}={}{halign=l,}, 9 | hline{8}={1,2,3}{solid, black, 0.05em}, 10 | } %% tabularray inner close 11 | \toprule 12 | & (1) & (2) \\ \midrule %% TinyTableHeader 13 | (Intercept) & \num{324.082} & \num{278.515} \\ 14 | & (\num{27.433}) & (\num{55.415}) \\ 15 | mpg & \num{-8.830} & \num{-9.985} \\ 16 | & (\num{1.310}) & (\num{1.792}) \\ 17 | drat & & \num{19.126} \\ 18 | & & (\num{20.198}) \\ 19 | Num.Obs. & \num{32} & \num{32} \\ 20 | R2 & \num{0.602} & \num{0.614} \\ 21 | R2 Adj. & \num{0.589} & \num{0.588} \\ 22 | AIC & \num{336.9} & \num{337.9} \\ 23 | BIC & \num{341.3} & \num{343.7} \\ 24 | Log.Lik. & \num{-165.428} & \num{-164.940} \\ 25 | F & \num{45.460} & \num{23.100} \\ 26 | RMSE & \num{42.55} & \num{41.91} \\ 27 | \bottomrule 28 | \end{tblr} 29 | \end{table} 30 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/output-file.txt: -------------------------------------------------------------------------------- 1 | 2 | +-------------+----------+----------+ 3 | | | (1) | (2) | 4 | +=============+==========+==========+ 5 | | (Intercept) | 324.082 | 278.515 | 6 | +-------------+----------+----------+ 7 | | | (27.433) | (55.415) | 8 | +-------------+----------+----------+ 9 | | mpg | -8.830 | -9.985 | 10 | +-------------+----------+----------+ 11 | | | (1.310) | (1.792) | 12 | +-------------+----------+----------+ 13 | | drat | | 19.126 | 14 | +-------------+----------+----------+ 15 | | | | (20.198) | 16 | +-------------+----------+----------+ 17 | | Num.Obs. | 32 | 32 | 18 | +-------------+----------+----------+ 19 | | R2 | 0.602 | 0.614 | 20 | +-------------+----------+----------+ 21 | | R2 Adj. | 0.589 | 0.588 | 22 | +-------------+----------+----------+ 23 | | AIC | 336.9 | 337.9 | 24 | +-------------+----------+----------+ 25 | | BIC | 341.3 | 343.7 | 26 | +-------------+----------+----------+ 27 | | Log.Lik. | -165.428 | -164.940 | 28 | +-------------+----------+----------+ 29 | | F | 45.460 | 23.100 | 30 | +-------------+----------+----------+ 31 | | RMSE | 42.55 | 41.91 | 32 | +-------------+----------+----------+ 33 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/output_1.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lcc} 4 | \toprule 5 | & (1) & (2)\\ 6 | \midrule 7 | (Intercept) & \num{324.082} & \num{278.515}\\ 8 | & (\num{27.433}) & (\num{55.415})\\ 9 | mpg & \num{-8.830} & \num{-9.985}\\ 10 | & (\num{1.310}) & (\num{1.792})\\ 11 | drat & & \num{19.126}\\ 12 | & & (\num{20.198})\\ 13 | \midrule 14 | Num.Obs. & \num{32} & \num{32}\\ 15 | R2 & \num{0.602} & \num{0.614}\\ 16 | R2 Adj. & \num{0.589} & \num{0.588}\\ 17 | AIC & \num{336.9} & \num{337.9}\\ 18 | BIC & \num{341.3} & \num{343.7}\\ 19 | Log.Lik. & \num{-165.428} & \num{-164.940}\\ 20 | F & \num{45.460} & \num{23.100}\\ 21 | RMSE & \num{42.55} & \num{41.91}\\ 22 | \bottomrule 23 | \end{tabular} 24 | \end{table} 25 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/siunitx1.tex: -------------------------------------------------------------------------------- 1 | \begin{table} 2 | \centering 3 | \begin{tabular}[t]{lS} 4 | \toprule 5 | & {(1)}\\ 6 | \midrule 7 | (Intercept) & 30.099\\ 8 | & (1.634)\\ 9 | hp & -0.068\\ 10 | & (0.010)\\ 11 | \midrule 12 | Num.Obs. & 32\\ 13 | R2 & 0.602\\ 14 | R2 Adj. & 0.589\\ 15 | AIC & 181.2\\ 16 | BIC & 185.6\\ 17 | Log.Lik. & -87.619\\ 18 | F & 45.460\\ 19 | \bottomrule 20 | \end{tabular} 21 | \end{table} 22 | -------------------------------------------------------------------------------- /inst/tinytest/known_output/statistic-override.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/known_output/statistic-override.rds -------------------------------------------------------------------------------- /inst/tinytest/qayztocfynadtqlpmxceqftkvpwjih.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/inst/tinytest/qayztocfynadtqlpmxceqftkvpwjih.pdf -------------------------------------------------------------------------------- /inst/tinytest/test-aaa.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | 3 | # first time output='latex' produces a warning (run first) 4 | mod <- lm(mpg ~ hp, mtcars) 5 | expect_warning(modelsummary(mod, "latex")) 6 | 7 | # first call raises a warning about `performance` metrics. 8 | requiet("brms") 9 | mod <- insight::download_model("brms_1") 10 | expect_warning(modelsummary(mod, statistic = "conf.int")) -------------------------------------------------------------------------------- /inst/tinytest/test-add_columns.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("tinysnapshot") 3 | using("tinysnapshot") 4 | # results is the same, but order of `str()` components is swapped 5 | if (getRversion() < "4.0.0") exit_file("old R") 6 | 7 | 8 | # too many rows in add_columns 9 | ac <- read.csv(text = 10 | "first,last 11 | blah,2 12 | junk,4 13 | another,5") 14 | expect_error(datasummary(mpg + hp ~ mean + sd, data = mtcars, add_columns = ac)) 15 | 16 | # add_columns support in modelsummary. 17 | mod <- lm(mpg ~ hp, mtcars) 18 | ac <- data.frame(X = letters[1:4]) 19 | attr(ac, "position") <- 2 20 | tab <- modelsummary(mod, output = "dataframe", gof_map = NA, add_columns = ac) 21 | expect_equivalent("X", colnames(tab)[2]) 22 | expect_equivalent(ncol(tab), 5) 23 | 24 | 25 | # datasummary add_columns 26 | ac <- read.csv(text = 27 | "first,last 28 | blah,2 29 | junk,4") 30 | attr(ac, 'position') <- c(1, NA) 31 | tab <- datasummary(mpg + hp ~ mean + sd, 32 | data = mtcars, 33 | add_columns = ac, 34 | fmt = '%.2f', 35 | output = 'dataframe') 36 | expect_snapshot_print(tab, "add_columns-dataframe") -------------------------------------------------------------------------------- /inst/tinytest/test-add_rows.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("tibble") 3 | 4 | mod <- list() 5 | 6 | # exit_file("<<-") 7 | 8 | dat <- mtcars 9 | dat$cyl <- factor(dat$cyl) 10 | # dat <<- dat 11 | mod$OLS <- lm(am ~ cyl, data = dat) 12 | mod$Logit <- glm(am ~ cyl, data = dat, family = binomial()) 13 | 14 | # data.frame 15 | rows = read.csv( 16 | text = "term , OLS , Logit 17 | cyl4 , - , - 18 | NEW GOF 1 , ? , ? 19 | NEW GOF 2 , X , X 20 | NEW GOF 3 , Y , Y" 21 | ) 22 | attr(rows, "position") <- c(3, 8, 9, 12) 23 | tab <- modelsummary(mod, add_rows = rows, output = "data.frame") 24 | expect_equivalent(ncol(tab), 5) 25 | expect_true(nrow(tab) > 14) 26 | 27 | # add_rows numeric are formatted by fmt 28 | tmp <- data.frame(a = 1:2, b = 2:3, c = 3:4) 29 | tab <- datasummary( 30 | hp + mpg ~ mean + sd, 31 | data = mtcars, 32 | add_rows = tmp, 33 | fmt = "%.0f", 34 | output = "dataframe" 35 | ) 36 | expect_equivalent(tab$sd, c("69", "6", "3", "4")) 37 | 38 | 39 | # Issue #875: misplaced hrule 40 | models <- list() 41 | models[['OLS']] <- lm(mpg ~ factor(cyl), mtcars) 42 | models[['Logit']] <- glm(am ~ factor(cyl), mtcars, family = binomial) 43 | rows <- tribble( 44 | ~term, 45 | ~OLS, 46 | ~Logit, 47 | 'factor(cyl)4', 48 | '-', 49 | '-', 50 | 'Info', 51 | '???', 52 | 'XYZ' 53 | ) 54 | attr(rows, 'position') <- c(3, 9) 55 | sty <- modelsummary(models, add_rows = rows)@style 56 | sty <- subset(sty, line == "b") 57 | expect_true(all(sty$i == 7)) 58 | -------------------------------------------------------------------------------- /inst/tinytest/test-align.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("tinysnapshot") 3 | using("tinysnapshot") 4 | 5 | # markdown d-column snapshot 6 | mod <- lm(mpg ~ I(hp / 1000) + am + vs + factor(cyl), mtcars) 7 | expect_snapshot_print( 8 | modelsummary(mod, "markdown", align = "ld"), 9 | "align-md_dcolumn") -------------------------------------------------------------------------------- /inst/tinytest/test-bad-input.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | 3 | # multiple models must be wrapped in a list 4 | mod <- lm(mpg ~ hp, mtcars) 5 | expect_error(modelplot(mod, mod), pattern = "is sometimes raised") 6 | expect_error(modelsummary(mod, mod), pattern = "is sometimes raised") 7 | 8 | # coef_map: two variables with the same name within or between models 9 | # within one model produces an error 10 | x <- rnorm(100) 11 | y <- rnorm(100) 12 | z <- rnorm(100) 13 | mod <- lm(y ~ x + z) 14 | expect_error(modelsummary(mod, "data.frame", coef_map = c("x" = "X", "z" = "X"))) 15 | expect_error(modelsummary(mod, "data.frame", coef_rename = c("x" = "X", "z" = "X"))) 16 | 17 | # across models works well 18 | mod <- list() 19 | mod[[1]] <- lm(y ~ x) 20 | mod[[2]] <- lm(y ~ z) 21 | tab <- modelsummary(mod, output = "data.frame", coef_map = c("x" = "X", "z" = "X")) 22 | expect_inherits(tab, "data.frame") -------------------------------------------------------------------------------- /inst/tinytest/test-coef_omit.R: -------------------------------------------------------------------------------- 1 | # perl=TRUE allows lookbehind 2 | # omit vs except when it is preceded by mpg 3 | mod <- lm(hp ~ mpg * vs, mtcars) 4 | out <- modelsummary(mod, 5 | coef_omit = "^(?!mpg).*vs", 6 | output = "data.frame") 7 | expect_equivalent( 8 | out$term[1:7], 9 | c("(Intercept)", "(Intercept)", "mpg", "mpg", "mpg × vs", "mpg × vs", "Num.Obs.")) 10 | 11 | # omit coefficients using regular expressions 12 | mod <- list() 13 | mod$OLS <- lm(am ~ drat, data = mtcars) 14 | mod$Logit <- glm(am ~ qsec, data = mtcars, family = binomial()) 15 | 16 | raw <- modelsummary(mod, coef_omit = c("drat|qsec"), output = "dataframe") 17 | 18 | truth <- c("(Intercept)", "(Intercept)", "Num.Obs.") 19 | expect_equivalent(unname(raw[[2]][1:3]), truth) 20 | 21 | # numeric indices 22 | mod <- list( 23 | lm(mpg ~ hp + factor(cyl) + drat + factor(am), mtcars), 24 | lm(mpg ~ factor(cyl) + drat, mtcars)) 25 | tab <- modelsummary(mod, "data.frame", coef_omit = 1:2) 26 | expect_false("(Intercept)" %in% tab$term) 27 | tab <- modelsummary(mod, "data.frame", gof_map = NA, coef_omit = 3) 28 | expect_equivalent(nrow(tab), 10) 29 | tab <- modelsummary(mod, "data.frame", gof_map = NA, coef_omit = 2:3) 30 | expect_equivalent(nrow(tab), 8) 31 | expect_error( 32 | modelsummary(mod, shape = model ~ term, coef_omit = 3), 33 | pattern = "shape") 34 | tab <- modelsummary(mod, "data.frame", coef_omit = -1, gof_map = NA) 35 | expect_equivalent(nrow(tab), 2) 36 | tab <- modelsummary(mod, "data.frame", coef_omit = -c(1, 3), gof_map = NA) 37 | expect_equivalent(nrow(tab), 4) 38 | expect_error( 39 | modelsummary(mod, "data.frame", coef_omit = -1:3, gof_map = NA), 40 | pattern = "sign") -------------------------------------------------------------------------------- /inst/tinytest/test-coef_rename.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | 3 | mod <- list() 4 | mod$OLS <- lm(am ~ drat, data = mtcars) 5 | mod$Logit <- glm(am ~ qsec, data = mtcars, family = binomial()) 6 | 7 | # rename 2 out of 3 coefficients 8 | cmap <- c("(Intercept)" = "Constant", "drat" = "Rear axle ratio") 9 | mod <- modelsummary(mod, "dataframe", coef_rename = cmap) 10 | known <- c("Constant", "Constant", "Rear axle ratio", "Rear axle ratio", "qsec") 11 | expect_equivalent(mod$term[1:5], known) 12 | 13 | # coef_rename and coef_map are incompatible 14 | cmap <- c("(Intercept)" = "Constant", "drat" = "Rear axle ratio") 15 | expect_error(modelsummary(mod, coef_rename = cmap, coef_map = cmap)) 16 | 17 | # regression test: coef_rename() function 18 | x <- list( 19 | lm(mpg ~ factor(cyl) + drat + disp, data = mtcars), 20 | lm(hp ~ factor(cyl) + drat + disp, data = mtcars)) 21 | tab <- modelsummary(dvnames(x), output = "dataframe", coef_rename = coef_rename) 22 | expect_inherits(tab, "data.frame") 23 | 24 | # unnamed coef_rename + coef_omit numeric 25 | mod <- lm(mpg ~ hp + wt + disp + carb + gear + vs + cyl + drat + am + hp * wt, data = mtcars) 26 | tab <- modelsummary(mod, output = "data.frame", coef_omit = c(3:11), coef_rename = c("Constant", "Horsepower"), gof_map = NA) 27 | expect_equivalent(nrow(tab), 4) -------------------------------------------------------------------------------- /inst/tinytest/test-corner-cases.R: -------------------------------------------------------------------------------- 1 | # duplicate names are padded 2 | mod <- list( 3 | "a" = lm(hp ~ mpg, mtcars), 4 | "a" = lm(hp ~ mpg + drat, mtcars)) 5 | 6 | tab <- msummary(mod, output = "data.frame") 7 | expect_true(all(c("a", "a ") %in% colnames(tab))) 8 | 9 | tab <- msummary(dvnames(mod), output = "data.frame") 10 | expect_true(all(c("hp", "hp ") %in% colnames(tab))) 11 | 12 | # Issue #565 13 | mod <- lm(mpg ~ 0 + hp + drat, mtcars) 14 | expect_warning( 15 | modelsummary(mod, output = "markdown", standardize = "refit"), 16 | pattern = "standardized") -------------------------------------------------------------------------------- /inst/tinytest/test-datasummary_df.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | 3 | tmp <- head(mtcars) 4 | 5 | # no error + code coverage 6 | tmp$cyl <- as.factor(tmp$cyl) 7 | 8 | ar <- tail(mtcars, 1) 9 | ac <- data.frame(new = 1:6) 10 | 11 | tab <- datasummary_df( 12 | data = tmp, 13 | output = "default", 14 | fmt = "%.0f", 15 | align = strrep("r", ncol(tmp)), 16 | hrule = 3, 17 | title = "blah blah title", 18 | notes = c("first note", "second note"), 19 | add_rows = ar) 20 | expect_inherits(tab, "tinytable") 21 | -------------------------------------------------------------------------------- /inst/tinytest/test-dvnames.R: -------------------------------------------------------------------------------- 1 | # dvnames adds names 2 | d <- data.frame(x = 1:10, y = 2:11) 3 | m1 <- lm(y ~ x, data = d) 4 | m2 <- lm(x ~ y, data = d) 5 | dvnout <- dvnames(list(m1, m2)) 6 | nondvn <- list("y" = m1, "x" = m2) 7 | expect_identical(dvnout, nondvn) 8 | 9 | # dvnames with single input 10 | d <- data.frame(x = 1:10, y = 2:11) 11 | m1 <- lm(y ~ x, data = d) 12 | dvnout <- dvnames(m1) 13 | nondvn <- list("y" = m1) 14 | expect_identical(dvnout, nondvn) 15 | 16 | # dvnames numbering 17 | d <- data.frame(x = 1:10, y = 2:11) 18 | m1 <- lm(y ~ x, data = d) 19 | m2 <- lm(x ~ y, data = d) 20 | dvnout <- dvnames(list(m1, m2), number = TRUE) 21 | nondvn <- list("y (1)" = m1, "x (2)" = m2) 22 | expect_identical(dvnout, nondvn) 23 | 24 | # dvnames fill 25 | d <- data.frame(x = 1:10, y = 2:11) 26 | m1 <- lm(y ~ x, data = d) 27 | m2 <- lm(x ~ y, data = d) 28 | dvnout <- dvnames(list(m1, m2, 1)) 29 | nondvn <- list("y" = m1, "x" = m2, "Model" = 1) 30 | expect_identical(dvnout, nondvn) 31 | 32 | # dvnames transformation 33 | m1 <- lm(mpg ~ cyl + hp, data = mtcars) 34 | m2 <- lm(log(mpg+1) ~ cyl + hp, data = mtcars) 35 | a <- modelsummary(dvnames(list(m1, m2)), output = "data.frame") 36 | b <- modelsummary(dvnames(list(m1, m2), strip = TRUE), output = "data.frame") 37 | expect_true("log(mpg + 1)" %in% colnames(a)) 38 | expect_false("log(mpg + 1)" %in% colnames(b)) 39 | -------------------------------------------------------------------------------- /inst/tinytest/test-ellipses.R: -------------------------------------------------------------------------------- 1 | library(modelsummary) 2 | 3 | # exponentiate logit coefficients 4 | 5 | mod <- glm(am ~ mpg, mtcars, family = binomial) 6 | 7 | # not exponentiated 8 | raw <- modelsummary( 9 | mod, 10 | gof_omit = ".*", 11 | output = "dataframe", 12 | exponentiate = FALSE) 13 | truth <- c("-6.604", "(2.351)", "0.307", "(0.115)") 14 | expect_equivalent(raw[[4]], truth) 15 | 16 | # exponentiated conf.int 17 | raw <- modelsummary( 18 | mod, 19 | gof_omit = ".*", 20 | statistic = "conf.int", 21 | output = "dataframe", 22 | exponentiate = FALSE) 23 | truth <- c("-6.604", "[-12.328, -2.772]", "0.307", "[0.122, 0.587]") 24 | expect_equivalent(raw[[4]], truth) 25 | 26 | # exponentiated std.error 27 | # As noted by Alex P Hayes: 28 | # https://github.com/tidymodels/broom/issues/422 29 | # I believe this is the correct behavior: quantiles (and thereby confidence 30 | # intervals) are invariant under monotonic transformation (exp()) but 31 | # variances are not. 32 | raw <- modelsummary( 33 | mod, 34 | gof_omit = ".*", 35 | output = "dataframe", 36 | exponentiate = FALSE) 37 | truth <- c("-6.604", "(2.351)", "0.307", "(0.115)") 38 | expect_equivalent(raw[[4]], truth) -------------------------------------------------------------------------------- /inst/tinytest/test-estimate.R: -------------------------------------------------------------------------------- 1 | models <- list( 2 | lm(hp ~ mpg + drat, mtcars), 3 | lm(hp ~ mpg + drat, mtcars)) 4 | 5 | # multiple estimates",{ 6 | tab1 <- modelsummary(models, 7 | output = "data.frame", 8 | gof_omit = ".*", 9 | stars = TRUE, 10 | statistic = NULL, 11 | estimate = c( 12 | "{estimate} ({std.error}){stars}", 13 | "{estimate} [{conf.low}, {conf.high}]")) 14 | tab2 <- modelsummary(models, 15 | output = "data.frame", 16 | gof_omit = ".*", 17 | stars = FALSE, 18 | statistic = NULL, 19 | estimate = c( 20 | "{estimate} ({std.error}){stars}", 21 | "{estimate} [{conf.low}, {conf.high}]")) 22 | expect_true(all(tab1 == tab2)) 23 | 24 | # error",{ 25 | expect_error( 26 | modelsummary(models, 27 | output = "data.frame", 28 | gof_omit = ".*", 29 | stars = TRUE, 30 | statistic = NULL, 31 | estimate = c( 32 | "estimate", 33 | "{estimate} ({std.error}){stars}", 34 | "{estimate} [{conf.low}, {conf.high}]"))) -------------------------------------------------------------------------------- /inst/tinytest/test-extract_estimates.R: -------------------------------------------------------------------------------- 1 | # bad estimate name throws error 2 | mod <- lm(am ~ drat, data = mtcars) 3 | expect_error(modelsummary:::format_estimates(mod, estimate = "junk")) 4 | 5 | 6 | # bad statistic name throws error 7 | mod <- lm(am ~ drat, data = mtcars) 8 | expect_error( 9 | modelsummary(mod, output = "dataframe", statistic = "junk") 10 | ) 11 | 12 | expect_error( 13 | modelsummary(mod, 14 | statistic = "junk", 15 | output = "dataframe", 16 | statistic_override = vcov) 17 | ) -------------------------------------------------------------------------------- /inst/tinytest/test-flextable.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("flextable") 3 | 4 | models <- list() 5 | models[['OLS 1']] <- lm(hp ~ mpg + wt, mtcars) 6 | models[['Poisson 1']] <- glm(hp ~ mpg + drat, mtcars, family = poisson()) 7 | models[['OLS 2']] <- lm(vs ~ hp + wt, mtcars) 8 | models[['Logit 1']] <- glm(vs ~ hp + drat, mtcars, family = binomial()) 9 | models[['Logit 2']] <- glm(am ~ hp + disp, mtcars, family = binomial()) 10 | 11 | # no error with caption and notes 12 | tab <- modelsummary(models, "flextable", title = "test title", notes = "test note", stars = TRUE) 13 | expect_inherits(tab, "flextable") 14 | 15 | 16 | 17 | # # Issue #761 18 | # d <- data.frame(x = rnorm(100), y = rnorm(100)) 19 | # res <- list( 20 | # lm(y ~ x, data = d), 21 | # lm(y ~ x + I(x^2), data = d) 22 | # ) 23 | # modelsummary( 24 | # res, 25 | # output = "flextable", 26 | # estimate = c(ABC = "estimate"), 27 | # shape = term ~ model + statistic 28 | # ) 29 | -------------------------------------------------------------------------------- /inst/tinytest/test-fstat.R: -------------------------------------------------------------------------------- 1 | # lm f-stat accounts for vcov 2 | mod <- lm(mpg ~ hp + factor(cyl) + drat, data = mtcars) 3 | tab <- modelsummary(mod, output = "data.frame", vcov = list(NULL, "HC3")) 4 | f_iid <- sprintf("%.3f", lmtest::waldtest(mod)$F[2]) 5 | f_hc3 <- sprintf("%.3f", lmtest::waldtest(mod, vcov = sandwich::vcovHC)$F[2]) 6 | expect_equivalent(tab[tab$term == "F", "(1)"], f_iid) 7 | expect_equivalent(tab[tab$term == "F", "(2)"], f_hc3) 8 | expect_false(f_iid == f_hc3) 9 | 10 | # glm f-stat accounts for vcov 11 | mod <- glm(am ~ hp + factor(cyl) + drat, data = mtcars, family = binomial) 12 | tab <- modelsummary(mod, output = "data.frame", vcov = list(NULL, "HC3")) 13 | f_iid <- sprintf("%.3f", lmtest::waldtest(mod)$F[2]) 14 | f_hc3 <- sprintf("%.3f", lmtest::waldtest(mod, vcov = sandwich::vcovHC)$F[2]) 15 | expect_equivalent(tab[tab$term == "F", "(1)"], f_iid) 16 | expect_equivalent(tab[tab$term == "F", "(2)"], f_hc3) 17 | expect_false(f_iid == f_hc3) -------------------------------------------------------------------------------- /inst/tinytest/test-glue.R: -------------------------------------------------------------------------------- 1 | mod <- list( 2 | lm(mpg ~ hp, data = mtcars), 3 | glm(vs ~ hp + cyl, data = mtcars, family = binomial)) 4 | 5 | 6 | # function inside glue string 7 | st <- "{ifelse(p.value <0.001, 'Significant', 'Not significant')}" 8 | tab <- modelsummary(mod, 9 | statistic = st, 10 | fmt = NULL, 11 | output = "dataframe") 12 | expect_equivalent(tab[[4]][2], "Significant") 13 | expect_equivalent(tab[[5]][2], "Not significant") 14 | 15 | 16 | 17 | # glue + no statistic",{ 18 | tab <- modelsummary( 19 | mod, 20 | estimate = "**{estimate}** [{conf.low}, {conf.high}] ({p.value})", 21 | statistic = NULL, 22 | output = "data.frame", 23 | gof_omit = ".*") 24 | truth4 <- c("**30.099** [26.762, 33.436] (<0.001)", "**-0.068** [-0.089, -0.048] (<0.001)", "") 25 | truth5 <- c( 26 | "**9.089** [4.102, 18.413] (0.006)", "**-0.041** [-0.139, 0.013] (0.255)", 27 | "**-0.690** [-2.499, 0.795] (0.382)") 28 | expect_equivalent(tab[[4]], truth4) 29 | expect_equivalent(tab[[5]], truth5) 30 | 31 | 32 | # glue + multi statistics",{ 33 | tab <- modelsummary( 34 | mod, 35 | fmt = "%.3f", 36 | estimate = "**{estimate}** [{conf.low}, {conf.high}]", 37 | statistic = c( 38 | "t={statistic}", 39 | "p={p.value}"), 40 | output = "data.frame", 41 | gof_omit = ".*") 42 | truth4 <- c( 43 | "**30.099** [26.762, 33.436]", "t=18.421", "p=0.000", "**-0.068** [-0.089, -0.048]", 44 | "t=-6.742", "p=0.000", "", "", "") 45 | truth5 <- c( 46 | "**9.089** [4.102, 18.413]", "t=2.759", "p=0.006", "**-0.041** [-0.139, 0.013]", 47 | "t=-1.139", "p=0.255", "**-0.690** [-2.499, 0.795]", "t=-0.873", "p=0.382") 48 | expect_equivalent(tab[[4]], truth4) 49 | expect_equivalent(tab[[5]], truth5) 50 | -------------------------------------------------------------------------------- /inst/tinytest/test-gof_map.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("tibble") 3 | 4 | # gof_map = NA 5 | mod <- lm(mpg ~ hp, mtcars) 6 | tab1 <- modelsummary(mod, output = "data.frame", gof_map = NA) 7 | tab2 <- modelsummary(mod, output = "data.frame", gof_omit = ".*") 8 | expect_equivalent(tab1, tab2) 9 | expect_false("gof" %in% tab1$part) 10 | expect_false("gof" %in% tab2$part) 11 | 12 | # gof_map inputs are equivalent 13 | mod <- lm(mpg ~ hp, mtcars) 14 | gm <- tribble( 15 | ~raw, ~clean, ~fmt, 16 | "r.squared", "R-Squared", "%.7f") 17 | w <- modelsummary(mod, output = "data.frame", gof_map = gm) 18 | gm <- tribble( 19 | ~raw, ~clean, ~fmt, 20 | "r.squared", "R-Squared", function(x) sprintf("%.7f", x)) 21 | x <- modelsummary(mod, output = "data.frame", gof_map = gm) 22 | gm <- tribble( 23 | ~raw, ~clean, ~fmt, 24 | "r.squared", "R-Squared", 7) 25 | y <- modelsummary(mod, output = "data.frame", gof_map = gm) 26 | gm <- list(list(raw = "r.squared", clean = "R-Squared", fmt = 7)) 27 | z <- modelsummary(mod, output = "data.frame", gof_map = gm) 28 | expect_equivalent(w, x) 29 | expect_equivalent(w, y) 30 | expect_equivalent(w, z) 31 | 32 | # character vector 33 | mod <- lm(mpg ~ hp + drat, mtcars) 34 | tab <- modelsummary(mod, 35 | gof_map = c("r.squared", "rmse", "nobs"), 36 | output = "data.frame") 37 | expect_equivalent(tab$term[7:9], c("R2", "RMSE", "Num.Obs.")) 38 | tab <- modelsummary(mod, gof_map = c("junk", "rmse", "nobs"), output = "data.frame") 39 | expect_inherits(tab, "data.frame") 40 | 41 | tab <- modelsummary( 42 | mod, 43 | output = "data.frame", 44 | gof_map = "") 45 | expect_equivalent(nrow(tab), 6) -------------------------------------------------------------------------------- /inst/tinytest/test-html.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("tinysnapshot") 3 | using("tinysnapshot") 4 | 5 | # raw html output 6 | mod <- lm(hp ~ mpg, data = mtcars) 7 | expect_snapshot_print( 8 | print_html(modelsummary(mod, gof_omit = ".*")), 9 | "html-gof_omit.html") |> suppressWarnings() 10 | 11 | # PR 538 12 | mod <- lm(mpg ~ hp + factor(cyl), data = mtcars) 13 | tab <- msummary(mod, stars = TRUE, output = "html") 14 | expect_true(grepl("\\<", tab)) 15 | -------------------------------------------------------------------------------- /inst/tinytest/test-interaction.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("tinysnapshot") 3 | using("tinysnapshot") 4 | 5 | # : in interactions become x 6 | mod <- lm(am ~ drat * mpg * vs, mtcars) 7 | expect_snapshot_print( 8 | modelsummary(mod, "markdown"), 9 | "interaction-markdown") 10 | 11 | # fixest i() becomes = 12 | requiet("fixest") 13 | mod <- suppressMessages(feols(Ozone ~ Solar.R + i(Month), airquality)) 14 | expect_snapshot_print( 15 | modelsummary(mod, "markdown", gof_map = list()), 16 | "interaction-markdown_no_gof") 17 | 18 | # conditional conversion of : to x 19 | mod <- lm(am ~ drat:mpg, mtcars) 20 | tab <- modelsummary( 21 | mod, 22 | output = "dataframe", 23 | coef_rename = c("DRAT" = "drat")) 24 | expect_true("drat:mpg" %in% tab$term) 25 | 26 | mod <- lm(mpg ~ disp, mtcars) 27 | tab <- modelsummary( 28 | mod, 29 | output = "dataframe", 30 | coef_rename = c("disp" = "a:b")) 31 | expect_true("a:b" %in% tab$term) -------------------------------------------------------------------------------- /inst/tinytest/test-latex.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("tinysnapshot") 3 | using("tinysnapshot") 4 | 5 | models <- list( 6 | lm(hp ~ mpg, mtcars), 7 | lm(hp ~ mpg + drat, mtcars)) 8 | 9 | # latex threeparttable argument 10 | options(modelsummary_factory_latex = "kableExtra") 11 | tab1 <- modelsummary(models, output = "latex", stars = TRUE) 12 | tab2 <- modelsummary(models, output = "latex", threeparttable = TRUE, stars = TRUE) 13 | expect_false(grepl("threeparttable", tab1)) 14 | expect_true(grepl("threeparttable", tab2)) 15 | expect_equivalent(sum(grepl("threeparttable", strsplit(tab2, "\n")[[1]])), 2) 16 | 17 | ## kableExtra::footnote has a bug with multiple footnotes and threeparttable, so we combine notes. 18 | ft <- "Here is a very very very very very very very very very very very very very very very very very long footnote" 19 | tab3 <- modelsummary(models, 20 | output = "latex", 21 | title = "Regression output", 22 | notes = ft, 23 | stars = TRUE, 24 | threeparttable = TRUE) 25 | expect_equivalent(sum(grepl("threeparttable", strsplit(tab3, "\n")[[1]])), 2) 26 | options(modelsummary_factory_latex = NULL) 27 | 28 | # output = latex_tabular 29 | expect_snapshot_print( 30 | modelsummary(models, output = "latex_tabular"), 31 | "latex-tabular") 32 | 33 | # Issue #560: circum escape 34 | requiet("fixest") 35 | base = iris 36 | names(base) = c("y", paste0("x", 1:3), "fe1") 37 | base$fe2 = rep(letters[1:5], 30) 38 | base$fe3 = rep(letters[1:5], 30) 39 | est_comb = feols(y ~ x1 | fe1 + fe2 + fe3, data = base, cluster = "fe1^fe2") 40 | tab <- modelsummary(est_comb, output = "latex") 41 | expect_true(grepl("circum\\{\\}", tab)) 42 | -------------------------------------------------------------------------------- /inst/tinytest/test-mathmode.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("tinysnapshot") 3 | using("tinysnapshot") 4 | 5 | mod <- list( 6 | lm(mpg ~ hp, mtcars), 7 | lm(mpg ~ hp + drat, mtcars)) 8 | 9 | # d-column: known output 10 | expect_snapshot_print( 11 | modelsummary(mod, align = "ldd", output = "latex"), 12 | "mathmode-latex_ldd") 13 | 14 | # LaTeX global options 15 | expect_snapshot_print( 16 | modelsummary(mod, output = "latex"), 17 | "mathmode-latex_null") 18 | 19 | options("modelsummary_format_numeric_latex" = "dollars") 20 | expect_snapshot_print( 21 | modelsummary(mod, output = "latex", escape = FALSE), 22 | "mathmode-latex_dollars") 23 | 24 | options("modelsummary_format_numeric_latex" = "anything else") 25 | expect_snapshot_print( 26 | modelsummary(mod, output = "latex"), 27 | "mathmode-latex_anything") 28 | 29 | options("modelsummary_format_numeric_latex" = NULL) 30 | 31 | 32 | # HTML global options 33 | options(tinytable_html_mathjax = TRUE) 34 | expect_snapshot_print( 35 | print_html(modelsummary(mod, output = "html")), 36 | "mathmode-null.html") 37 | 38 | options("modelsummary_format_numeric_html" = "dollars") 39 | expect_snapshot_print( 40 | print_html(modelsummary(mod, output = "html")), 41 | "mathmode-html_dollars.html") 42 | options(tinytable_html_mathjax = NULL) 43 | 44 | options("modelsummary_format_numeric_html" = "anything else") 45 | expect_snapshot_print( 46 | print_html(modelsummary(mod, output = "html")), 47 | "mathmode-html_anything.html") 48 | options("modelsummary_format_numeric_html" = NULL) 49 | 50 | -------------------------------------------------------------------------------- /inst/tinytest/test-modelsummary_list.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | 3 | # Issue 507: extraneous error about not supported 4 | mod <- lm(mpg ~ hp + factor(cyl), mtcars) 5 | ml <- modelsummary(mod, output = "modelsummary_list") 6 | msg <- capture.output({tab <- modelsummary(ml, output = "data.frame")}) 7 | expect_equivalent(length(msg), 0) 8 | 9 | # output="modelsummary_list" and back to data.frame 10 | mod <- list( 11 | lm(mpg ~ hp, mtcars), 12 | lm(mpg ~ hp + drat, mtcars)) 13 | tab <- modelsummary(mod, "modelsummary_list") 14 | expect_true(all(sapply(tab, inherits, "modelsummary_list"))) 15 | expect_true(class(tab)[1] == "list") 16 | tab <- modelsummary(tab, "data.frame") 17 | expect_inherits(tab, "data.frame") 18 | expect_equivalent(dim(tab), c(14, 5)) 19 | 20 | # tidiers empty 21 | mod <- lm(mpg ~ hp + drat + vs, mtcars) 22 | ml <- list(tidy = modelsummary:::get_estimates(mod)) 23 | class(ml) <- "modelsummary_list" 24 | gl <- generics::glance(ml) 25 | expect_inherits(gl, "data.frame") 26 | expect_equivalent(dim(gl), c(1, 0)) 27 | ml <- list(glance = modelsummary:::get_gof(mod)) 28 | class(ml) <- "modelsummary_list" 29 | expect_error(tidy(ml)) -------------------------------------------------------------------------------- /inst/tinytest/test-output-file.R: -------------------------------------------------------------------------------- 1 | # CRAN fails on artefacts 2 | # skip_on_cran() 3 | source("helpers.R") 4 | requiet("digest") 5 | requiet("flextable") 6 | 7 | mod <- list() 8 | mod[[1]] <- lm(hp ~ mpg, mtcars) 9 | mod[[2]] <- lm(hp ~ mpg + drat, mtcars) 10 | 11 | # # save known files 12 | # modelsummary(mod, output = "known_output/output-file.md") 13 | # modelsummary(mod, output = "known_output/output-file.txt") 14 | # modelsummary(mod, output = "known_output/output-file.tex") 15 | # modelsummary(mod, output = "known_output/output-file.rtf") 16 | # modelsummary(mod, output = "known_output/output-file.docx") 17 | # modelsummary(mod, output = "known_output/output-file.pptx") 18 | # modelsummary(mod, output = "known_output/output-file.jpg") 19 | # modelsummary(mod, output = "known_output/output-file.png") 20 | 21 | # exit_file("broken") 22 | extensions <- c(".md", ".tex", ".txt", ".rtf") # , ".jpg") 23 | for (x in extensions) { 24 | testname <- paste0("output='table", x, "'") 25 | fn1 <- paste0(random_string(), x) 26 | fn2 <- file.path("known_output", paste0("output-file", x)) 27 | modelsummary(mod, output = fn1) 28 | expect_true(compare_files(fn1, fn2)) 29 | unlink(fn1) 30 | } 31 | 32 | # pandoc error on github actions 33 | if (!ON_CI) { 34 | # docx hash changes from write to write 35 | # output='table.docx' 36 | fn1 <- paste0(random_string(), ".docx") 37 | modelsummary(mod, output = fn1) 38 | expect_true(file.info(fn1)$size > 10000) 39 | unlink(fn1) 40 | 41 | # pptx hash changes from write to write 42 | # output='table.pptx' 43 | fn1 <- paste0(random_string(), ".pptx") 44 | modelsummary(mod, output = fn1) 45 | expect_true(file.info(fn1)$size > 10000) 46 | unlink(fn1) 47 | } 48 | -------------------------------------------------------------------------------- /inst/tinytest/test-pkg-MASS.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("MASS") 3 | 4 | # Issue #518 5 | # lmtest::coeftest does not return values for intercepts 6 | mod <- polr(factor(gear) ~ mpg, data = mtcars) 7 | tab <- suppressMessages(suppressWarnings(modelsummary( 8 | mod, 9 | output = "dataframe", 10 | estimate = "std.error", 11 | statistic = NULL, 12 | gof_map = "none", 13 | vcov = list(NULL, ~cyl)))) 14 | expect_true(all(tab[["(1)"]] != tab[["(2)"]])) 15 | 16 | -------------------------------------------------------------------------------- /inst/tinytest/test-pkg-brms.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | using("checkmate") 3 | requiet("brms") 4 | 5 | # brms: diagnostics and tests 6 | mod <- insight::download_model("brms_1") 7 | tab <- modelsummary(mod, "data.frame", statistic = "conf.int") 8 | expect_inherits(tab, "data.frame") 9 | tab <- modelsummary(mod, "data.frame", diagnostic = "ESS", statistic = "ess") 10 | expect_inherits(tab, "data.frame") 11 | expect_error(modelsummary(mod, "data.frame", statistic = "rope"), pattern = "available") 12 | 13 | # modelplot 14 | mod <- marginaleffects:::modelarchive_model("brms_numeric2") 15 | p <- modelplot(mod) 16 | expect_inherits(p, "gg") 17 | p <- modelplot(mod, draw = FALSE) 18 | expect_data_frame(p, nrows = 3) 19 | 20 | 21 | # mix brms and lm 22 | modglm <- glm(am ~ mpg + hp, data = mtcars, family = binomial) 23 | models <- list(mod, modglm) 24 | 25 | tab <- modelsummary( 26 | models, 27 | coef_rename = \(x) gsub("b_", "", x), 28 | coef_omit = "Intercept", 29 | statistic = c("std.error", "conf.int")) 30 | expect_inherits(tab, "tinytable") 31 | -------------------------------------------------------------------------------- /inst/tinytest/test-pkg-lavaan.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("lavaan") 3 | 4 | # Issue #502 5 | model <- 'ind60 =~ x1 + x2 + x3' 6 | fit <- lavaan::cfa(model, data = PoliticalDemocracy) 7 | void <- capture.output({tab <- modelsummary(fit, output = "data.frame", standardize = "all")}) 8 | expect_inherits(tab, "data.frame") 9 | expect_true(nrow(tab) > 7) 10 | expect_true(ncol(tab) > 3) -------------------------------------------------------------------------------- /inst/tinytest/test-pkg-marginaleffects.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("marginaleffects") 3 | 4 | # no error 5 | dat <- mtcars 6 | dat$cyl <- as.factor(dat$cyl) 7 | dat$am <- as.logical(dat$am) 8 | dat <<- dat 9 | mod <- lm(mpg ~ am + cyl + hp, data = dat) 10 | rm("dat") 11 | 12 | mfx <- avg_slopes(mod) 13 | cmp <- avg_comparisons(mod) 14 | 15 | tab <- modelsummary(mfx, shape = term + contrast ~ model, output = "data.frame") 16 | expect_inherits(tab, "data.frame") 17 | tab <- modelsummary(cmp, shape = term + contrast ~ model, output = "data.frame") 18 | expect_inherits(tab, "data.frame") 19 | 20 | # multiple groups 21 | mod <- lm(mpg ~ am + vs + factor(cyl), data = mtcars) 22 | mod2 <- lm(mpg ~ drat + am + vs + factor(cyl), data = mtcars) 23 | cmp <- avg_comparisons(mod, variables = c("am", "vs"), by = "cyl", cross = TRUE) 24 | cmp2 <- avg_comparisons(mod2, variables = c("am", "vs"), by = "cyl", cross = TRUE) 25 | 26 | tab <- modelsummary( 27 | list(cmp, cmp2), 28 | output = "dataframe", 29 | gof_map = NA, 30 | shape = cyl + contrast_am + contrast_vs ~ model) 31 | expect_equivalent(dim(tab), c(6, 7)) 32 | 33 | tab <- modelsummary( 34 | cmp, 35 | output = "dataframe", 36 | gof_map = NA, 37 | shape = contrast_vs + contrast_am + cyl ~ model) 38 | expect_equivalent(dim(tab), c(6, 6)) 39 | 40 | tab <- modelsummary( 41 | cmp, 42 | output = "dataframe", 43 | gof_map = NA, 44 | shape = contrast_vs + contrast_am ~ cyl + model) 45 | expect_equivalent(dim(tab), c(2, 7)) 46 | 47 | expect_error( 48 | modelsummary( 49 | cmp, 50 | shape = term + cyl + trash + contrast_am + contrast_vs ~ model), 51 | pattern = "not found") 52 | -------------------------------------------------------------------------------- /inst/tinytest/test-pkg-mgcv.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("mgcv") 3 | 4 | # Issue #558 5 | dat <- gamSim(1, n = 4000, dist = "normal", scale = 2, verbose = FALSE) 6 | mod <- gam(y ~ s(x0) + s(x1) + s(x2), data = dat) 7 | tab <- modelsummary( 8 | mod, 9 | output = "dataframe", 10 | coef_omit = "^s\\(", 11 | statistic = c( 12 | "std.error", 13 | "statistic", 14 | "p.value"), 15 | shape = term ~ model + statistic, 16 | gof_map = NA) 17 | expect_equivalent(tab[1, ncol(tab)], "<0.001") -------------------------------------------------------------------------------- /inst/tinytest/test-pkg-survival.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | requiet("survival") 3 | 4 | # Issue #547 5 | bladder1 <- bladder[bladder$enum < 5, ] 6 | mod <- coxph( 7 | Surv(stop, event) ~ (rx + size + number) * strata(enum), 8 | cluster = id, bladder1, robust = TRUE) 9 | tab <- modelsummary(mod, estimate = "p.value", fmt = 10, statistic = NULL, gof_map = NA, output = "dataframe") 10 | p <- coef(summary(mod))[, "Pr(>|z|)"] 11 | expect_equivalent(as.numeric(tab[["(1)"]]), p, ignore_attr = TRUE) -------------------------------------------------------------------------------- /inst/tinytest/test-tidy_custom.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | exit_file("works interactively") 3 | 4 | # tidy.custom 5 | tidy.custom <- function(x) { 6 | suppressWarnings(broom:::tidy.lm(x)) 7 | } 8 | tidy_custom.custom <- function(x) { 9 | out <- suppressWarnings(broom:::tidy.lm(x)) 10 | out$estimate <- letters[1:nrow(out)] 11 | out 12 | } 13 | mod <- lm(hp ~ mpg, mtcars) 14 | class(mod) <- c("custom", class(mod)) 15 | tab <- modelsummary( 16 | mod, 17 | output = "data.frame", 18 | gof_omit = ".*", 19 | statistic = NULL) 20 | expect_equivalent(tab[["(1)"]], c("a", "b")) 21 | rm("tidy.custom") 22 | rm("tidy_custom.custom") 23 | 24 | # tidy.custom p values in polr models 25 | requiet("MASS") 26 | requiet("AER") 27 | tidy_custom.polr <- function(x, ...) { 28 | s <- coeftest(x) 29 | out <- data.frame( 30 | term = row.names(s), 31 | p.value = s[, "Pr(>|z|)"]) 32 | out 33 | } 34 | mod <- list( 35 | "LM" = lm(gear ~ hp + mpg, data = mtcars), 36 | "POLR" = polr(as.ordered(gear) ~ hp + mpg, data = mtcars)) 37 | tab <- suppressMessages(modelsummary(mod, stars = TRUE, output = "data.frame")) 38 | truth <- c("", "", "0.020*", "(0.010)", "0.373**", "(0.123)", "10.158**", "(3.660)", "12.798**") 39 | expect_equivalent(tab$POLR[1:9], truth) 40 | rm("tidy_custom.polr") 41 | -------------------------------------------------------------------------------- /inst/tinytest/test-typst.R: -------------------------------------------------------------------------------- 1 | # mod <- list( 2 | # lm(mpg ~ hp, mtcars), 3 | # lm(mpg ~ hp + wt, mtcars) 4 | # ) 5 | 6 | # library(modelsummary) 7 | 8 | # modelsummary(mod, output = "typst") 9 | -------------------------------------------------------------------------------- /inst/tinytest/test-unsupported.R: -------------------------------------------------------------------------------- 1 | # CRAN and old versions fail when trying to load `broom.mixed` 2 | # unsupported models require `broom.mixed` 3 | # should no longer be a problem now that easystats is first 4 | # skip_on_cran() 5 | if (getRversion() < "4.0.0") exit_file("old R") 6 | 7 | # Characters raise error 8 | # build issue with packages broom.mixed and TMB 9 | mod <- list() 10 | mod[[1]] <- lm(hp ~ mpg, mtcars) 11 | mod[[2]] <- 'ljaksdf' 12 | expect_error(suppressWarnings(modelsummary(mod))) 13 | expect_warning(modelsummary(mod[[2]])) 14 | expect_error(suppressWarnings(modelsummary(mod[[2]]))) 15 | 16 | # Numerics raise error 17 | mod <- list() 18 | mod[[1]] <- lm(hp ~ mpg, mtcars) 19 | mod[[2]] <- 1:30 20 | expect_warning(expect_error(modelsummary(mod))) 21 | expect_warning(expect_error(modelsummary(mod[[2]]))) 22 | 23 | # NULL raises error 24 | mod <- lm(hp ~ mpg, mtcars) 25 | mod <- list(mod, NULL) 26 | expect_error(modelsummary(mod)) 27 | expect_error(modelsummary(mod[[2]])) -------------------------------------------------------------------------------- /inst/tinytest/test-zzz-modelsummary_get.R: -------------------------------------------------------------------------------- 1 | data(trees) 2 | mod <- lm(Girth ~ Height + Volume, data = trees) 3 | 4 | # options(modelsummary_get) 5 | options(modelsummary_get = "broom") 6 | tab1 <- get_gof(mod) 7 | expect_equivalent(ncol(tab1), 13) 8 | 9 | options(modelsummary_get = "easystats") 10 | tab2 <- get_gof(mod) 11 | expect_true(ncol(tab2) > 6) 12 | expect_true("rmse" %in% colnames(tab2)) 13 | 14 | options(modelsummary_get = "all") 15 | tab3 <- get_gof(mod) 16 | expect_equivalent(ncol(tab3), 14) 17 | 18 | 19 | # restore default 20 | options(modelsummary_get = "easystats") 21 | 22 | -------------------------------------------------------------------------------- /inst/tinytest/test-zzz.R: -------------------------------------------------------------------------------- 1 | source("helpers.R") 2 | 3 | # glue with no statistic 4 | # first time lmer raises a warn_once 5 | requiet("lme4") 6 | mod <- lmer(mpg ~ hp + (1 | cyl), data = mtcars) 7 | tab <- modelsummary(mod, 8 | output = "data.frame", 9 | gof_map = NA, 10 | statistic = c( 11 | "t = {statistic}", 12 | "p = {p.value}")) 13 | expect_equivalent(nrow(tab), 8) 14 | 15 | -------------------------------------------------------------------------------- /man-roxygen/citation.R: -------------------------------------------------------------------------------- 1 | #' 2 | #' @references 3 | #' Arel-Bundock V (2022). “modelsummary: Data and Model Summaries in R.” _Journal of Statistical Software_, *103*(1), 1-23. \doi{10.18637/jss.v103.i01}.' 4 | #' 5 | -------------------------------------------------------------------------------- /man-roxygen/kableExtra2tinytable.R: -------------------------------------------------------------------------------- 1 | #' @section Version 2.0.0, kableExtra, and tinytable: 2 | #' 3 | #' Since version 2.0.0, `modelsummary` uses `tinytable` as its default table-drawing backend. 4 | #' Learn more at: https://vincentarelbundock.github.io/tinytable/", 5 | #' 6 | #' Revert to `kableExtra` for one session: 7 | #' 8 | #' `options(modelsummary_factory_default = 'kableExtra')` 9 | #' `options(modelsummary_factory_latex = 'kableExtra')` 10 | #' `options(modelsummary_factory_html = 'kableExtra')` 11 | -------------------------------------------------------------------------------- /man-roxygen/modelsummary_examples.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/man-roxygen/modelsummary_examples.R -------------------------------------------------------------------------------- /man-roxygen/modelsummary_parallel.R: -------------------------------------------------------------------------------- 1 | #' @section Parallel computation: 2 | #' 3 | #' It can take a long time to compute and extract summary statistics from 4 | #' certain models (e.g., Bayesian). In those cases, users can parallelize the 5 | #' process. Since parallelization occurs at the model level, no speedup is 6 | #' available for tables with a single model. Users on mac or linux can launch 7 | #' parallel computation using the built-in `parallel` package. All they need to 8 | #' do is supply a `mc.cores` argument which will be pushed forward to the 9 | #' `parallel::mclapply` function: 10 | #' 11 | #' ```{r, eval = FALSE} 12 | #' modelsummary(model_list, mc.cores = 5) 13 | #' ``` 14 | #' 15 | #' All users can also use the `future.apply` package to parallelize model summaries. 16 | #' For example, to use 4 cores to extract results: 17 | #' 18 | #' ```{r, eval = FALSE} 19 | #' library(future.apply) 20 | #' plan(multicore, workers = 4) 21 | #' options("modelsummary_future" = TRUE) 22 | #' modelsummary(model_list) 23 | #' ``` 24 | #' 25 | #' Note that the "multicore" plan only parallelizes under mac or linux. Windows 26 | #' users can use `plan(multisession)` instead. However, note that the first 27 | #' time `modelsummary()` is called under multisession can be a fair bit longer, 28 | #' because of extra costs in passing data to and loading required packages on 29 | #' to workers. Subsequent calls to `modelsummary()` will often be much faster. 30 | #' 31 | #' Some users have reported difficult to reproduce errors when using the 32 | #' `future` package with some packages. The `future` parallelization in 33 | #' `modelsummary` can be disabled by calling: 34 | #' 35 | #' `options("modelsummary_future" = FALSE)` 36 | -------------------------------------------------------------------------------- /man/All.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{All} 4 | \alias{All} 5 | \title{Include all columns of a dataframe.} 6 | \usage{ 7 | All( 8 | df, 9 | numeric = TRUE, 10 | character = FALSE, 11 | logical = FALSE, 12 | factor = FALSE, 13 | complex = FALSE, 14 | raw = FALSE, 15 | other = FALSE, 16 | texify = getOption("tables.texify", FALSE) 17 | ) 18 | } 19 | \description{ 20 | Include all columns of a dataframe. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/AllObs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{AllObs} 4 | \alias{AllObs} 5 | \title{Display all observations in a table.} 6 | \usage{ 7 | AllObs(data = NULL, show = FALSE, label = "Obsn.", within = NULL) 8 | } 9 | \description{ 10 | Display all observations in a table. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/Arguments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{Arguments} 4 | \alias{Arguments} 5 | \title{'Arguments' pseudo-function} 6 | \usage{ 7 | Arguments(...) 8 | } 9 | \description{ 10 | 'Arguments' pseudo-function 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/DropEmpty.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{DropEmpty} 4 | \alias{DropEmpty} 5 | \title{'DropEmpty' pseudo-function} 6 | \usage{ 7 | DropEmpty(empty = "", which = c("row", "col", "cell")) 8 | } 9 | \description{ 10 | 'DropEmpty' pseudo-function 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/Factor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{Factor} 4 | \alias{Factor} 5 | \title{Use a variable as a factor to give rows in a table.} 6 | \usage{ 7 | Factor( 8 | x, 9 | name = deparse(expr), 10 | levelnames = levels(x), 11 | texify = getOption("tables.texify", FALSE), 12 | expr = substitute(x), 13 | override = TRUE 14 | ) 15 | } 16 | \description{ 17 | Use a variable as a factor to give rows in a table. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/Format.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{Format} 4 | \alias{Format} 5 | \title{Use a variable as a factor to give rows in a table.} 6 | \usage{ 7 | Format(...) 8 | } 9 | \description{ 10 | Use a variable as a factor to give rows in a table. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/Heading.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{Heading} 4 | \alias{Heading} 5 | \title{'Heading' pseudo-function} 6 | \usage{ 7 | Heading(name = NULL, override = TRUE, character.only = FALSE, nearData = TRUE) 8 | } 9 | \description{ 10 | 'Heading' pseudo-function 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/Histogram.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{Histogram} 4 | \alias{Histogram} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | Histogram(x, bins = 10) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{bins}{number of histogram bars} 13 | } 14 | \description{ 15 | This function uses Unicode characters to create a histogram. This can 16 | sometimes be useful, but is generally discouraged. Unicode characters can 17 | only display a limited number of heights for bars, and the accuracy of 18 | output is highly dependent on the platform (typeface, output type, windows 19 | vs. mac, etc.). We recommend you use the \code{tinytable::plot_tt()} function 20 | instead. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/Max.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{Max} 4 | \alias{Max} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | Max(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/Mean.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{Mean} 4 | \alias{Mean} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | Mean(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/Median.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{Median} 4 | \alias{Median} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | Median(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/Min.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{Min} 4 | \alias{Min} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | Min(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/Multicolumn.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{Multicolumn} 4 | \alias{Multicolumn} 5 | \title{Use a variable as a factor to give rows in a table.} 6 | \usage{ 7 | Multicolumn( 8 | x, 9 | name = deparse(expr), 10 | levelnames = levels(x), 11 | width = 2, 12 | first = 1, 13 | justify = "l", 14 | texify = getOption("tables.texify", FALSE), 15 | expr = substitute(x), 16 | override = TRUE 17 | ) 18 | } 19 | \description{ 20 | Use a variable as a factor to give rows in a table. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/N.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{N} 4 | \alias{N} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | N(x) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | } 12 | \description{ 13 | datasummary statistic shortcut 14 | } 15 | \examples{ 16 | if (identical(Sys.getenv("pkgdown"), "true")) { 17 | datasummary(Factor(cyl) ~ N, data = mtcars) 18 | } 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/NPercent.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{NPercent} 4 | \alias{NPercent} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | NPercent(x, y) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{y}{denominator variable} 13 | } 14 | \description{ 15 | datasummary statistic shortcut 16 | } 17 | \keyword{internal} 18 | -------------------------------------------------------------------------------- /man/NUnique.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{NUnique} 4 | \alias{NUnique} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | NUnique(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{...}{unused} 13 | } 14 | \description{ 15 | datasummary statistic shortcut 16 | } 17 | \examples{ 18 | if (identical(Sys.getenv("pkgdown"), "true")) { 19 | datasummary(cyl + hp ~ NUnique, data = mtcars) 20 | } 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/Ncol.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{Ncol} 4 | \alias{Ncol} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | Ncol(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{...}{unused} 13 | } 14 | \description{ 15 | datasummary statistic shortcut 16 | } 17 | \keyword{internal} 18 | -------------------------------------------------------------------------------- /man/P0.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{P0} 4 | \alias{P0} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | P0(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/P100.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{P100} 4 | \alias{P100} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | P100(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/P25.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{P25} 4 | \alias{P25} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | P25(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/P50.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{P50} 4 | \alias{P50} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | P50(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/P75.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{P75} 4 | \alias{P75} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | P75(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/Paste.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{Paste} 4 | \alias{Paste} 5 | \title{Generate terms to paste values together in table.} 6 | \usage{ 7 | Paste( 8 | ..., 9 | head, 10 | digits = 2, 11 | justify = "c", 12 | prefix = "", 13 | sep = "", 14 | postfix = "", 15 | character.only = FALSE 16 | ) 17 | } 18 | \description{ 19 | Generate terms to paste values together in table. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/Percent.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{Percent} 4 | \alias{Percent} 5 | \title{Pseudo-function to compute a statistic relative to a reference set.} 6 | \usage{ 7 | Percent(denom = "all", fn = percent) 8 | } 9 | \description{ 10 | Pseudo-function to compute a statistic relative to a reference set. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/PercentMissing.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{PercentMissing} 4 | \alias{PercentMissing} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | PercentMissing(x) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | } 12 | \description{ 13 | datasummary statistic shortcut 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/PlusMinus.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{PlusMinus} 4 | \alias{PlusMinus} 5 | \title{Generate 'x +/- y' terms in table.} 6 | \usage{ 7 | PlusMinus(x, y, head, xhead, yhead, digits = 2, character.only = FALSE, ...) 8 | } 9 | \description{ 10 | Generate 'x +/- y' terms in table. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/RowFactor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{RowFactor} 4 | \alias{RowFactor} 5 | \title{Use a variable as a factor to give rows in a table.} 6 | \usage{ 7 | RowFactor( 8 | x, 9 | name = deparse(expr), 10 | levelnames = levels(x), 11 | spacing = 3, 12 | space = 1, 13 | suppressfirst = TRUE, 14 | nopagebreak = "\\\\nopagebreak ", 15 | texify = getOption("tables.texify", FALSE), 16 | expr = substitute(x), 17 | override = TRUE 18 | ) 19 | } 20 | \description{ 21 | Use a variable as a factor to give rows in a table. 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/RowNum.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{RowNum} 4 | \alias{RowNum} 5 | \title{Display all observations in a table.} 6 | \usage{ 7 | RowNum(within = NULL, perrow = 5, show = FALSE, label = "Row", data = NULL) 8 | } 9 | \description{ 10 | Display all observations in a table. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/SD.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{SD} 4 | \alias{SD} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | SD(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/Var.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/datasummary_functions.R 3 | \name{Var} 4 | \alias{Var} 5 | \title{datasummary statistic shortcut} 6 | \usage{ 7 | Var(x, fmt = NULL, na.rm = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{variable to summarize} 11 | 12 | \item{fmt}{passed to the \code{modelsummary:::rounding} function} 13 | 14 | \item{na.rm}{a logical value indicating whether ‘NA’ values should be 15 | stripped before the computation proceeds.} 16 | 17 | \item{...}{unused} 18 | } 19 | \description{ 20 | datasummary statistic shortcut 21 | } 22 | \examples{ 23 | if (identical(Sys.getenv("pkgdown"), "true")) { 24 | datasummary(mpg + hp ~ Mean + Median + P0 + P25 + P50 + P75 + P100 + 25 | Min + Max + SD + Var, 26 | data = mtcars) 27 | } 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/coef_rename.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/coef_rename.R 3 | \name{coef_rename} 4 | \alias{coef_rename} 5 | \title{Rename model terms} 6 | \usage{ 7 | coef_rename( 8 | x, 9 | factor = TRUE, 10 | factor_name = TRUE, 11 | poly = TRUE, 12 | backticks = TRUE, 13 | titlecase = TRUE, 14 | underscore = TRUE, 15 | asis = TRUE 16 | ) 17 | } 18 | \arguments{ 19 | \item{x}{character vector of term names to transform} 20 | 21 | \item{factor}{boolean remove the "factor()" label} 22 | 23 | \item{factor_name}{boolean remove the "factor()" label and the name of the 24 | variable} 25 | 26 | \item{poly}{boolean remove the "poly()" label and function arguments} 27 | 28 | \item{backticks}{boolean remove backticks} 29 | 30 | \item{titlecase}{boolean convert to title case} 31 | 32 | \item{underscore}{boolean replace underscores by spaces} 33 | 34 | \item{asis}{boolean remove the \code{I} from as-is formula calls} 35 | } 36 | \description{ 37 | A convenience function which can be passed to the \code{coef_rename} argument of 38 | the \code{modelsummary} function. 39 | } 40 | \section{Examples}{ 41 | 42 | 43 | \if{html}{\out{
}}\preformatted{library(modelsummary) 44 | dat <- mtcars 45 | dat$horse_power <- dat$hp 46 | mod <- lm(mpg ~ horse_power + factor(cyl), dat) 47 | modelsummary(mod, coef_rename = coef_rename) 48 | }\if{html}{\out{
}} 49 | } 50 | 51 | -------------------------------------------------------------------------------- /man/colLabels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{colLabels} 4 | \alias{colLabels} 5 | \title{Retrieve or modify the row or column labels.} 6 | \usage{ 7 | colLabels(x) 8 | } 9 | \description{ 10 | Retrieve or modify the row or column labels. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/config_modelsummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/config_modelsummary.R 3 | \name{config_modelsummary} 4 | \alias{config_modelsummary} 5 | \title{Persistent user settings for the \code{modelsummary} package} 6 | \usage{ 7 | config_modelsummary( 8 | factory_default, 9 | factory_latex, 10 | factory_html, 11 | factory_markdown, 12 | startup_message, 13 | reset = FALSE 14 | ) 15 | } 16 | \arguments{ 17 | \item{factory_default}{Default output format: "tinytable", "kableExtra", "gt", "flextable", "huxtable", "DT", or "markdown"} 18 | 19 | \item{factory_latex}{Name of package used to generate LaTeX output when \code{output="latex"}.} 20 | 21 | \item{factory_html}{Name of package used to generate LaTeX output when \code{output="html"}.} 22 | 23 | \item{factory_markdown}{Name of package used to generate LaTeX output when \code{output="markdown"}.} 24 | 25 | \item{startup_message}{TRUE or FALSE to show warnings at startup} 26 | 27 | \item{reset}{TRUE to return to default settings.} 28 | } 29 | \description{ 30 | Persistent user settings for the \code{modelsummary} package 31 | } 32 | -------------------------------------------------------------------------------- /man/do_call.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelplot.R 3 | \name{do_call} 4 | \alias{do_call} 5 | \title{safe do.call} 6 | \usage{ 7 | do_call(fun, args) 8 | } 9 | \description{ 10 | safe do.call 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/dvnames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dvnames.R 3 | \name{dvnames} 4 | \alias{dvnames} 5 | \title{Title models with their dependent variables} 6 | \usage{ 7 | dvnames(models, number = FALSE, strip = FALSE, fill = "Model") 8 | } 9 | \arguments{ 10 | \item{models}{A regression model or list of regression models} 11 | 12 | \item{number}{Should the models be numbered (1), (2), etc., in addition to their dependent variable names?} 13 | 14 | \item{strip}{boolean FALSE returns the dependent variable names as they appear in the model. TRUE returns the dependent variable names as they appear in the data, without transformations.} 15 | 16 | \item{fill}{If \code{insight::find_response()} cannot find a response, the column title to use in its place. Set to \code{' '} to leave blank.} 17 | } 18 | \description{ 19 | A convenience function for use with a regression model or list of regression models. Returns a named list of models, where the names are the models' respective dependent variables. Pass your list of models to \code{dvnames} before sending to \code{modelsummary} to automatically get dependent variable-titled columns. 20 | } 21 | \examples{ 22 | 23 | m1 <- lm(mpg ~ hp, data = mtcars) 24 | m2 <- lm(mpg ~ hp + wt, data = mtcars) 25 | 26 | # Without dvnames, column names are (1) and (2) 27 | modelsummary(list(m1, m2)) 28 | 29 | # With dvnames, they are "mpg" and "mpg" 30 | modelsummary(dvnames(list(m1,m2))) 31 | 32 | } 33 | -------------------------------------------------------------------------------- /man/escape_html.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/escape.R 3 | \name{escape_html} 4 | \alias{escape_html} 5 | \title{Escape problematic characters to allow display in HTML} 6 | \usage{ 7 | escape_html(x) 8 | } 9 | \arguments{ 10 | \item{x}{a character string to escape} 11 | } 12 | \description{ 13 | Copied from \code{knitr} for internal use because it is unexported and CRAN 14 | rejects ::: 15 | } 16 | \keyword{internal} 17 | -------------------------------------------------------------------------------- /man/escape_latex.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/escape.R 3 | \name{escape_latex} 4 | \alias{escape_latex} 5 | \title{Escape problematic characters to allow compilation in LaTeX} 6 | \usage{ 7 | escape_latex(x, newlines = FALSE, spaces = FALSE) 8 | } 9 | \arguments{ 10 | \item{x}{a character string to escape} 11 | 12 | \item{newlines}{boolean} 13 | 14 | \item{spaces}{boolean} 15 | } 16 | \description{ 17 | Copied from \code{knitr} for internal use because it is unexported and CRAN 18 | rejects ::: 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/escape_string.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/escape.R 3 | \name{escape_string} 4 | \alias{escape_string} 5 | \title{Make sure LaTeX and HTML are safe to compile} 6 | \usage{ 7 | escape_string(x, output_format = NULL) 8 | } 9 | \description{ 10 | Make sure LaTeX and HTML are safe to compile 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/figures/modelsummary_gallery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/man/figures/modelsummary_gallery.gif -------------------------------------------------------------------------------- /man/figures/squirrel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vincentarelbundock/modelsummary/07d4e086c6e921b81637293feb6ad0db5e733297/man/figures/squirrel.png -------------------------------------------------------------------------------- /man/fmt_decimal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fmt_factory.R 3 | \name{fmt_decimal} 4 | \alias{fmt_decimal} 5 | \title{Rounding with decimal digits in the \code{fmt} argument} 6 | \usage{ 7 | fmt_decimal(digits = 3, pdigits = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{digits}{Number of decimal digits to keep, including trailing zeros.} 11 | 12 | \item{pdigits}{Number of decimal digits to keep for p values. If \code{NULL}, the value of \code{digits} is used.} 13 | 14 | \item{...}{Additional arguments are passed to the \code{format()} function (e.g., \code{big.marks}, \code{scientific}). See \code{?format}} 15 | } 16 | \description{ 17 | Rounding with decimal digits in the \code{fmt} argument 18 | } 19 | -------------------------------------------------------------------------------- /man/fmt_equivalence.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fmt_factory.R 3 | \name{fmt_equivalence} 4 | \alias{fmt_equivalence} 5 | \title{Rounding with number of digits determined by an equivalence test} 6 | \usage{ 7 | fmt_equivalence(conf_level = 0.95, digits = 3, pdigits = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{conf_level}{Confidence level to use for the equivalence test (1 - alpha).} 11 | 12 | \item{digits}{Number of significant digits to keep.} 13 | 14 | \item{pdigits}{Number of decimal digits to keep for p values. If \code{NULL}, the value of \code{digits} is used.} 15 | 16 | \item{...}{Additional arguments are passed to the \code{format()} function (e.g., \code{big.marks}, \code{scientific}). See \code{?format}} 17 | } 18 | \description{ 19 | This function implements the suggestions of Astier & Wolak for the number of decimal digits to keep for coefficient estimates. The other statistics are rounded by \code{fmt_significant()}. 20 | } 21 | \examples{ 22 | library(modelsummary) 23 | mod <- lm(mpg ~ hp, mtcars) 24 | 25 | # Default equivalence-based formatting 26 | modelsummary(mod, fmt = fmt_equivalence()) 27 | 28 | # alpha = 0.2 29 | modelsummary(mod, fmt = fmt_equivalence(conf_level = .8)) 30 | 31 | # default equivalence, but with alternative significant digits for other statistics 32 | modelsummary(mod, fmt = fmt_equivalence(digits = 5)) 33 | 34 | } 35 | \references{ 36 | Astier, Nicolas, and Frank A. Wolak. Credible Numbers: A Procedure for Reporting Statistical Precision in Parameter Estimates. No. w32124. National Bureau of Economic Research, 2024. 37 | } 38 | -------------------------------------------------------------------------------- /man/fmt_sci.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fmt_factory.R 3 | \name{fmt_sci} 4 | \alias{fmt_sci} 5 | \title{Rounding using scientific notation} 6 | \usage{ 7 | fmt_sci(digits = 3, ...) 8 | } 9 | \arguments{ 10 | \item{digits}{a positive integer indicating how many significant digits are to be used for numeric and complex \code{x}.} 11 | 12 | \item{...}{additional arguments passed to \code{format()}.} 13 | } 14 | \description{ 15 | Rounding using scientific notation 16 | } 17 | -------------------------------------------------------------------------------- /man/fmt_significant.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fmt_factory.R 3 | \name{fmt_significant} 4 | \alias{fmt_significant} 5 | \title{Rounding with significant digits in the \code{fmt} argument} 6 | \usage{ 7 | fmt_significant(digits = 3, ...) 8 | } 9 | \arguments{ 10 | \item{digits}{Number of significant digits to keep.} 11 | 12 | \item{...}{Additional arguments are passed to the \code{format()} function (e.g., \code{big.marks}, \code{scientific}). See \code{?format}} 13 | } 14 | \description{ 15 | The number of decimal digits to keep after the decimal is assessed 16 | } 17 | -------------------------------------------------------------------------------- /man/fmt_sprintf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fmt_factory.R 3 | \name{fmt_sprintf} 4 | \alias{fmt_sprintf} 5 | \title{Rounding with the \code{sprintf()} function in the \code{fmt} argument} 6 | \usage{ 7 | fmt_sprintf(fmt) 8 | } 9 | \arguments{ 10 | \item{fmt}{A string to control \code{sprintf()}, such as \code{"\%.3f"} to keep 3 decimal digits. See \code{?sprintf}} 11 | } 12 | \description{ 13 | Rounding with the \code{sprintf()} function in the \code{fmt} argument 14 | } 15 | -------------------------------------------------------------------------------- /man/fmt_statistic.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fmt_factory.R 3 | \name{fmt_statistic} 4 | \alias{fmt_statistic} 5 | \title{Rounding with decimal digits on a per-statistic basis in the \code{fmt} argument for \code{modelsummary()}} 6 | \usage{ 7 | fmt_statistic(..., default = 3) 8 | } 9 | \arguments{ 10 | \item{...}{Statistic names and \code{fmt} value} 11 | 12 | \item{default}{Number of decimal digits to keep for unspecified terms} 13 | } 14 | \description{ 15 | Rounding with decimal digits on a per-statistic basis in the \code{fmt} argument for \code{modelsummary()} 16 | } 17 | -------------------------------------------------------------------------------- /man/fmt_term.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fmt_factory.R 3 | \name{fmt_term} 4 | \alias{fmt_term} 5 | \title{Rounding with decimal digits on a per-term basis in the \code{fmt} argument for \code{modelsummary()}} 6 | \usage{ 7 | fmt_term(..., default = 3) 8 | } 9 | \arguments{ 10 | \item{...}{Term names and \code{fmt} value} 11 | 12 | \item{default}{Number of decimal digits to keep for unspecified terms} 13 | } 14 | \description{ 15 | Rounding with decimal digits on a per-term basis in the \code{fmt} argument for \code{modelsummary()} 16 | } 17 | -------------------------------------------------------------------------------- /man/get_gof_broom.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_gof.R 3 | \name{get_gof_broom} 4 | \alias{get_gof_broom} 5 | \title{Extract goodness-of-fit statistics from a single model using the 6 | \code{broom} package or another package with package which supplies a 7 | method for the \code{generics::glance} generic.} 8 | \usage{ 9 | get_gof_broom(model, ...) 10 | } 11 | \description{ 12 | Extract goodness-of-fit statistics from a single model using the 13 | \code{broom} package or another package with package which supplies a 14 | method for the \code{generics::glance} generic. 15 | } 16 | \keyword{internal} 17 | -------------------------------------------------------------------------------- /man/get_gof_parameters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_gof.R 3 | \name{get_gof_parameters} 4 | \alias{get_gof_parameters} 5 | \title{Extract goodness-of-fit statistics from a single model using 6 | the \code{performance} package} 7 | \usage{ 8 | get_gof_parameters(model, ...) 9 | } 10 | \description{ 11 | Extract goodness-of-fit statistics from a single model using 12 | the \code{performance} package 13 | } 14 | \keyword{internal} 15 | -------------------------------------------------------------------------------- /man/glance_custom.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/glance_custom.R 3 | \name{glance_custom} 4 | \alias{glance_custom} 5 | \title{Extract custom information from a model object and turn it into a tidy 6 | data.frame or tibble with a single row.} 7 | \usage{ 8 | glance_custom(x, ...) 9 | } 10 | \arguments{ 11 | \item{x}{model or other R object to convert to single-row data frame} 12 | 13 | \item{...}{ellipsis} 14 | } 15 | \description{ 16 | To customize the output of a model of class \code{lm}, you can define a new 17 | method called \code{glance_custom.lm} which returns a one-row data.frame. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/glance_custom_internal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/glance_custom.R 3 | \name{glance_custom_internal} 4 | \alias{glance_custom_internal} 5 | \title{Avoid namespace conflict when we want to customize glance internally and 6 | still allow users to do the same with their own functions} 7 | \usage{ 8 | glance_custom_internal(x, ...) 9 | } 10 | \description{ 11 | Avoid namespace conflict when we want to customize glance internally and 12 | still allow users to do the same with their own functions 13 | } 14 | \keyword{internal} 15 | -------------------------------------------------------------------------------- /man/glance_custom_internal.default.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/glance_custom.R 3 | \name{glance_custom_internal.default} 4 | \alias{glance_custom_internal.default} 5 | \title{Avoid namespace conflict when we want to customize glance internally and 6 | still allow users to do the same with their own functions} 7 | \usage{ 8 | \method{glance_custom_internal}{default}(x, ...) 9 | } 10 | \description{ 11 | Avoid namespace conflict when we want to customize glance internally and 12 | still allow users to do the same with their own functions 13 | } 14 | \keyword{internal} 15 | -------------------------------------------------------------------------------- /man/glance_custom_internal.lm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/methods_stats.R 3 | \name{glance_custom_internal.lm} 4 | \alias{glance_custom_internal.lm} 5 | \title{Avoid namespace conflict when we want to customize glance internally and 6 | still allow users to do the same with their own functions} 7 | \usage{ 8 | \method{glance_custom_internal}{lm}(x, vcov_type = NULL, gof = NULL, ...) 9 | } 10 | \description{ 11 | Avoid namespace conflict when we want to customize glance internally and 12 | still allow users to do the same with their own functions 13 | } 14 | \keyword{internal} 15 | -------------------------------------------------------------------------------- /man/gof_map.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gof_map.R 3 | \docType{data} 4 | \name{gof_map} 5 | \alias{gof_map} 6 | \title{Data.frame used to clean up and format goodness-of-fit statistics} 7 | \format{ 8 | data.frame with 4 columns of character data: raw, clean, fmt, omit 9 | } 10 | \usage{ 11 | gof_map 12 | } 13 | \description{ 14 | By default, this data frame is passed to the 'gof_map' argument of the 15 | 'modelsummary' function. Users can modify this data frame to 16 | customize the list of statistics to display and their format. See example 17 | below. 18 | } 19 | \examples{ 20 | if (identical(Sys.getenv("pkgdown"), "true")) { 21 | 22 | library(modelsummary) 23 | mod <- lm(wt ~ drat, data = mtcars) 24 | gm <- modelsummary::gof_map 25 | gm$omit[gm$raw == 'deviance'] <- FALSE 26 | gm$fmt[gm$raw == 'r.squared'] <- "\%.5f" 27 | modelsummary(mod, gof_map = gm) 28 | } 29 | 30 | } 31 | \keyword{datasets} 32 | -------------------------------------------------------------------------------- /man/hush.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/hush.R 3 | \name{hush} 4 | \alias{hush} 5 | \title{Execute code silently} 6 | \usage{ 7 | hush(code) 8 | } 9 | \description{ 10 | Execute code silently 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/labelSubset.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{labelSubset} 4 | \alias{labelSubset} 5 | \title{Add a label to a logical vector.} 6 | \usage{ 7 | labelSubset(subset, label) 8 | } 9 | \description{ 10 | Add a label to a logical vector. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/map_estimates.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_estimates.R 3 | \name{map_estimates} 4 | \alias{map_estimates} 5 | \title{rename and reorder estimates from a \emph{single} model 6 | (before merging to collapse)} 7 | \usage{ 8 | map_estimates(estimates, coef_rename, coef_map, coef_omit, group_map) 9 | } 10 | \description{ 11 | rename and reorder estimates from a \emph{single} model 12 | (before merging to collapse) 13 | } 14 | \keyword{internal} 15 | -------------------------------------------------------------------------------- /man/map_gof.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/map_gof.R 3 | \name{map_gof} 4 | \alias{map_gof} 5 | \title{Internal function to subset, rename and re-order gof statistics} 6 | \usage{ 7 | map_gof(gof, gof_omit, gof_map) 8 | } 9 | \description{ 10 | Internal function to subset, rename and re-order gof statistics 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/reexports.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \docType{import} 4 | \name{reexports} 5 | \alias{reexports} 6 | \alias{tidy} 7 | \alias{glance} 8 | \title{tidy generic} 9 | \keyword{internal} 10 | \description{ 11 | These objects are imported from other packages. Follow the links 12 | below to see their documentation. 13 | 14 | \describe{ 15 | \item{generics}{\code{\link[generics]{glance}}, \code{\link[generics]{tidy}}} 16 | }} 17 | 18 | -------------------------------------------------------------------------------- /man/rowLabels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reexport.R 3 | \name{rowLabels} 4 | \alias{rowLabels} 5 | \title{Retrieve or modify the row or column labels.} 6 | \usage{ 7 | rowLabels(x) 8 | } 9 | \description{ 10 | Retrieve or modify the row or column labels. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/supported_models.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/supported_models.R 3 | \name{supported_models} 4 | \alias{supported_models} 5 | \title{List of model objects from which \code{modelsummary} can extract estimates and 6 | statistics} 7 | \usage{ 8 | supported_models() 9 | } 10 | \description{ 11 | List of model objects from which \code{modelsummary} can extract estimates and 12 | statistics 13 | } 14 | \keyword{internal} 15 | -------------------------------------------------------------------------------- /man/tidy_custom.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tidy_custom.R 3 | \name{tidy_custom} 4 | \alias{tidy_custom} 5 | \title{Extract custom information from a model object and turn it into a tidy 6 | data.frame or tibble} 7 | \usage{ 8 | tidy_custom(x) 9 | } 10 | \arguments{ 11 | \item{x}{An object to be converted into a tidy data.frame or tibble.} 12 | } 13 | \value{ 14 | A data.frame or tibble with information about model components. 15 | } 16 | \description{ 17 | To customize the output of a model of class \code{lm}, you can define a method 18 | called \code{tidy_custom.lm} which returns a data.frame with a column called 19 | "term", and the other columns you want to use as "estimate" or "statistic" 20 | in your \code{modelsummary()} call. The output of this method must be similar to 21 | the result of \code{tidy(model)}. 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/tidy_custom_internal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tidy_custom.R 3 | \name{tidy_custom_internal} 4 | \alias{tidy_custom_internal} 5 | \title{Avoid namespace conflict when we want to customize glance internally and 6 | still allow users to do the same with their own functions} 7 | \usage{ 8 | tidy_custom_internal(x, ...) 9 | } 10 | \description{ 11 | Avoid namespace conflict when we want to customize glance internally and 12 | still allow users to do the same with their own functions 13 | } 14 | \keyword{internal} 15 | -------------------------------------------------------------------------------- /man/tidy_custom_internal.default.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tidy_custom.R 3 | \name{tidy_custom_internal.default} 4 | \alias{tidy_custom_internal.default} 5 | \title{Avoid namespace conflict when we want to customize glance internally and 6 | still allow users to do the same with their own functions} 7 | \usage{ 8 | \method{tidy_custom_internal}{default}(x, ...) 9 | } 10 | \description{ 11 | Avoid namespace conflict when we want to customize glance internally and 12 | still allow users to do the same with their own functions 13 | } 14 | \keyword{internal} 15 | -------------------------------------------------------------------------------- /man/update_modelsummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/update_modelsummary.R 3 | \name{update_modelsummary} 4 | \alias{update_modelsummary} 5 | \title{Update \code{modelsummary} and its dependencies} 6 | \usage{ 7 | update_modelsummary(source = "development") 8 | } 9 | \arguments{ 10 | \item{source}{one of two strings: "development" or "cran"} 11 | } 12 | \description{ 13 | Update \code{modelsummary} and its dependencies to the latest R-Universe or CRAN versions. The R session needs to be restarted after install. 14 | } 15 | -------------------------------------------------------------------------------- /tests/figs/deps.txt: -------------------------------------------------------------------------------- 1 | - vdiffr-svg-engine: 1.0 2 | - vdiffr: 0.3.3 3 | - freetypeharfbuzz: 0.2.5 4 | -------------------------------------------------------------------------------- /tests/spelling.R: -------------------------------------------------------------------------------- 1 | # if(requireNamespace('spelling', quietly = TRUE)) 2 | # spelling::spell_check_test(vignettes = TRUE, error = FALSE, 3 | # skip_on_cran = TRUE) 4 | -------------------------------------------------------------------------------- /tests/tinytest.R: -------------------------------------------------------------------------------- 1 | 2 | if (isTRUE(Sys.getenv("R_NOT_CRAN") == "true")) { 3 | if (requireNamespace("tinytest", quietly = TRUE)) { 4 | tinytest::test_package("modelsummary") 5 | } 6 | } --------------------------------------------------------------------------------