├── .Rbuildignore ├── .gitattributes ├── .github ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── FUNDING.yml ├── SUPPORT.md ├── dependabot.yaml └── workflows │ ├── R-CMD-check-hard.yaml │ ├── R-CMD-check.yaml │ ├── check-all-examples.yaml │ ├── check-link-rot.yaml │ ├── check-random-test-order.yaml │ ├── check-readme.yaml │ ├── check-spelling.yaml │ ├── check-styling.yaml │ ├── check-test-warnings.yaml │ ├── check-vignette-warnings.yaml │ ├── html-5-check.yaml │ ├── lint-changed-files.yaml │ ├── lint.yaml │ ├── pkgdown-no-suggests.yaml │ ├── pkgdown.yaml │ ├── test-coverage-examples.yaml │ ├── test-coverage.yaml │ └── update-to-latest-easystats.yaml ├── .gitignore ├── .lintr ├── DESCRIPTION ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R ├── coord_radar.R ├── data_plot.R ├── geom_binomdensity.R ├── geom_from_list.R ├── geom_point2.R ├── geom_poolpoint.R ├── geom_violindot.R ├── geom_violinhalf.R ├── golden_ratio.R ├── plot.bayesfactor_models.R ├── plot.bayesfactor_parameters.R ├── plot.binned_residuals.R ├── plot.check_collinearity.R ├── plot.check_dag.R ├── plot.check_distribution.R ├── plot.check_heteroscedasticity.R ├── plot.check_homogeneity.R ├── plot.check_model.R ├── plot.check_normality.R ├── plot.check_outliers.R ├── plot.check_outliers_new.R ├── plot.check_overdisp.R ├── plot.check_predictions.R ├── plot.compare_parameters.R ├── plot.compare_performance.R ├── plot.describe_distribution.R ├── plot.dw_data_tabulate.R ├── plot.effectsize_table.R ├── plot.equivalence_test.R ├── plot.estimate_contrasts.R ├── plot.estimate_density.R ├── plot.hdi.R ├── plot.n_factors.R ├── plot.p_direction.R ├── plot.p_function.R ├── plot.p_significance.R ├── plot.parameters_brms_meta.R ├── plot.parameters_model.R ├── plot.parameters_pca.R ├── plot.parameters_sem.R ├── plot.parameters_simulate.R ├── plot.performance_roc.R ├── plot.performance_simres.R ├── plot.point_estimates.R ├── plot.rope.R ├── plot.si.R ├── plot.visualisation_recipe.R ├── plots.R ├── print.check_model.R ├── print.data_plot.R ├── reshape_to_long.R ├── scale_color_bluebrown.R ├── scale_color_colorhex.R ├── scale_color_flat.R ├── scale_color_material.R ├── scale_color_metro.R ├── scale_color_okabeito.R ├── scale_color_pizza.R ├── scale_color_see.R ├── scale_color_social.R ├── see-package.R ├── theme_abyss.R ├── theme_azurelight.R ├── theme_blackboard.R ├── theme_lucid.R ├── theme_modern.R ├── theme_radar.R ├── utils.R └── utils_add_prior_layer.R ├── README.Rmd ├── README.md ├── WIP └── how_to_plot.R ├── air.toml ├── apa.csl ├── cran-comments.md ├── inst ├── CITATION └── WORDLIST ├── man ├── add_plot_attributes.Rd ├── bluebrown_colors.Rd ├── coord_radar.Rd ├── data_plot.Rd ├── figures │ ├── bayestestR-1.png │ ├── correlation-1.png │ ├── effectsize-1.png │ ├── logo.png │ ├── modelbased1-1.png │ ├── modelbased2-1.png │ ├── parameters1-1.png │ ├── parameters2-1.png │ ├── performance-1.png │ ├── unnamed-chunk-10-1.png │ ├── unnamed-chunk-11-1.png │ ├── unnamed-chunk-12-1.png │ ├── unnamed-chunk-13-1.png │ ├── unnamed-chunk-2-1.png │ ├── unnamed-chunk-4-1.png │ ├── unnamed-chunk-5-1.png │ ├── unnamed-chunk-6-1.png │ ├── unnamed-chunk-7-1.png │ └── unnamed-chunk-9-1.png ├── flat_colors.Rd ├── geom_binomdensity.Rd ├── geom_from_list.Rd ├── geom_point2.Rd ├── geom_poolpoint.Rd ├── geom_violindot.Rd ├── geom_violinhalf.Rd ├── ggplot2-ggproto.Rd ├── golden_ratio.Rd ├── material_colors.Rd ├── metro_colors.Rd ├── okabeito_colors.Rd ├── palette_bluebrown.Rd ├── palette_colorhex.Rd ├── palette_flat.Rd ├── palette_material.Rd ├── palette_metro.Rd ├── palette_okabeito.Rd ├── palette_pizza.Rd ├── palette_see.Rd ├── palette_social.Rd ├── pizza_colors.Rd ├── plot.datawizard_table.Rd ├── plot.see_bayesfactor_models.Rd ├── plot.see_bayesfactor_parameters.Rd ├── plot.see_check_collinearity.Rd ├── plot.see_check_dag.Rd ├── plot.see_check_distribution.Rd ├── plot.see_check_heteroscedasticity.Rd ├── plot.see_check_homogeneity.Rd ├── plot.see_check_model.Rd ├── plot.see_check_normality.Rd ├── plot.see_check_outliers.Rd ├── plot.see_compare_parameters.Rd ├── plot.see_compare_performance.Rd ├── plot.see_effectsize_table.Rd ├── plot.see_equivalence_test.Rd ├── plot.see_estimate_contrasts.Rd ├── plot.see_estimate_density.Rd ├── plot.see_hdi.Rd ├── plot.see_n_factors.Rd ├── plot.see_p_direction.Rd ├── plot.see_p_function.Rd ├── plot.see_p_significance.Rd ├── plot.see_parameters_brms_meta.Rd ├── plot.see_parameters_distribution.Rd ├── plot.see_parameters_model.Rd ├── plot.see_parameters_pca.Rd ├── plot.see_parameters_simulate.Rd ├── plot.see_performance_roc.Rd ├── plot.see_performance_simres.Rd ├── plot.see_point_estimate.Rd ├── plot.see_rope.Rd ├── plot.see_si.Rd ├── plots.Rd ├── print.see_performance_pp_check.Rd ├── scale_color_bluebrown.Rd ├── scale_color_colorhex.Rd ├── scale_color_flat.Rd ├── scale_color_material.Rd ├── scale_color_metro.Rd ├── scale_color_okabeito.Rd ├── scale_color_pizza.Rd ├── scale_color_see.Rd ├── scale_color_social.Rd ├── see-package.Rd ├── see_colors.Rd ├── social_colors.Rd ├── theme_abyss.Rd ├── theme_azurelight.Rd ├── theme_blackboard.Rd ├── theme_lucid.Rd ├── theme_modern.Rd └── theme_radar.Rd ├── paper ├── apa.csl ├── paper.Rmd ├── paper.bib ├── paper.log ├── paper.md ├── paper.pdf └── paper_files │ └── figure-latex │ ├── bayestestR-1.pdf │ ├── correlation-1.pdf │ ├── effectsize-1.pdf │ ├── modelbased1-1.pdf │ ├── modelbased2-1.pdf │ ├── parameters1-1.pdf │ ├── parameters2-1.pdf │ └── performance-1.pdf ├── pkgdown ├── _pkgdown.yml └── favicon │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-152x152.png │ ├── apple-touch-icon-180x180.png │ ├── apple-touch-icon-60x60.png │ ├── apple-touch-icon-76x76.png │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ └── favicon.ico ├── revdep ├── README.md ├── check.R ├── cran.md ├── failures.md └── problems.md ├── see.Rproj ├── see.code-workspace ├── tests ├── testthat.R └── testthat │ ├── _snaps │ ├── plot.check_collinearity │ │ └── plot-check-collinearity.svg │ ├── plot.check_dag │ │ ├── plot-check-dag-all-adjusted.svg │ │ ├── plot-check-dag-all.svg │ │ ├── plot-check-dag-current-adjusted.svg │ │ ├── plot-check-dag-current.svg │ │ ├── plot-check-dag-direct1.svg │ │ ├── plot-check-dag-direct2.svg │ │ ├── plot-check-dag-direct3.svg │ │ ├── plot-check-dag-direct4.svg │ │ ├── plot-check-dag-multiple-adjustments.svg │ │ ├── plot-check-dag-required-adjusted.svg │ │ ├── plot-check-dag-required.svg │ │ ├── plot-check-dag-total1.svg │ │ ├── plot-check-dag-total2.svg │ │ ├── plot-check-dag-total3.svg │ │ └── plot-check-dag-total4.svg │ ├── plot.check_normality │ │ ├── check-normality-works-lm-density.svg │ │ ├── check-normality-works-lm-pp.svg │ │ ├── check-normality-works-lm-qq.svg │ │ ├── check-normality-works-lmer-fixed.svg │ │ └── check-normality-works-lmer-random.svg │ ├── plot.compare_parameters │ │ └── plot-compare-parameters-works.svg │ ├── plot.effectsize_table │ │ └── aov-eta-squared-dot-plot.svg │ ├── plot.estimate_density │ │ └── plot-estimate-density-with-piors.svg │ ├── plot.n_factors │ │ ├── area-graph.svg │ │ ├── bar-graph.svg │ │ └── line-graph.svg │ ├── plot.p_direction │ │ ├── plot-p-dir-frequ1.svg │ │ ├── plot-p-dir-frequ2.svg │ │ └── plot-p-dir-glmmtmb.svg │ ├── plot.p_significance │ │ ├── plot-p-sig-frequ1.svg │ │ ├── plot-p-sig-frequ2.svg │ │ ├── plot-p-sig-frequ3.svg │ │ ├── plot-p-sig-glmmtmb.svg │ │ ├── plot-p-sig-simple-threshold.svg │ │ └── plot-p-sig-threshold-2.svg │ ├── plot.parameters_model │ │ ├── plot-model-parameters-1.svg │ │ ├── plot-model-parameters-doublerandom.svg │ │ ├── plot-model-parameters-gam.svg │ │ ├── plot-model-parameters-no-dir.svg │ │ ├── plot-model-parameters-random-0.svg │ │ ├── plot-model-parameters-random-1.svg │ │ ├── plot-model-parameters-random-2.svg │ │ ├── plot-model-parameters-random-3.svg │ │ ├── plot-model-parameters-random-4.svg │ │ ├── plot-model-parameters-random-5.svg │ │ └── plot-model-parameters-random-6.svg │ ├── plot.performance_pp_check │ │ └── pp-check-lm.svg │ ├── plot.performance_roc │ │ └── plot-see-performance-roc-works.svg │ ├── scale_color_colorhex_c │ │ ├── scale-fill-colorhex-c-works.svg │ │ └── scale-fill-colorhex-d-works.svg │ ├── vdiffr_bayestestr_plots │ │ ├── plot-see-bayesfactor-models-works-1.svg │ │ └── plot-see-bayesfactor-models-works-2.svg │ ├── vdiffr_geoms_coords │ │ ├── coord-radar-works.svg │ │ ├── geom-point2-works.svg │ │ ├── geom-poolpoint-works-1.svg │ │ ├── geom-poolpoint-works-2.svg │ │ ├── geom-violindot-works.svg │ │ └── geom-violinhalf-works.svg │ ├── vdiffr_scale_color │ │ ├── scale-color-bluebrown-d-works.svg │ │ ├── scale-color-flat-c-works.svg │ │ ├── scale-color-pizza-c-works.svg │ │ ├── scale-color-pizza-d-works.svg │ │ ├── scale-color-social-default-gradient-works.svg │ │ ├── scale-color-social-works.svg │ │ ├── scale-fill-flat-d-works.svg │ │ ├── scale-fill-material-c-works.svg │ │ ├── scale-fill-material-d-works.svg │ │ ├── scale-fill-metro-c-works.svg │ │ ├── scale-fill-metro-d-works.svg │ │ ├── scale-fill-see-c-works.svg │ │ └── scale-fill-see-d-works.svg │ └── vdiffr_themes │ │ ├── theme-abyss-works.svg │ │ ├── theme-azurelight-works.svg │ │ ├── theme-blackboard-works-with-base-size.svg │ │ ├── theme-blackboard-works.svg │ │ ├── theme-lucid-works-with-base-size.svg │ │ ├── theme-lucid-works.svg │ │ ├── theme-modern-with-ticks-works.svg │ │ ├── theme-modern-works-with-base-size.svg │ │ ├── theme-modern-works.svg │ │ └── theme-radar-works.svg │ ├── helper.R │ ├── test-check_model.R │ ├── test-golden_ratio.R │ ├── test-plot.check_collinearity.R │ ├── test-plot.check_dag.R │ ├── test-plot.check_distribution.R │ ├── test-plot.check_heteroscedasticity.R │ ├── test-plot.check_homogeneity.R │ ├── test-plot.check_normality.R │ ├── test-plot.check_outliers.R │ ├── test-plot.cluster_analysis.R │ ├── test-plot.compare_parameters.R │ ├── test-plot.compare_performance.R │ ├── test-plot.describe_distribution.R │ ├── test-plot.dw_data_tabulate.R │ ├── test-plot.easycormatrix.R │ ├── test-plot.effectsize_table.R │ ├── test-plot.equivalence_test.R │ ├── test-plot.estimate_contrasts.R │ ├── test-plot.estimate_density.R │ ├── test-plot.hdi.R │ ├── test-plot.n_factors.R │ ├── test-plot.p_direction.R │ ├── test-plot.p_significance.R │ ├── test-plot.parameters_model.R │ ├── test-plot.parameters_pca.R │ ├── test-plot.parameters_simulate.R │ ├── test-plot.performance_pp_check.R │ ├── test-plot.performance_roc.R │ ├── test-plot.point_estimates.R │ ├── test-plot.rope.R │ ├── test-plot.si.R │ ├── test-plot.simulate_parameters.R │ ├── test-plots.R │ ├── test-scale_color_colorhex_c.R │ ├── test-scale_color_values.R │ ├── test-vdiffr_bayestestr_plots.R │ ├── test-vdiffr_geoms_coords.R │ ├── test-vdiffr_scale_color.R │ └── test-vdiffr_themes.R └── vignettes ├── .gitignore ├── bayestestR.Rmd ├── correlation.Rmd ├── datawizard.Rmd ├── effectsize.Rmd ├── modelbased.Rmd ├── parameters.Rmd ├── performance.Rmd ├── seecolorscales.Rmd └── seecolorscales_dark.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^\.Rprofile$ 2 | ^.*\.Rproj$ 3 | ^\.Rproj\.user$ 4 | ^\.travis.yml 5 | ^\_pkgdown.yml 6 | ^\_pkgdown.yaml 7 | 8 | ^logo.png 9 | ^README.Rmd 10 | ^README.md 11 | 12 | ^Rplots.pdf$ 13 | ^data/. 14 | ^docs/. 15 | ^pkgdown/. 16 | ^paper.*$ 17 | ^apa.*$ 18 | ^man/figures/. 19 | ^tests/testthat/_snaps/. 20 | ^revdep$ 21 | ^vignettes$ 22 | ^.github$ 23 | ^WIP$ 24 | ^\.github$ 25 | \.code-workspace$ 26 | \.lintr$ 27 | 28 | ^cran-comments\.md$ 29 | ^revdep$ 30 | ^CRAN-SUBMISSION$ 31 | ^LICENSE\.md$ 32 | ^air.toml 33 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Basic .gitattributes for a R repo. 2 | 3 | # Source files 4 | # ============================= 5 | *.Rdata binary 6 | *.RData binary 7 | *.rda binary 8 | *.rdb binary 9 | *.rds binary 10 | *.Rd text 11 | *.Rdx binary 12 | *.Rmd text 13 | *.R text eol=crlf 14 | *.Rproj text 15 | *.[Rr]md linguist-detectable 16 | 17 | # Documentation files 18 | # ============================= 19 | docs/* linguist-documentation 20 | man/* linguist-documentation 21 | misc/* linguist-documentation 22 | pkgdown/* linguist-documentation 23 | *.html linguist-documentation 24 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to see 2 | 3 | This outlines how to propose a change to **see**. 4 | 5 | ## Fixing typos 6 | 7 | Small typos or grammatical errors in documentation may be edited directly using the GitHub web interface, so long as the changes are made in the _source_ file. If you want to fix typos in the documentation, please edit the related `.R` file in the `R/` folder. Do _not_ edit an `.Rd` file in `man/`. 8 | 9 | ## Filing an issue 10 | 11 | The easiest way to propose a change or new feature is to file an issue. If you've found a 12 | bug, you may also create an associated issue. If possible, try to illustrate your proposal or the bug with a minimal [reproducible example](https://www.tidyverse.org/help/#reprex). 13 | 14 | ## Pull requests 15 | 16 | * Please create a Git branch for each pull request (PR). 17 | * Your contributed code should roughly follow the [R style guide](http://style.tidyverse.org), but in particular our [**easystats convention of code-style**](https://github.com/easystats/easystats#convention-of-code-style). 18 | * see uses [roxygen2](https://cran.r-project.org/package=roxygen2), with 19 | [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), 20 | for documentation. 21 | * see uses [testthat](https://cran.r-project.org/package=testthat). Adding tests to the PR makes it easier for me to merge your PR into the code base. 22 | * If your PR is a user-visible change, you may add a bullet to the top of `NEWS.md` describing the changes made. You may optionally add your GitHub username, and links to relevant issue(s)/PR(s). 23 | 24 | ## Code of Conduct 25 | 26 | Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to 27 | abide by its terms. 28 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: easystats 4 | -------------------------------------------------------------------------------- /.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Getting help with `{see}` 2 | 3 | Thanks for using `{see}`. Before filing an issue, there are a few places 4 | to explore and pieces to put together to make the process as smooth as possible. 5 | 6 | Start by making a minimal **repr**oducible **ex**ample using the 7 | [reprex](http://reprex.tidyverse.org/) package. If you haven't heard of or used 8 | reprex before, you're in for a treat! Seriously, reprex will make all of your 9 | R-question-asking endeavors easier (which is a pretty insane ROI for the five to 10 | ten minutes it'll take you to learn what it's all about). For additional reprex 11 | pointers, check out the [Get help!](https://www.tidyverse.org/help/) resource 12 | used by the tidyverse team. 13 | 14 | Armed with your reprex, the next step is to figure out where to ask: 15 | 16 | * If it's a question: start with StackOverflow. There are more people there to answer questions. 17 | * If it's a bug: you're in the right place, file an issue. 18 | * If you're not sure: let the community help you figure it out! If your 19 | problem _is_ a bug or a feature request, you can easily return here and 20 | report it. 21 | 22 | Before opening a new issue, be sure to [search issues and pull requests](https://github.com/easystats/see/issues) to make sure the 23 | bug hasn't been reported and/or already fixed in the development version. By 24 | default, the search will be pre-populated with `is:issue is:open`. You can 25 | [edit the qualifiers](https://help.github.com/articles/searching-issues-and-pull-requests/) 26 | (e.g. `is:pr`, `is:closed`) as needed. For example, you'd simply 27 | remove `is:open` to search _all_ issues in the repo, open or closed. 28 | 29 | Thanks for your help! 30 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | updates: 4 | # Keep dependencies for GitHub Actions up-to-date 5 | - package-ecosystem: "github-actions" 6 | directory: "/" 7 | schedule: 8 | interval: "weekly" 9 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check-hard.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | # 4 | # NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends, 5 | # Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never 6 | # installed, with the exception of testthat, knitr, and rmarkdown. The cache is 7 | # never used to avoid accidentally restoring a cache containing a suggested 8 | # dependency. 9 | on: 10 | push: 11 | branches: [main, master] 12 | pull_request: 13 | branches: [main, master] 14 | 15 | name: R-CMD-check-hard 16 | 17 | jobs: 18 | R-CMD-check-hard: 19 | uses: easystats/workflows/.github/workflows/R-CMD-check-hard.yaml@main 20 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | uses: easystats/workflows/.github/workflows/R-CMD-check.yaml@main 14 | -------------------------------------------------------------------------------- /.github/workflows/check-all-examples.yaml: -------------------------------------------------------------------------------- 1 | # Make sure all examples run successfully, even the ones that are not supposed 2 | # to be run or tested on CRAN machines by default. 3 | # 4 | # The examples that fail should use 5 | # - `if (FALSE) { ... }` (if example is included only for illustrative purposes) 6 | # - `try({ ... })` (if the intent is to show the error) 7 | # 8 | # This workflow helps find such failing examples that need to be modified. 9 | on: 10 | push: 11 | branches: [main, master] 12 | pull_request: 13 | branches: [main, master] 14 | 15 | name: check-all-examples 16 | 17 | jobs: 18 | check-all-examples: 19 | uses: easystats/workflows/.github/workflows/check-all-examples.yaml@main 20 | -------------------------------------------------------------------------------- /.github/workflows/check-link-rot.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [main, master] 4 | pull_request: 5 | branches: [main, master] 6 | 7 | name: check-link-rot 8 | 9 | jobs: 10 | check-link-rot: 11 | uses: easystats/workflows/.github/workflows/check-link-rot.yaml@main 12 | -------------------------------------------------------------------------------- /.github/workflows/check-random-test-order.yaml: -------------------------------------------------------------------------------- 1 | # Run tests in random order 2 | on: 3 | push: 4 | branches: [main, master] 5 | pull_request: 6 | branches: [main, master] 7 | 8 | name: check-random-test-order 9 | 10 | jobs: 11 | check-random-test-order: 12 | uses: easystats/workflows/.github/workflows/check-random-test-order.yaml@main 13 | -------------------------------------------------------------------------------- /.github/workflows/check-readme.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | 4 | on: 5 | push: 6 | branches: [main, master] 7 | pull_request: 8 | branches: [main, master] 9 | 10 | name: check-readme 11 | 12 | jobs: 13 | check-readme: 14 | uses: easystats/workflows/.github/workflows/check-readme.yaml@main 15 | -------------------------------------------------------------------------------- /.github/workflows/check-spelling.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [main, master] 4 | pull_request: 5 | branches: [main, master] 6 | 7 | name: check-spelling 8 | 9 | jobs: 10 | check-spelling: 11 | uses: easystats/workflows/.github/workflows/check-spelling.yaml@main 12 | -------------------------------------------------------------------------------- /.github/workflows/check-styling.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [main, master] 4 | pull_request: 5 | branches: [main, master] 6 | 7 | name: check-styling 8 | 9 | jobs: 10 | check-styling: 11 | uses: easystats/workflows/.github/workflows/check-styling.yaml@main 12 | -------------------------------------------------------------------------------- /.github/workflows/check-test-warnings.yaml: -------------------------------------------------------------------------------- 1 | # Running tests with options(warn = 2) to fail on test warnings 2 | on: 3 | push: 4 | branches: [main, master] 5 | pull_request: 6 | branches: [main, master] 7 | 8 | name: check-test-warnings 9 | 10 | jobs: 11 | check-test-warnings: 12 | uses: easystats/workflows/.github/workflows/check-test-warnings.yaml@main 13 | -------------------------------------------------------------------------------- /.github/workflows/check-vignette-warnings.yaml: -------------------------------------------------------------------------------- 1 | # Running tests with options(warn = 2) to fail on test warnings 2 | on: 3 | push: 4 | branches: [main, master] 5 | pull_request: 6 | branches: [main, master] 7 | 8 | name: check-vignette-warnings 9 | 10 | jobs: 11 | check-vignette-warnings: 12 | uses: easystats/workflows/.github/workflows/check-vignette-warnings.yaml@main 13 | -------------------------------------------------------------------------------- /.github/workflows/html-5-check.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: html-5-check 10 | 11 | jobs: 12 | html-5-check: 13 | uses: easystats/workflows/.github/workflows/html-5-check.yaml@main 14 | -------------------------------------------------------------------------------- /.github/workflows/lint-changed-files.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | pull_request: 5 | branches: [main, master] 6 | 7 | name: lint-changed-files 8 | 9 | jobs: 10 | lint-changed-files: 11 | uses: easystats/workflows/.github/workflows/lint-changed-files.yaml@main 12 | -------------------------------------------------------------------------------- /.github/workflows/lint.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: lint 10 | 11 | jobs: 12 | lint: 13 | uses: easystats/workflows/.github/workflows/lint.yaml@main 14 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown-no-suggests.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [main, master] 4 | pull_request: 5 | branches: [main, master] 6 | 7 | name: pkgdown-no-suggests 8 | 9 | jobs: 10 | pkgdown-no-suggests: 11 | uses: easystats/workflows/.github/workflows/pkgdown-no-suggests.yaml@main 12 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown 13 | 14 | jobs: 15 | pkgdown: 16 | uses: easystats/workflows/.github/workflows/pkgdown.yaml@main 17 | -------------------------------------------------------------------------------- /.github/workflows/test-coverage-examples.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: test-coverage-examples 10 | 11 | jobs: 12 | test-coverage-examples: 13 | uses: easystats/workflows/.github/workflows/test-coverage-examples.yaml@main 14 | -------------------------------------------------------------------------------- /.github/workflows/test-coverage.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: test-coverage 10 | 11 | jobs: 12 | test-coverage: 13 | uses: easystats/workflows/.github/workflows/test-coverage.yaml@main 14 | -------------------------------------------------------------------------------- /.github/workflows/update-to-latest-easystats.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | schedule: 3 | # Check for dependency updates once a month 4 | - cron: "0 0 1 * *" 5 | 6 | name: update-to-latest-easystats 7 | 8 | jobs: 9 | update-to-latest-easystats: 10 | uses: easystats/workflows/.github/workflows/update-to-latest-easystats.yaml@main 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # History files 2 | .Rhistory 3 | .Rapp.history 4 | 5 | # Session Data files 6 | .RData 7 | 8 | # Example code in package build process 9 | *-Ex.R 10 | 11 | # Output files from R CMD build 12 | /*.tar.gz 13 | 14 | # Output files from R CMD check 15 | /*.Rcheck/ 16 | 17 | # RStudio files 18 | .Rproj.user/ 19 | 20 | # produced vignettes 21 | vignettes/*.html 22 | vignettes/*.pdf 23 | 24 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 25 | .httr-oauth 26 | 27 | # knitr and R markdown default cache directories 28 | /*_cache/ 29 | /cache/ 30 | 31 | # Temporary files created by R markdown 32 | *.utf8.md 33 | *.knit.md 34 | 35 | # Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html 36 | rsconnect/ 37 | 38 | ========================= 39 | # Operating System Files 40 | # OSX 41 | .DS_Store 42 | .AppleDouble 43 | .LSOverride 44 | 45 | # Thumbnails 46 | ._* 47 | 48 | # Files that might appear in the root of a volume 49 | .DocumentRevisions-V100 50 | .fseventsd 51 | .Spotlight-V100 52 | .TemporaryItems 53 | .Trashes 54 | .VolumeIcon.icns 55 | 56 | # Directories potentially created on remote AFP share 57 | .AppleDB 58 | .AppleDesktop 59 | Network Trash Folder 60 | Temporary Items 61 | .apdisk 62 | docs 63 | inst/doc 64 | CRAN-SUBMISSION 65 | revdep/library 66 | revdep/checks.noindex 67 | revdep/library.noindex 68 | revdep/data.sqlite 69 | CRAN-SUBMISSION 70 | -------------------------------------------------------------------------------- /.lintr: -------------------------------------------------------------------------------- 1 | linters: linters_with_defaults( 2 | absolute_path_linter = NULL, 3 | commented_code_linter = NULL, 4 | cyclocomp_linter = cyclocomp_linter(25), 5 | implicit_integer_linter = NULL, 6 | line_length_linter(120), 7 | namespace_linter = NULL, 8 | nonportable_path_linter = NULL, 9 | object_name_linter = NULL, 10 | object_length_linter(50), 11 | object_usage_linter = NULL, 12 | todo_comment_linter = NULL, 13 | undesirable_function_linter(c("mapply" = NA, "sapply" = NA, "setwd" = NA)), 14 | undesirable_operator_linter = NULL, 15 | unnecessary_concatenation_linter(allow_single_expression = FALSE), 16 | defaults = linters_with_tags(tags = NULL) 17 | ) 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2023 2 | COPYRIGHT HOLDER: see authors 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2023 see authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /R/coord_radar.R: -------------------------------------------------------------------------------- 1 | #' Radar coordinate system 2 | #' 3 | #' Add a radar coordinate system useful for radar charts. 4 | #' 5 | #' @inheritParams ggplot2::coord_polar 6 | #' @param ... Other arguments to be passed to `ggproto`. 7 | #' 8 | #' @examples 9 | #' library(ggplot2) 10 | #' 11 | #' # Create a radar/spider chart with ggplot: 12 | #' data(iris) 13 | #' data <- aggregate(iris[-5], list(Species = iris$Species), mean) 14 | #' data <- datawizard::data_to_long( 15 | #' data, 16 | #' c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width") 17 | #' ) 18 | #' 19 | #' ggplot(data, aes(x = name, y = value, color = Species, group = Species)) + 20 | #' geom_polygon(fill = NA, linewidth = 2) + 21 | #' coord_radar(start = -pi / 4) 22 | #' @export 23 | coord_radar <- function(theta = "x", start = 0, direction = 1, ...) { 24 | theta <- match.arg(theta, c("x", "y")) 25 | r <- ifelse(theta == "x", "y", "x") 26 | 27 | ggplot2::ggproto( 28 | "CordRadar", 29 | CoordPolar, 30 | theta = theta, 31 | r = r, 32 | start = start, 33 | direction = sign(direction), 34 | is_linear = function(coord) { 35 | TRUE 36 | }, 37 | ... 38 | ) 39 | } 40 | -------------------------------------------------------------------------------- /R/geom_point2.R: -------------------------------------------------------------------------------- 1 | #' Better looking points 2 | #' 3 | #' Somewhat nicer points (especially in case of transparency) without outline 4 | #' strokes (borders, contours) by default. 5 | #' 6 | #' @param size Size of points. 7 | #' @param stroke Stroke thickness. 8 | #' @param shape Shape of points. 9 | #' @param ... Other arguments to be passed to 10 | #' [ggplot2::geom_point()], 11 | #' [ggplot2::geom_jitter()], 12 | #' [ggplot2::geom_pointrange()], or 13 | #' [ggplot2::geom_count()]. 14 | #' 15 | #' @note The color aesthetics for `geom_point_borderless()` is `"fill"`, not 16 | #' `"color"`. See 'Examples'. 17 | #' 18 | #' @examplesIf requireNamespace("patchwork", quietly = TRUE) 19 | #' library(ggplot2) 20 | #' library(see) 21 | #' 22 | #' normal <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + 23 | #' geom_point(size = 8, alpha = 0.3) + 24 | #' theme_modern() 25 | #' 26 | #' new <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + 27 | #' geom_point2(size = 8, alpha = 0.3) + 28 | #' theme_modern() 29 | #' 30 | #' plots(normal, new, n_columns = 2) 31 | #' 32 | #' ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, fill = Species)) + 33 | #' geom_point_borderless(size = 4) + 34 | #' theme_modern() 35 | #' 36 | #' theme_set(theme_abyss()) 37 | #' ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, fill = Species)) + 38 | #' geom_point_borderless(size = 4) 39 | #' @export 40 | geom_point2 <- function(..., stroke = 0, shape = 16) { 41 | geom_point(stroke = stroke, shape = shape, ...) 42 | } 43 | 44 | #' @rdname geom_point2 45 | #' @export 46 | geom_jitter2 <- function(..., size = 2, stroke = 0, shape = 16) { 47 | geom_jitter(size = size, stroke = stroke, shape = shape, ...) 48 | } 49 | 50 | #' @rdname geom_point2 51 | #' @export 52 | geom_pointrange2 <- function(..., stroke = 0) { 53 | geom_pointrange(stroke = stroke, ...) 54 | } 55 | 56 | #' @rdname geom_point2 57 | #' @export 58 | geom_count2 <- function(..., stroke = 0) { 59 | geom_count(stroke = stroke, ...) 60 | } 61 | 62 | #' @rdname geom_point2 63 | #' @export 64 | geom_count_borderless <- geom_count2 65 | 66 | 67 | #' @rdname geom_point2 68 | #' @export 69 | geom_point_borderless <- function(...) { 70 | geom_point(pch = 21, color = .get_theme_bg_color(), ...) 71 | } 72 | 73 | 74 | #' @rdname geom_point2 75 | #' @export 76 | geom_jitter_borderless <- function(...) { 77 | geom_jitter(pch = 21, color = .get_theme_bg_color(), ...) 78 | } 79 | 80 | 81 | #' @rdname geom_point2 82 | #' @export 83 | geom_pointrange_borderless <- function(...) { 84 | geom_pointrange(pch = 21, color = .get_theme_bg_color(), ...) 85 | } 86 | 87 | 88 | .get_theme_bg_color <- function() { 89 | current_theme <- ggplot2::theme_get() 90 | 91 | if (is.null(current_theme$panel.grid.major)) { 92 | current_theme$panel.grid.major <- current_theme$panel.grid 93 | } 94 | 95 | bg_color <- ifelse( 96 | is.null(current_theme$panel.grid.major$colour), 97 | "white", 98 | current_theme$panel.grid.major$colour 99 | ) 100 | 101 | bg_color 102 | } 103 | -------------------------------------------------------------------------------- /R/geom_poolpoint.R: -------------------------------------------------------------------------------- 1 | #' Pool ball points 2 | #' 3 | #' Points labelled with the observation name. 4 | #' 5 | #' @param label Label to add inside the points. 6 | #' @param size_text Size of text. 7 | #' @param size_background Size of the white background circle. 8 | #' @param size_point Size of the ball. 9 | #' @param jitter Width and height of position jitter. 10 | #' @param ... Other arguments to be passed to `geom_point`. 11 | #' 12 | #' @examples 13 | #' library(ggplot2) 14 | #' library(see) 15 | #' 16 | #' ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) + 17 | #' geom_poolpoint(label = rownames(iris)) + 18 | #' scale_color_flat_d() + 19 | #' theme_modern() 20 | #' 21 | #' 22 | #' ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) + 23 | #' geom_pooljitter(label = rownames(iris)) + 24 | #' scale_color_flat_d() + 25 | #' theme_modern() 26 | #' @export 27 | geom_poolpoint <- function( 28 | label, 29 | size_text = 3.88, 30 | size_background = size_text * 2, 31 | size_point = size_text * 3.5, 32 | ... 33 | ) { 34 | list( 35 | geom_point2(size = size_point, ...), 36 | geom_point2(color = "white", size = size_background, ...), 37 | geom_text(label = label, size = size_text, ...) 38 | ) 39 | } 40 | 41 | 42 | #' @rdname geom_poolpoint 43 | #' @export 44 | geom_pooljitter <- function( 45 | label, 46 | size_text = 3.88, 47 | size_background = size_text * 2, 48 | size_point = size_text * 3.5, 49 | jitter = 0.1, 50 | ... 51 | ) { 52 | jitter <- ggplot2::position_jitter(width = jitter, height = jitter) 53 | 54 | list( 55 | geom_point2(size = size_point, position = jitter, ...), 56 | geom_point2( 57 | color = "white", 58 | size = size_background, 59 | position = jitter, 60 | ... 61 | ), 62 | geom_text(label = label, size = size_text, position = jitter, ...) 63 | ) 64 | } 65 | -------------------------------------------------------------------------------- /R/geom_violindot.R: -------------------------------------------------------------------------------- 1 | #' Half-violin Half-dot plot 2 | #' 3 | #' Create a half-violin half-dot plot, useful for visualising the distribution 4 | #' and the sample size at the same time. 5 | #' 6 | #' @inheritParams geom_violinhalf 7 | #' @inheritParams ggplot2::geom_dotplot 8 | #' @param position_dots Position adjustment for dots, either as a string, or the 9 | #' result of a call to a position adjustment function. 10 | #' @param size_dots,dots_size Size adjustment for dots. 11 | #' @param color_dots,dots_color Color adjustment for dots. 12 | #' @param fill_dots,dots_fill Fill adjustment for dots. 13 | #' @examples 14 | #' library(ggplot2) 15 | #' library(see) 16 | #' 17 | #' ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + 18 | #' geom_violindot() + 19 | #' theme_modern() 20 | #' 21 | #' @export 22 | geom_violindot <- function( 23 | mapping = NULL, 24 | data = NULL, 25 | trim = TRUE, 26 | scale = c("area", "count", "width"), 27 | show.legend = NA, 28 | inherit.aes = TRUE, 29 | dots_size = 0.7, 30 | dots_color = NULL, 31 | dots_fill = NULL, 32 | binwidth = 0.05, 33 | position_dots = ggplot2::position_nudge(x = -0.025, y = 0), 34 | ..., 35 | size_dots = dots_size, 36 | color_dots = dots_color, 37 | fill_dots = dots_fill 38 | ) { 39 | scale <- match.arg(scale) 40 | 41 | if (is.null(color_dots) && is.null(fill_dots)) { 42 | dotplot <- geom_dotplot( 43 | binaxis = "y", 44 | mapping = mapping, 45 | data = data, 46 | dotsize = size_dots, 47 | stackdir = "down", 48 | binwidth = binwidth, 49 | position = position_dots, 50 | show.legend = FALSE, 51 | ... 52 | ) 53 | } else if (!is.null(color_dots) && is.null(fill_dots)) { 54 | dotplot <- geom_dotplot( 55 | color = color_dots, 56 | mapping = mapping, 57 | data = data, 58 | binaxis = "y", 59 | dotsize = size_dots, 60 | stackdir = "down", 61 | binwidth = binwidth, 62 | position = position_dots, 63 | show.legend = FALSE, 64 | ... 65 | ) 66 | } else if (is.null(color_dots) && !is.null(fill_dots)) { 67 | dotplot <- geom_dotplot( 68 | fill = fill_dots, 69 | mapping = mapping, 70 | data = data, 71 | binaxis = "y", 72 | dotsize = size_dots, 73 | stackdir = "down", 74 | binwidth = binwidth, 75 | position = position_dots, 76 | show.legend = FALSE, 77 | ... 78 | ) 79 | } else { 80 | dotplot <- geom_dotplot( 81 | color = color_dots, 82 | fill = fill_dots, 83 | mapping = mapping, 84 | data = data, 85 | binaxis = "y", 86 | dotsize = size_dots, 87 | stackdir = "down", 88 | binwidth = binwidth, 89 | position = position_dots, 90 | show.legend = FALSE, 91 | ... 92 | ) 93 | } 94 | 95 | list( 96 | geom_violinhalf( 97 | mapping = mapping, 98 | data = data, 99 | stat = "ydensity", 100 | position = "dodge", 101 | trim = trim, 102 | scale = scale, 103 | show.legend = show.legend, 104 | inherit.aes = inherit.aes, 105 | ... 106 | ), 107 | dotplot 108 | ) 109 | } 110 | -------------------------------------------------------------------------------- /R/golden_ratio.R: -------------------------------------------------------------------------------- 1 | #' Golden Ratio 2 | #' 3 | #' Returns the golden ratio (1.618034...). Useful to easily obtain golden 4 | #' proportions, for instance for a horizontal figure, if you want its height to 5 | #' be 8, you can set its width to be `golden_ratio(8)`. 6 | #' 7 | #' @param x A number to be multiplied by the golden ratio. The default (`x = 1`) 8 | #' returns the value of the golden ratio. 9 | #' 10 | #' @examples 11 | #' golden_ratio() 12 | #' golden_ratio(10) 13 | #' @export 14 | golden_ratio <- function(x = 1) { 15 | x * (1 + sqrt(5)) / 2 16 | } 17 | -------------------------------------------------------------------------------- /R/plot.check_heteroscedasticity.R: -------------------------------------------------------------------------------- 1 | #' Plot method for (non-)constant error variance checks 2 | #' 3 | #' The `plot()` method for the 4 | #' `performance::check_heteroscedasticity()` function. 5 | #' 6 | #' @inheritParams data_plot 7 | #' @inheritParams plot.see_check_normality 8 | #' 9 | #' @return A ggplot2-object. 10 | #' 11 | #' @seealso See also the vignette about [`check_model()`](https://easystats.github.io/performance/articles/check_model.html). 12 | #' 13 | #' @examples 14 | #' m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 15 | #' result <- performance::check_heteroscedasticity(m) 16 | #' result 17 | #' plot(result, data = m) # data required for pkgdown 18 | #' @export 19 | plot.see_check_heteroscedasticity <- function( 20 | x, 21 | data = NULL, 22 | size_point = 2, 23 | linewidth = 0.8, 24 | size_title = 12, 25 | size_axis_title = base_size, 26 | base_size = 10, 27 | ... 28 | ) { 29 | if (is.null(data)) { 30 | model <- .retrieve_data(x) 31 | } else { 32 | model <- data 33 | } 34 | 35 | faminfo <- insight::model_info(model) 36 | r <- tryCatch( 37 | if (inherits(model, "merMod")) { 38 | stats::residuals(model, scaled = TRUE) 39 | } else if (inherits(model, c("glmmTMB", "MixMod"))) { 40 | sig <- if (faminfo$is_mixed) { 41 | sqrt(insight::get_variance_residual(model)) 42 | } else { 43 | .sigma_glmmTMB_nonmixed(model, faminfo) 44 | } 45 | stats::residuals(model) / sig 46 | } else if (inherits(model, "glm")) { 47 | stats::rstandard(model, type = "pearson") 48 | } else { 49 | stats::rstandard(model) 50 | }, 51 | error = function(e) { 52 | # debugging 53 | if (isTRUE(getOption("easystats_errors", FALSE))) { 54 | insight::format_error(e$message) 55 | } 56 | NULL 57 | } 58 | ) 59 | 60 | if (is.null(r)) { 61 | r <- tryCatch( 62 | as.vector(scale(stats::residuals(model))), 63 | error = function(e) NULL 64 | ) 65 | } 66 | 67 | if (is.null(r)) { 68 | insight::format_warning( 69 | sprintf( 70 | "Homogeneity of variance could not be computed. Cannot extract residual variance from objects of class '%s'.", 71 | class(model)[1] 72 | ) 73 | ) 74 | return(NULL) 75 | } 76 | 77 | dat <- data.frame( 78 | x = stats::fitted(model), 79 | y = sqrt(abs(r)) 80 | ) 81 | .plot_diag_homogeneity( 82 | dat, 83 | size_point = size_point, 84 | linewidth = linewidth, 85 | base_size = base_size, 86 | size_title = size_title, 87 | size_axis_title = size_axis_title, 88 | ... 89 | ) 90 | } 91 | 92 | 93 | .sigma_glmmTMB_nonmixed <- function(model, faminfo) { 94 | if (!is.na(match(faminfo$family, c("binomial", "poisson", "truncated_poisson")))) { 95 | return(1) 96 | } 97 | betad <- model$fit$par["betad"] 98 | 99 | switch( 100 | faminfo$family, 101 | gaussian = exp(0.5 * betad), 102 | Gamma = exp(-0.5 * betad), 103 | exp(betad) 104 | ) 105 | } 106 | -------------------------------------------------------------------------------- /R/plot.check_overdisp.R: -------------------------------------------------------------------------------- 1 | #' @export 2 | plot.see_check_overdisp <- function( 3 | x, 4 | linewidth = 0.8, 5 | size_title = 12, 6 | size_axis_title = base_size, 7 | base_size = 10, 8 | colors = c("#3aaf85", "#1b6ca8"), 9 | type = 1, 10 | ... 11 | ) { 12 | .plot_diag_overdispersion( 13 | x, 14 | style = theme_lucid, 15 | colors = colors, 16 | linewidth = linewidth, 17 | size_title = size_title, 18 | size_axis_title = size_axis_title, 19 | base_size = base_size, 20 | type = type 21 | ) 22 | } 23 | 24 | 25 | .plot_diag_overdispersion <- function( 26 | x, 27 | theme_style = theme_lucid, 28 | size_axis_title = base_size, 29 | size_title = 12, 30 | base_size = 10, 31 | colors = c("#3aaf85", "#1b6ca8"), 32 | linewidth = 0.8, 33 | type = 1, 34 | ... 35 | ) { 36 | if (is.null(type) || type == 1) { 37 | p <- ggplot2::ggplot(x) + 38 | ggplot2::aes(x = .data$Predicted) + 39 | ggplot2::geom_smooth( 40 | ggplot2::aes(y = .data$V), 41 | linewidth = linewidth, 42 | color = colors[2], 43 | se = FALSE 44 | ) + 45 | ggplot2::geom_smooth( 46 | ggplot2::aes(y = .data$Res2), 47 | linewidth = linewidth, 48 | color = colors[1] 49 | ) + 50 | ggplot2::labs( 51 | title = "Misspecified dispersion and zero-inflation", 52 | subtitle = "Observed residual variance (green) should follow predicted residual variance (blue)", 53 | x = "Predicted mean", 54 | y = "Residual variance" 55 | ) + 56 | theme_style( 57 | base_size = base_size, 58 | plot.title.space = 3, 59 | axis.title.space = 5, 60 | plot.title.size = size_title, 61 | axis.title.size = size_axis_title 62 | ) 63 | } else { 64 | p <- ggplot2::ggplot(x) + 65 | ggplot2::aes(x = .data$Predicted) + 66 | ggplot2::geom_point(ggplot2::aes(y = .data$StdRes)) + 67 | ggplot2::geom_hline( 68 | yintercept = c(-2, 2, -4, 4), 69 | linetype = c("solid", "solid", "dashed", "dashed"), 70 | color = c(rep(colors[1], 2), rep(colors[2], 2)) 71 | ) + 72 | ggplot2::labs( 73 | title = "Misspecified dispersion and zero-inflation", 74 | subtitle = "Most points should be within solid lines, few points outside dashed lines", 75 | x = "Predicted mean", 76 | y = "Standardized resiuduals" 77 | ) + 78 | theme_style( 79 | base_size = base_size, 80 | plot.title.space = 3, 81 | axis.title.space = 5, 82 | plot.title.size = size_title, 83 | axis.title.size = size_axis_title 84 | ) 85 | } 86 | 87 | p 88 | } 89 | -------------------------------------------------------------------------------- /R/plot.effectsize_table.R: -------------------------------------------------------------------------------- 1 | #' Plot method for effect size tables 2 | #' 3 | #' The `plot()` method for the `effectsize::effectsize()` function. 4 | #' 5 | #' @inheritParams data_plot 6 | #' 7 | #' @return A ggplot2-object. 8 | #' 9 | #' @examples 10 | #' library(effectsize) 11 | #' m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars) 12 | #' result <- eta_squared(m) 13 | #' plot(result) 14 | #' @export 15 | plot.see_effectsize_table <- function(x, ...) { 16 | if (!"Parameter" %in% colnames(x)) { 17 | x$Parameter <- seq_len(nrow(x)) 18 | } 19 | 20 | x$Parameter <- factor(x$Parameter, levels = rev(unique(x$Parameter))) 21 | 22 | es_name <- colnames(x)[effectsize::is_effectsize_name(colnames(x))] 23 | es_lab <- gsub("_", " ", es_name, fixed = TRUE) 24 | es_lab <- gsub("partial", "(partial)", es_lab, fixed = TRUE) 25 | 26 | x$.es <- x[, es_name] 27 | 28 | if (all(c("CI_low", "CI_high") %in% colnames(x))) { 29 | CIs <- geom_errorbarh( 30 | aes(xmin = .data$CI_low, xmax = .data$CI_high), 31 | height = 0 32 | ) 33 | } else { 34 | NULL 35 | } 36 | 37 | ggplot(x, aes(y = .data$Parameter, color = .data$.es > 0)) + 38 | CIs + 39 | geom_point(aes(x = .data$.es), size = 2) + 40 | geom_vline(xintercept = 0) + 41 | scale_color_manual( 42 | values = c("FALSE" = "green", "TRUE" = "blue"), 43 | guide = "none" 44 | ) + 45 | labs(x = es_lab) + 46 | theme_modern() 47 | } 48 | 49 | 50 | #' @rdname plot.see_equivalence_test 51 | #' @export 52 | plot.see_equivalence_test_effectsize <- function(x, ...) { 53 | if (!"Parameter" %in% colnames(x)) { 54 | x$Parameter <- seq_len(nrow(x)) 55 | } 56 | 57 | x$Parameter <- factor(x$Parameter, levels = rev(unique(x$Parameter))) 58 | 59 | if (attr(x, "rule", exact = TRUE) == "cet") { 60 | title <- "Conditional Test for Practical Equivalence" 61 | } else { 62 | title <- "Test for Practical Equivalence" 63 | } 64 | 65 | if (attr(x, "rule", exact = TRUE) == "bayes") { 66 | subtitle <- "(Using Bayesian guidlines)" 67 | } else { 68 | subtitle <- "" 69 | } 70 | 71 | es_name <- colnames(x)[effectsize::is_effectsize_name(colnames(x))] 72 | es_lab <- gsub("_", " ", es_name, fixed = TRUE) 73 | es_lab <- gsub("partial", "(partial)", es_lab, fixed = TRUE) 74 | 75 | x$.es <- x[, es_name] 76 | 77 | ggplot(x, aes(y = .data$Parameter, color = .data$ROPE_Equivalence)) + 78 | geom_errorbarh(aes(xmin = .data$CI_low, xmax = .data$CI_high), height = 0) + 79 | geom_point(aes(x = .data$.es), size = 2) + 80 | geom_vline(xintercept = 0) + 81 | geom_vline(xintercept = unique(attr(x, "rope")), linetype = "dashed") + 82 | scale_color_manual( 83 | values = c( 84 | Accepted = "#CD423F", 85 | Rejected = "#018F77", 86 | Undecided = "#FCDA3B" 87 | ) 88 | ) + 89 | labs( 90 | x = es_lab, 91 | color = "H0", 92 | title = title, 93 | subtitle = subtitle 94 | ) + 95 | theme_modern() 96 | } 97 | -------------------------------------------------------------------------------- /R/plot.performance_roc.R: -------------------------------------------------------------------------------- 1 | #' Plot method for ROC curves 2 | #' 3 | #' The `plot()` method for the `performance::performance_roc()` 4 | #' function. 5 | #' 6 | #' @inheritParams data_plot 7 | #' 8 | #' @return A ggplot2-object. 9 | #' 10 | #' @examples 11 | #' library(performance) 12 | #' data(iris) 13 | #' set.seed(123) 14 | #' iris$y <- rbinom(nrow(iris), size = 1, .3) 15 | #' 16 | #' folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE) 17 | #' test_data <- iris[folds, ] 18 | #' train_data <- iris[-folds, ] 19 | #' 20 | #' model <- glm(y ~ Sepal.Length + Sepal.Width, data = train_data, family = "binomial") 21 | #' result <- performance_roc(model, new_data = test_data) 22 | #' result 23 | #' plot(result) 24 | #' @export 25 | plot.see_performance_roc <- function(x, ...) { 26 | if (length(unique(x$Model)) > 1L) { 27 | p <- ggplot( 28 | x, 29 | aes( 30 | x = .data$Specificity, 31 | y = .data$Sensitivity, 32 | colour = .data$Model 33 | ) 34 | ) 35 | } else { 36 | p <- ggplot( 37 | x, 38 | aes( 39 | x = .data$Specificity, 40 | y = .data$Sensitivity 41 | ) 42 | ) 43 | } 44 | 45 | p + 46 | geom_abline(slope = 1, intercept = 0, linetype = "dashed", alpha = 0.5) + 47 | geom_line() + 48 | ylim(c(0, 1)) + 49 | xlim(c(0, 1)) + 50 | labs( 51 | x = "1 - Specificity (False Positive Rate)", 52 | y = "Sensitivity (True Positive Rate)", 53 | colour = NULL 54 | ) 55 | } 56 | -------------------------------------------------------------------------------- /R/plot.visualisation_recipe.R: -------------------------------------------------------------------------------- 1 | #' @export 2 | plot.see_visualisation_recipe <- function(x, ...) { 3 | if ("ggraph" %in% names(attributes(x))) { 4 | insight::check_if_installed("ggraph") 5 | if (!"ggraph" %in% .packages()) { 6 | attachNamespace("ggraph") # Needs to be attached 7 | } 8 | suppressWarnings( 9 | ggraph::ggraph(attributes(x)$data, layout = attributes(x)$layout) + 10 | geoms_from_list(x) 11 | ) 12 | } else { 13 | global_aes <- attributes(x)$global_aes 14 | if (!is.null(global_aes) && length(global_aes)) { 15 | global_aes <- do.call( 16 | ggplot2::aes, 17 | args = lapply(global_aes, .str_to_sym) 18 | ) 19 | } 20 | suppressWarnings( 21 | do.call( 22 | ggplot2::ggplot, 23 | insight::compact_list(list( 24 | data = attributes(x)$data, 25 | mapping = global_aes 26 | )) 27 | ) + 28 | geoms_from_list(x, ...) 29 | ) 30 | } 31 | } 32 | 33 | # Example 34 | # vr1 <- datawizard::visualisation_recipe(correlation::correlation(iris)) 35 | # vr2 <- datawizard::visualisation_recipe(summary(correlation::correlation(iris))) 36 | # x <- list(p1 = vr1, p2 = vr2) 37 | # class(x) <- "see_visualisation_recipes" 38 | # plot(x) 39 | #' @export 40 | plot.see_visualisation_recipes <- function(x, ...) { 41 | the_plots <- list() 42 | for (i in names(x)) { 43 | the_plots[[i]] <- suppressWarnings(graphics::plot(x[[i]])) 44 | } 45 | pw <- plots(the_plots, ...) 46 | .safe_print_plots(pw) 47 | invisible(pw) 48 | } 49 | -------------------------------------------------------------------------------- /R/print.check_model.R: -------------------------------------------------------------------------------- 1 | #' @export 2 | print.see_check_model <- function( 3 | x, 4 | style = theme_lucid, 5 | colors = NULL, 6 | type = "density", 7 | n_columns = 2, 8 | ... 9 | ) { 10 | # set default - we need to evaluate "type" here, because when it's passed 11 | # to plot(), "type" is no longer recognized as "missing()" 12 | plot_type <- attr(x, "type") 13 | 14 | if ( 15 | missing(type) && 16 | !is.null(plot_type) && 17 | plot_type %in% 18 | c("density", "discrete_dots", "discrete_interval", "discrete_both") 19 | ) { 20 | # nolint 21 | type <- plot_type 22 | } else { 23 | type <- insight::validate_argument( 24 | type, 25 | c("density", "discrete_dots", "discrete_interval", "discrete_both") 26 | ) 27 | } 28 | 29 | suppressWarnings(suppressMessages(graphics::plot( 30 | x, 31 | style = style, 32 | colors = colors, 33 | type = type, 34 | n_colums = n_columns, 35 | ... 36 | ))) 37 | invisible(x) 38 | } 39 | -------------------------------------------------------------------------------- /R/print.data_plot.R: -------------------------------------------------------------------------------- 1 | #' @method print data_plot 2 | #' @export 3 | print.data_plot <- function(x, ...) { 4 | print(as.data.frame(x)) 5 | invisible(x) 6 | } 7 | -------------------------------------------------------------------------------- /R/reshape_to_long.R: -------------------------------------------------------------------------------- 1 | # TODO: retire in favor of {datawizard}? 2 | 3 | #' @keywords internal 4 | .reshape_to_long <- function( 5 | x, 6 | names_to = "group", 7 | values_to = "values", 8 | columns = colnames(x), 9 | id = "id" 10 | ) { 11 | if (is.numeric(columns)) columns <- colnames(x)[columns] 12 | dat <- stats::reshape( 13 | as.data.frame(x), 14 | idvar = id, 15 | ids = row.names(x), 16 | times = columns, 17 | timevar = names_to, 18 | v.names = values_to, 19 | varying = list(columns), 20 | direction = "long" 21 | ) 22 | 23 | if (is.factor(dat[[values_to]])) { 24 | dat[[values_to]] <- as.character(dat[[values_to]]) 25 | } 26 | 27 | dat[, 1:(ncol(dat) - 1), drop = FALSE] 28 | } 29 | -------------------------------------------------------------------------------- /R/see-package.R: -------------------------------------------------------------------------------- 1 | #' \code{see} 2 | #' 3 | #' @title see: Framework for Easy Statistical Modeling, Visualization, and Reporting 4 | #' 5 | #' @description 6 | #' 7 | #' Provides plotting utilities supporting packages in the 'easystats' ecosystem 8 | #' () and some extra themes, geoms, and 9 | #' scales for 'ggplot2'. Color scales are based on 10 | #' . 11 | #' 12 | #' References: Luedecke et al. (2021) \doi{10.21105/joss.03393}. 13 | #' 14 | #' @docType package 15 | #' @aliases see see-package 16 | #' @name see-package 17 | #' @keywords internal 18 | "_PACKAGE" 19 | 20 | ## see namespace: start 21 | ## 22 | #' @import ggplot2 23 | #' 24 | ## see namespace: end 25 | NULL 26 | 27 | # Suppress R CMD check note 28 | # Namespace in Imports field not imported from: PKG 29 | # All declared Imports should be used. 30 | .ignore_unused_imports <- function() { 31 | correlation::correlation() 32 | modelbased::estimate_expectation() 33 | performance::model_performance() 34 | } 35 | -------------------------------------------------------------------------------- /R/theme_abyss.R: -------------------------------------------------------------------------------- 1 | #' Abyss theme 2 | #' 3 | #' A deep dark blue theme for ggplot. 4 | #' 5 | #' @inheritParams theme_modern 6 | #' @inherit theme_modern note 7 | #' 8 | #' @examples 9 | #' library(ggplot2) 10 | #' library(see) 11 | #' 12 | #' ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + 13 | #' geom_point(color = "white") + 14 | #' theme_abyss() 15 | #' @export 16 | theme_abyss <- function( 17 | base_size = 11, 18 | base_family = "", 19 | plot.title.size = 1.35 * base_size, 20 | plot.title.face = "plain", 21 | plot.title.space = 1.8 * base_size, 22 | plot.title.position = "plot", 23 | legend.position = "right", 24 | axis.title.space = 1.8 * base_size, 25 | legend.title.size = 1.2 * base_size, 26 | legend.text.size = 1.1 * base_size, 27 | axis.title.size = 1.2 * base_size, 28 | axis.title.face = "plain", 29 | axis.text.size = 1.1 * base_size, 30 | axis.text.angle = NULL, 31 | tags.size = 1.35 * base_size, 32 | tags.face = "bold", 33 | ... 34 | ) { 35 | theme_modern( 36 | base_size = base_size, 37 | base_family = base_family, 38 | plot.title.size = plot.title.size, 39 | plot.title.face = plot.title.face, 40 | plot.title.space = plot.title.space, 41 | plot.title.position = plot.title.position, 42 | legend.position = legend.position, 43 | axis.title.space = axis.title.space, 44 | legend.title.size = legend.title.size, 45 | legend.text.size = legend.text.size, 46 | axis.title.size = axis.title.size, 47 | axis.title.face = axis.title.face, 48 | axis.text.size = axis.text.size, 49 | axis.text.angle = axis.text.angle, 50 | tags.size = tags.size, 51 | tags.face = tags.face 52 | ) + 53 | theme( 54 | plot.background = element_rect(fill = "#001429"), 55 | panel.background = element_rect(fill = "#001429"), 56 | legend.background = element_rect(fill = "#001429"), 57 | axis.line = element_line(color = "#f2f2f2", linewidth = base_size / 22), 58 | rect = element_rect(colour = "#f2f2f2", linewidth = base_size / 22), 59 | text = element_text(color = "#f2f2f2"), 60 | axis.text = element_text(color = "#f2f2f2"), 61 | panel.grid.major = element_line(color = "#465463"), 62 | strip.text = element_text(color = "#f2f2f2"), 63 | ... 64 | ) 65 | } 66 | -------------------------------------------------------------------------------- /R/theme_azurelight.R: -------------------------------------------------------------------------------- 1 | #' Azurelight theme 2 | #' 3 | #' A light-blue, clear theme for ggplot with reduced usage of panel grids. 4 | #' 5 | #' @inheritParams theme_modern 6 | #' @inherit theme_modern note 7 | #' 8 | #' @examples 9 | #' library(ggplot2) 10 | #' library(see) 11 | #' 12 | #' data(iris) 13 | #' 14 | #' ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) + 15 | #' geom_point2(size = 2.5) + 16 | #' scale_color_social() + 17 | #' theme_azurelight() 18 | #' @export 19 | theme_azurelight <- function( 20 | base_size = 11, 21 | base_family = "", 22 | plot.title.size = 1.35 * base_size, 23 | plot.title.face = "plain", 24 | plot.title.space = 1.8 * base_size, 25 | plot.title.position = "plot", 26 | legend.position = "right", 27 | axis.title.space = 1.8 * base_size, 28 | legend.title.size = 1.2 * base_size, 29 | legend.text.size = 1.1 * base_size, 30 | axis.title.size = 1.2 * base_size, 31 | axis.title.face = "plain", 32 | axis.text.size = 1.1 * base_size, 33 | axis.text.angle = NULL, 34 | tags.size = 1.35 * base_size, 35 | tags.face = "bold", 36 | ... 37 | ) { 38 | theme_modern( 39 | base_size = base_size, 40 | base_family = base_family, 41 | plot.title.size = plot.title.size, 42 | plot.title.face = plot.title.face, 43 | plot.title.space = plot.title.space, 44 | plot.title.position = plot.title.position, 45 | legend.position = legend.position, 46 | axis.title.space = axis.title.space, 47 | legend.title.size = legend.title.size, 48 | legend.text.size = legend.text.size, 49 | axis.title.size = axis.title.size, 50 | axis.title.face = axis.title.face, 51 | axis.text.size = axis.text.size, 52 | axis.text.angle = axis.text.angle, 53 | tags.size = tags.size, 54 | tags.face = tags.face 55 | ) + 56 | theme( 57 | plot.background = element_rect(fill = "#EEF7FF"), 58 | panel.background = element_rect(fill = "#EEF7FF"), 59 | panel.grid.major.x = element_blank(), 60 | panel.grid.minor.x = element_blank(), 61 | panel.grid.minor.y = element_line(colour = "#E3EBF2"), 62 | panel.grid.major.y = element_line(colour = "#D7DFE5"), 63 | strip.background = element_rect( 64 | colour = "#EEF7FF", 65 | fill = "#A5BFCC", 66 | linewidth = 0 67 | ), 68 | strip.text = element_text(colour = "#354649", face = "bold"), 69 | axis.line.y = element_blank(), 70 | axis.line.x.bottom = element_line(color = "#A5BFCC", linewidth = 0.75), 71 | axis.ticks.x.bottom = element_line(linewidth = 0.75, colour = "#A5BFCC"), 72 | axis.ticks.length.x.bottom = unit(-0.25, "cm"), 73 | axis.text.x.bottom = element_text( 74 | margin = margin(t = base_size * 1.3, r = 0, b = 0, l = 0) 75 | ), 76 | axis.text.y.left = element_text( 77 | margin = margin(t = 0, r = base_size * 1.3, b = 0, l = 0) 78 | ), 79 | legend.background = element_rect(fill = "#EEF7FF"), 80 | ... 81 | ) 82 | } 83 | -------------------------------------------------------------------------------- /R/theme_blackboard.R: -------------------------------------------------------------------------------- 1 | #' Blackboard dark theme 2 | #' 3 | #' A modern, sleek and dark theme for ggplot. 4 | #' 5 | #' @inheritParams theme_modern 6 | #' @inherit theme_modern note 7 | #' 8 | #' @examples 9 | #' library(ggplot2) 10 | #' library(see) 11 | #' 12 | #' ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + 13 | #' geom_point(color = see_colors("lime")) + 14 | #' theme_blackboard() 15 | #' @export 16 | theme_blackboard <- function( 17 | base_size = 11, 18 | base_family = "", 19 | plot.title.size = 1.35 * base_size, 20 | plot.title.face = "plain", 21 | plot.title.space = 1.8 * base_size, 22 | plot.title.position = "plot", 23 | legend.position = "right", 24 | axis.title.space = 1.8 * base_size, 25 | legend.title.size = 1.2 * base_size, 26 | legend.text.size = 1.1 * base_size, 27 | axis.title.size = 1.2 * base_size, 28 | axis.title.face = "plain", 29 | axis.text.size = 1.1 * base_size, 30 | axis.text.angle = NULL, 31 | tags.size = 1.35 * base_size, 32 | tags.face = "bold", 33 | ... 34 | ) { 35 | theme_modern( 36 | base_size = base_size, 37 | base_family = base_family, 38 | plot.title.size = plot.title.size, 39 | plot.title.face = plot.title.face, 40 | plot.title.space = plot.title.space, 41 | plot.title.position = plot.title.position, 42 | legend.position = legend.position, 43 | axis.title.space = axis.title.space, 44 | legend.title.size = legend.title.size, 45 | legend.text.size = legend.text.size, 46 | axis.title.size = axis.title.size, 47 | axis.title.face = axis.title.face, 48 | axis.text.size = axis.text.size, 49 | axis.text.angle = axis.text.angle, 50 | tags.size = tags.size, 51 | tags.face = tags.face 52 | ) + 53 | theme( 54 | plot.background = element_rect(fill = "#0d0d0d"), 55 | panel.background = element_rect(fill = "#0d0d0d"), 56 | legend.background = element_rect(fill = "#0d0d0d"), 57 | axis.line = element_line(color = "#E0E0E0", linewidth = base_size / 22), 58 | rect = element_rect(colour = "#E0E0E0", linewidth = base_size / 22), 59 | text = element_text(color = "#E0E0E0"), 60 | axis.text = element_text(color = "#E0E0E0"), 61 | strip.text = element_text(color = "#E0E0E0"), 62 | ... 63 | ) 64 | } 65 | -------------------------------------------------------------------------------- /R/theme_lucid.R: -------------------------------------------------------------------------------- 1 | #' Lucid theme 2 | #' 3 | #' A light, clear theme for ggplot. 4 | #' 5 | #' @inheritParams theme_modern 6 | #' @inherit theme_modern note 7 | #' 8 | #' @examples 9 | #' library(ggplot2) 10 | #' library(see) 11 | #' 12 | #' ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + 13 | #' geom_point() + 14 | #' scale_color_metro() + 15 | #' theme_lucid() 16 | #' @export 17 | theme_lucid <- function( 18 | base_size = 11, 19 | base_family = "", 20 | plot.title.size = 1.1 * base_size, 21 | plot.title.face = "plain", 22 | plot.title.space = 1.35 * base_size, 23 | plot.title.position = "plot", 24 | legend.position = "right", 25 | axis.title.space = 0.9 * base_size, 26 | legend.title.size = base_size, 27 | legend.text.size = 0.9 * base_size, 28 | axis.title.size = base_size, 29 | axis.title.face = "plain", 30 | axis.text.size = 0.9 * base_size, 31 | axis.text.angle = NULL, 32 | tags.size = base_size, 33 | tags.face = "plain", 34 | ... 35 | ) { 36 | theme_modern( 37 | base_size = base_size, 38 | base_family = base_family, 39 | plot.title.size = plot.title.size, 40 | plot.title.face = plot.title.face, 41 | plot.title.space = plot.title.space, 42 | plot.title.position = plot.title.position, 43 | legend.position = legend.position, 44 | axis.title.space = axis.title.space, 45 | legend.title.size = legend.title.size, 46 | legend.text.size = legend.text.size, 47 | axis.title.size = axis.title.size, 48 | axis.title.face = axis.title.face, 49 | axis.text.size = axis.text.size, 50 | axis.text.angle = axis.text.angle, 51 | tags.size = tags.size, 52 | tags.face = tags.face 53 | ) + 54 | theme( 55 | axis.line.x = element_line(colour = "grey80", linewidth = base_size / 22), 56 | axis.line.y = element_line(colour = "grey80", linewidth = base_size / 22), 57 | rect = element_rect(colour = "#grey80", linewidth = base_size / 22), 58 | axis.text = element_text(colour = "grey50"), 59 | axis.title = element_text(colour = "grey30"), 60 | strip.background = element_rect(colour = "grey70", fill = "grey90"), 61 | strip.text = element_text(colour = "grey30"), 62 | legend.title = element_text(colour = "grey30"), 63 | legend.text = element_text(colour = "grey30"), 64 | panel.grid.major = element_line(colour = "grey90"), 65 | panel.grid.minor = element_line(colour = "grey92"), 66 | ... 67 | ) 68 | } 69 | -------------------------------------------------------------------------------- /air.toml: -------------------------------------------------------------------------------- 1 | [format] 2 | line-width = 90 3 | indent-width = 2 4 | indent-style = "space" 5 | line-ending = "auto" 6 | persistent-line-breaks = true 7 | exclude = [] 8 | default-exclude = true 9 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## R CMD check results 2 | 3 | 0 errors | 0 warnings | 0 note 4 | 5 | * Maintenance update. 6 | 7 | ## revdepcheck results 8 | 9 | We checked 16 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. 10 | 11 | * We saw 0 new problems 12 | * We failed to check 0 packages 13 | -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | bibentry( 2 | bibtype="Article", 3 | title="{see}: An {R} Package for Visualizing Statistical Models", 4 | author=c(person("Daniel", "Lüdecke"), person("Indrajeet", "Patil"), person("Mattan S.", "Ben-Shachar"), person("Brenton M.", "Wiernik"), person("Philip", "Waggoner"), person("Dominique", "Makowski")), 5 | journal="Journal of Open Source Software", 6 | year = 2021, 7 | volume = 6, 8 | number = 64, 9 | pages = 3393, 10 | doi = "10.21105/joss.03393", 11 | textVersion = "Lüdecke et al., (2021). see: An R Package for Visualizing Statistical Models. Journal of Open Source Software, 12 | 6(64), 3393. https://doi.org/10.21105/joss.03393" 13 | ) 14 | -------------------------------------------------------------------------------- /inst/WORDLIST: -------------------------------------------------------------------------------- 1 | Acyclic 2 | Anova 3 | Azurelight 4 | BFs 5 | BayesFactor 6 | Biserial 7 | Blomqvist’s 8 | Bluebrown 9 | CMD 10 | Cai 11 | DAGs 12 | DOI 13 | Dasgupta 14 | GGMs 15 | GeomViolinHalf 16 | Geoms 17 | HDI 18 | Hoeffding’s 19 | Luedecke 20 | MPE 21 | Mattan 22 | Modelling 23 | Multicollinearity 24 | ORCID 25 | Okabe 26 | Polychoric 27 | SEM 28 | Shachar 29 | Tetrachoric 30 | UI 31 | VIF 32 | Visualisation 33 | Winsorized 34 | al 35 | autocorrelated 36 | bayestestR 37 | behaviour 38 | biserial 39 | bluebrown 40 | brms 41 | characterisation 42 | codecov 43 | colour 44 | cumulate 45 | datawizard 46 | de 47 | doi 48 | dotdensity 49 | easystats 50 | easystats’ 51 | effectsize 52 | emmeans 53 | errorbars 54 | et 55 | ffectsize 56 | geom's 57 | geoms 58 | ggplot 59 | ggproto 60 | ggraph 61 | grey 62 | gridExtra 63 | histodot 64 | homegeneity 65 | homoscedasticity 66 | https 67 | intraclass 68 | jfly 69 | jitter 70 | joss 71 | koeln 72 | labelled 73 | labelling 74 | loadings 75 | mcmc 76 | metaBMA 77 | metafor 78 | midcorrelation 79 | modelbased 80 | modelfit 81 | multicollinearity 82 | neapolitan 83 | nopw 84 | pre 85 | pts 86 | qq 87 | qqplotr 88 | rOpenSci 89 | rescaled 90 | rstanarm 91 | subfigures 92 | ui 93 | unmapped 94 | vermillion 95 | visualising 96 | ’ 97 | -------------------------------------------------------------------------------- /man/add_plot_attributes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data_plot.R 3 | \name{add_plot_attributes} 4 | \alias{add_plot_attributes} 5 | \title{Complete figure with its attributes} 6 | \usage{ 7 | add_plot_attributes(x) 8 | } 9 | \arguments{ 10 | \item{x}{An object.} 11 | } 12 | \description{ 13 | The \code{data_plot()} function usually stores information (such as title, axes 14 | labels, etc.) as attributes, while \code{add_plot_attributes()} adds this 15 | information to the plot. 16 | } 17 | \examples{ 18 | \dontshow{if (require("rstanarm", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 19 | \donttest{ 20 | library(rstanarm) 21 | library(bayestestR) 22 | library(see) 23 | library(ggplot2) 24 | 25 | model <- suppressWarnings(stan_glm( 26 | Sepal.Length ~ Petal.Width + Species + Sepal.Width, 27 | data = iris, 28 | chains = 2, iter = 200, refresh = 0 29 | )) 30 | 31 | result <- bayestestR::hdi(model, ci = c(0.5, 0.75, 0.9, 0.95)) 32 | data <- data_plot(result, data = model) 33 | 34 | p <- ggplot( 35 | data, 36 | aes(x = x, y = y, height = height, group = y, fill = fill) 37 | ) + 38 | ggridges::geom_ridgeline_gradient() 39 | 40 | p 41 | p + add_plot_attributes(data) 42 | } 43 | \dontshow{\}) # examplesIf} 44 | } 45 | -------------------------------------------------------------------------------- /man/bluebrown_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_bluebrown.R 3 | \name{bluebrown_colors} 4 | \alias{bluebrown_colors} 5 | \title{Extract blue-brown colors as hex codes} 6 | \usage{ 7 | bluebrown_colors(...) 8 | } 9 | \arguments{ 10 | \item{...}{Character names of colors.} 11 | } 12 | \value{ 13 | A character vector with color-codes. 14 | } 15 | \description{ 16 | Can be used to get the hex code of specific colors from the blue-brown color palette. 17 | Use \code{bluebrown_colors()} to see all available colors. 18 | } 19 | \examples{ 20 | bluebrown_colors() 21 | 22 | bluebrown_colors("blue", "brown") 23 | } 24 | -------------------------------------------------------------------------------- /man/coord_radar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/coord_radar.R 3 | \name{coord_radar} 4 | \alias{coord_radar} 5 | \title{Radar coordinate system} 6 | \usage{ 7 | coord_radar(theta = "x", start = 0, direction = 1, ...) 8 | } 9 | \arguments{ 10 | \item{theta}{variable to map angle to (\code{x} or \code{y})} 11 | 12 | \item{start}{Offset of starting point from 12 o'clock in radians. Offset 13 | is applied clockwise or anticlockwise depending on value of \code{direction}.} 14 | 15 | \item{direction}{1, clockwise; -1, anticlockwise} 16 | 17 | \item{...}{Other arguments to be passed to \code{ggproto}.} 18 | } 19 | \description{ 20 | Add a radar coordinate system useful for radar charts. 21 | } 22 | \examples{ 23 | library(ggplot2) 24 | 25 | # Create a radar/spider chart with ggplot: 26 | data(iris) 27 | data <- aggregate(iris[-5], list(Species = iris$Species), mean) 28 | data <- datawizard::data_to_long( 29 | data, 30 | c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width") 31 | ) 32 | 33 | ggplot(data, aes(x = name, y = value, color = Species, group = Species)) + 34 | geom_polygon(fill = NA, linewidth = 2) + 35 | coord_radar(start = -pi / 4) 36 | } 37 | -------------------------------------------------------------------------------- /man/figures/bayestestR-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/bayestestR-1.png -------------------------------------------------------------------------------- /man/figures/correlation-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/correlation-1.png -------------------------------------------------------------------------------- /man/figures/effectsize-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/effectsize-1.png -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/logo.png -------------------------------------------------------------------------------- /man/figures/modelbased1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/modelbased1-1.png -------------------------------------------------------------------------------- /man/figures/modelbased2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/modelbased2-1.png -------------------------------------------------------------------------------- /man/figures/parameters1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/parameters1-1.png -------------------------------------------------------------------------------- /man/figures/parameters2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/parameters2-1.png -------------------------------------------------------------------------------- /man/figures/performance-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/performance-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-10-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-10-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-11-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-11-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-6-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-7-1.png -------------------------------------------------------------------------------- /man/figures/unnamed-chunk-9-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/man/figures/unnamed-chunk-9-1.png -------------------------------------------------------------------------------- /man/flat_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_flat.R 3 | \name{flat_colors} 4 | \alias{flat_colors} 5 | \title{Extract Flat UI colors as hex codes} 6 | \usage{ 7 | flat_colors(...) 8 | } 9 | \arguments{ 10 | \item{...}{Character names of colors.} 11 | } 12 | \value{ 13 | A character vector with color-codes. 14 | } 15 | \description{ 16 | Can be used to get the hex code of specific colors from the Flat UI color 17 | palette. Use \code{flat_colors()} to see all available colors. 18 | } 19 | \examples{ 20 | flat_colors() 21 | 22 | flat_colors("dark red", "teal") 23 | } 24 | -------------------------------------------------------------------------------- /man/geom_binomdensity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/geom_binomdensity.R 3 | \name{geom_binomdensity} 4 | \alias{geom_binomdensity} 5 | \title{Add dot-densities for binary \code{y} variables} 6 | \usage{ 7 | geom_binomdensity(data, x, y, scale = "auto", ...) 8 | } 9 | \arguments{ 10 | \item{data}{A dataframe.} 11 | 12 | \item{x, y}{Characters corresponding to the x and y axis. Note that \code{y} 13 | must be a variable with two unique values.} 14 | 15 | \item{scale}{Character specifying method of scaling the dot-densities. Can 16 | be: \code{'auto'} (corresponding to the square root of the proportion), 17 | \code{'proportion'}, \code{'density'} or a custom list with values for each factor 18 | level (see examples).} 19 | 20 | \item{...}{Other arguments passed to \code{ggdist::geom_dots}.} 21 | } 22 | \description{ 23 | Add dot-densities for binary \code{y} variables 24 | } 25 | \examples{ 26 | \dontshow{if (require("ggdist")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 27 | library(ggplot2) 28 | library(see) 29 | 30 | data <- iris[1:100, ] 31 | 32 | ggplot() + 33 | geom_binomdensity(data, 34 | x = "Sepal.Length", 35 | y = "Species", 36 | fill = "red", 37 | color = NA 38 | ) 39 | 40 | # Different scales 41 | data[1:70, "Species"] <- "setosa" # Create unbalanced proportions 42 | 43 | ggplot() + 44 | geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "auto") 45 | ggplot() + 46 | geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "density") 47 | ggplot() + 48 | geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "proportion") 49 | ggplot() + 50 | geom_binomdensity(data, 51 | x = "Sepal.Length", y = "Species", 52 | scale = list("setosa" = 0.4, "versicolor" = 0.6) 53 | ) 54 | \dontshow{\}) # examplesIf} 55 | } 56 | -------------------------------------------------------------------------------- /man/geom_point2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/geom_point2.R 3 | \name{geom_point2} 4 | \alias{geom_point2} 5 | \alias{geom_jitter2} 6 | \alias{geom_pointrange2} 7 | \alias{geom_count2} 8 | \alias{geom_count_borderless} 9 | \alias{geom_point_borderless} 10 | \alias{geom_jitter_borderless} 11 | \alias{geom_pointrange_borderless} 12 | \title{Better looking points} 13 | \usage{ 14 | geom_point2(..., stroke = 0, shape = 16) 15 | 16 | geom_jitter2(..., size = 2, stroke = 0, shape = 16) 17 | 18 | geom_pointrange2(..., stroke = 0) 19 | 20 | geom_count2(..., stroke = 0) 21 | 22 | geom_count_borderless(..., stroke = 0) 23 | 24 | geom_point_borderless(...) 25 | 26 | geom_jitter_borderless(...) 27 | 28 | geom_pointrange_borderless(...) 29 | } 30 | \arguments{ 31 | \item{...}{Other arguments to be passed to 32 | \code{\link[ggplot2:geom_point]{ggplot2::geom_point()}}, 33 | \code{\link[ggplot2:geom_jitter]{ggplot2::geom_jitter()}}, 34 | \code{\link[ggplot2:geom_linerange]{ggplot2::geom_pointrange()}}, or 35 | \code{\link[ggplot2:geom_count]{ggplot2::geom_count()}}.} 36 | 37 | \item{stroke}{Stroke thickness.} 38 | 39 | \item{shape}{Shape of points.} 40 | 41 | \item{size}{Size of points.} 42 | } 43 | \description{ 44 | Somewhat nicer points (especially in case of transparency) without outline 45 | strokes (borders, contours) by default. 46 | } 47 | \note{ 48 | The color aesthetics for \code{geom_point_borderless()} is \code{"fill"}, not 49 | \code{"color"}. See 'Examples'. 50 | } 51 | \examples{ 52 | \dontshow{if (requireNamespace("patchwork", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 53 | library(ggplot2) 54 | library(see) 55 | 56 | normal <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + 57 | geom_point(size = 8, alpha = 0.3) + 58 | theme_modern() 59 | 60 | new <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + 61 | geom_point2(size = 8, alpha = 0.3) + 62 | theme_modern() 63 | 64 | plots(normal, new, n_columns = 2) 65 | 66 | ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, fill = Species)) + 67 | geom_point_borderless(size = 4) + 68 | theme_modern() 69 | 70 | theme_set(theme_abyss()) 71 | ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, fill = Species)) + 72 | geom_point_borderless(size = 4) 73 | \dontshow{\}) # examplesIf} 74 | } 75 | -------------------------------------------------------------------------------- /man/geom_poolpoint.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/geom_poolpoint.R 3 | \name{geom_poolpoint} 4 | \alias{geom_poolpoint} 5 | \alias{geom_pooljitter} 6 | \title{Pool ball points} 7 | \usage{ 8 | geom_poolpoint( 9 | label, 10 | size_text = 3.88, 11 | size_background = size_text * 2, 12 | size_point = size_text * 3.5, 13 | ... 14 | ) 15 | 16 | geom_pooljitter( 17 | label, 18 | size_text = 3.88, 19 | size_background = size_text * 2, 20 | size_point = size_text * 3.5, 21 | jitter = 0.1, 22 | ... 23 | ) 24 | } 25 | \arguments{ 26 | \item{label}{Label to add inside the points.} 27 | 28 | \item{size_text}{Size of text.} 29 | 30 | \item{size_background}{Size of the white background circle.} 31 | 32 | \item{size_point}{Size of the ball.} 33 | 34 | \item{...}{Other arguments to be passed to \code{geom_point}.} 35 | 36 | \item{jitter}{Width and height of position jitter.} 37 | } 38 | \description{ 39 | Points labelled with the observation name. 40 | } 41 | \examples{ 42 | library(ggplot2) 43 | library(see) 44 | 45 | ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) + 46 | geom_poolpoint(label = rownames(iris)) + 47 | scale_color_flat_d() + 48 | theme_modern() 49 | 50 | 51 | ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) + 52 | geom_pooljitter(label = rownames(iris)) + 53 | scale_color_flat_d() + 54 | theme_modern() 55 | } 56 | -------------------------------------------------------------------------------- /man/ggplot2-ggproto.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/geom_violinhalf.R 3 | \docType{data} 4 | \name{GeomViolinHalf} 5 | \alias{GeomViolinHalf} 6 | \title{GeomViolinHalf} 7 | \description{ 8 | GeomViolinHalf 9 | } 10 | \keyword{internal} 11 | -------------------------------------------------------------------------------- /man/golden_ratio.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/golden_ratio.R 3 | \name{golden_ratio} 4 | \alias{golden_ratio} 5 | \title{Golden Ratio} 6 | \usage{ 7 | golden_ratio(x = 1) 8 | } 9 | \arguments{ 10 | \item{x}{A number to be multiplied by the golden ratio. The default (\code{x = 1}) 11 | returns the value of the golden ratio.} 12 | } 13 | \description{ 14 | Returns the golden ratio (1.618034...). Useful to easily obtain golden 15 | proportions, for instance for a horizontal figure, if you want its height to 16 | be 8, you can set its width to be \code{golden_ratio(8)}. 17 | } 18 | \examples{ 19 | golden_ratio() 20 | golden_ratio(10) 21 | } 22 | -------------------------------------------------------------------------------- /man/material_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_material.R 3 | \name{material_colors} 4 | \alias{material_colors} 5 | \title{Extract material design colors as hex codes} 6 | \usage{ 7 | material_colors(...) 8 | } 9 | \arguments{ 10 | \item{...}{Character names of colors.} 11 | } 12 | \value{ 13 | A character vector with color-codes. 14 | } 15 | \description{ 16 | Can be used to get the hex code of specific colors from the material design 17 | color palette. Use \code{material_colors()} to see all available colors. 18 | } 19 | \examples{ 20 | material_colors() 21 | 22 | material_colors("indigo", "lime") 23 | } 24 | -------------------------------------------------------------------------------- /man/metro_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_metro.R 3 | \name{metro_colors} 4 | \alias{metro_colors} 5 | \title{Extract Metro colors as hex codes} 6 | \usage{ 7 | metro_colors(...) 8 | } 9 | \arguments{ 10 | \item{...}{Character names of colors.} 11 | } 12 | \value{ 13 | A character vector with color-codes. 14 | } 15 | \description{ 16 | Can be used to get the hex code of specific colors from the Metro color 17 | palette. Use \code{metro_colors()} to see all available colors. 18 | } 19 | \examples{ 20 | metro_colors() 21 | 22 | metro_colors("dark red", "teal") 23 | } 24 | -------------------------------------------------------------------------------- /man/okabeito_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_okabeito.R 3 | \name{okabeito_colors} 4 | \alias{okabeito_colors} 5 | \alias{oi_colors} 6 | \title{Extract Okabe-Ito colors as hex codes} 7 | \usage{ 8 | okabeito_colors(..., original_names = FALSE, black_first = FALSE, amber = TRUE) 9 | 10 | oi_colors(..., original_names = FALSE, black_first = FALSE, amber = TRUE) 11 | } 12 | \arguments{ 13 | \item{...}{Character names of colors.} 14 | 15 | \item{original_names}{Logical. Should the colors be named using the original 16 | names used by Okabe and Ito (2008), such as "vermillion" (\code{TRUE}), or 17 | simplified names, such as "red" (\code{FALSE}, default)? 18 | Only used if no colors are specified (to see all available colors).} 19 | 20 | \item{black_first}{Logical. Should black be first (\code{TRUE}) or last (\code{FALSE}, default) 21 | in the color palette? Only used if no colors are specified (to see all 22 | available colors).} 23 | 24 | \item{amber}{If amber color should replace yellow in the palette.} 25 | } 26 | \value{ 27 | A character vector with color-codes. 28 | } 29 | \description{ 30 | Can be used to get the hex code of specific colors from the Okabe-Ito palette. 31 | Use \code{okabeito_colors()} to see all available colors. 32 | } 33 | \examples{ 34 | okabeito_colors() 35 | 36 | okabeito_colors(c("red", "light blue", "orange")) 37 | 38 | okabeito_colors(original_names = TRUE) 39 | 40 | okabeito_colors(black_first = TRUE) 41 | } 42 | -------------------------------------------------------------------------------- /man/palette_bluebrown.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_bluebrown.R 3 | \name{palette_bluebrown} 4 | \alias{palette_bluebrown} 5 | \title{Blue-brown design color palette} 6 | \usage{ 7 | palette_bluebrown(palette = "contrast", reverse = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{palette}{Character name of palette. Depending on the color scale, can 11 | be one of \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, \code{"contrast"}, 12 | \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, or 13 | \code{black_first_original}. The latter three options are especially for the 14 | Okabe-Ito color palette. The default is \code{NULL} and either \code{"contrast"} or 15 | \code{"gradient"} is used (depending on whether \code{discrete} is \code{TRUE} or \code{FALSE}), 16 | which are the two scale useful for discrete or gradient color scales, 17 | respectively.} 18 | 19 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 20 | 21 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 22 | } 23 | \description{ 24 | The palette based on blue-brown colors. 25 | } 26 | \details{ 27 | This function is usually not called directly, but from within 28 | \code{\link[=scale_color_bluebrown]{scale_color_bluebrown()}}. 29 | } 30 | -------------------------------------------------------------------------------- /man/palette_colorhex.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_colorhex.R 3 | \name{palette_colorhex} 4 | \alias{palette_colorhex} 5 | \title{Color palettes from \url{https://www.color-hex.com/}} 6 | \usage{ 7 | palette_colorhex(palette = 1014416, reverse = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{palette}{The numeric code for a palette at \url{https://www.color-hex.com/}. 11 | For example, \code{1014416} for the 12 | \href{https://www.color-hex.com/color-palette/1014416}{Josiah color palette (number 1014416)}.} 13 | 14 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 15 | 16 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 17 | } 18 | \description{ 19 | This function downloads a requested color palette from \url{https://www.color-hex.com/}. 20 | This website provides a large number of user-submitted color palettes. 21 | } 22 | \details{ 23 | This function is usually not called directly, but from within 24 | \code{\link[=scale_color_colorhex]{scale_color_colorhex()}}. 25 | } 26 | \note{ 27 | The default \href{https://www.color-hex.com/color-palette/1014416}{Josiah color palette (number 1014416)} 28 | is available without an internet connection. All other color palettes require 29 | an internet connection to download and access. 30 | } 31 | -------------------------------------------------------------------------------- /man/palette_flat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_flat.R 3 | \name{palette_flat} 4 | \alias{palette_flat} 5 | \title{Flat UI color palette} 6 | \usage{ 7 | palette_flat(palette = "contrast", reverse = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{palette}{Character name of palette. Depending on the color scale, can 11 | be one of \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, \code{"contrast"}, 12 | \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, or 13 | \code{black_first_original}. The latter three options are especially for the 14 | Okabe-Ito color palette. The default is \code{NULL} and either \code{"contrast"} or 15 | \code{"gradient"} is used (depending on whether \code{discrete} is \code{TRUE} or \code{FALSE}), 16 | which are the two scale useful for discrete or gradient color scales, 17 | respectively.} 18 | 19 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 20 | 21 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 22 | } 23 | \description{ 24 | The palette based on \href{https://materialui.co/flatuicolors}{Flat UI}. 25 | } 26 | \details{ 27 | This function is usually not called directly, but from within 28 | \code{\link[=scale_color_flat]{scale_color_flat()}}. 29 | } 30 | -------------------------------------------------------------------------------- /man/palette_material.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_material.R 3 | \name{palette_material} 4 | \alias{palette_material} 5 | \title{Material design color palette} 6 | \usage{ 7 | palette_material(palette = "contrast", reverse = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{palette}{Character name of palette. Depending on the color scale, can 11 | be one of \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, \code{"contrast"}, 12 | \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, or 13 | \code{black_first_original}. The latter three options are especially for the 14 | Okabe-Ito color palette. The default is \code{NULL} and either \code{"contrast"} or 15 | \code{"gradient"} is used (depending on whether \code{discrete} is \code{TRUE} or \code{FALSE}), 16 | which are the two scale useful for discrete or gradient color scales, 17 | respectively.} 18 | 19 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 20 | 21 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 22 | } 23 | \description{ 24 | The palette based on \href{https://materialui.co/}{material design colors}. 25 | } 26 | \details{ 27 | This function is usually not called directly, but from within 28 | \code{\link[=scale_color_material]{scale_color_material()}}. 29 | } 30 | -------------------------------------------------------------------------------- /man/palette_metro.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_metro.R 3 | \name{palette_metro} 4 | \alias{palette_metro} 5 | \title{Metro color palette} 6 | \usage{ 7 | palette_metro(palette = "complement", reverse = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{palette}{Character name of palette. Depending on the color scale, can 11 | be one of \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, \code{"contrast"}, 12 | \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, or 13 | \code{black_first_original}. The latter three options are especially for the 14 | Okabe-Ito color palette. The default is \code{NULL} and either \code{"contrast"} or 15 | \code{"gradient"} is used (depending on whether \code{discrete} is \code{TRUE} or \code{FALSE}), 16 | which are the two scale useful for discrete or gradient color scales, 17 | respectively.} 18 | 19 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 20 | 21 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 22 | } 23 | \description{ 24 | The palette based on \href{https://materialui.co/metrocolors}{Metro colors}. 25 | } 26 | \details{ 27 | This function is usually not called directly, but from within 28 | \code{\link[=scale_color_metro]{scale_color_metro()}}. 29 | } 30 | -------------------------------------------------------------------------------- /man/palette_okabeito.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_okabeito.R 3 | \name{palette_okabeito} 4 | \alias{palette_okabeito} 5 | \alias{palette_oi} 6 | \title{Okabe-Ito color palette} 7 | \usage{ 8 | palette_okabeito(palette = "full_amber", reverse = FALSE, order = 1:9, ...) 9 | 10 | palette_oi(palette = "full_amber", reverse = FALSE, order = 1:9, ...) 11 | } 12 | \arguments{ 13 | \item{palette}{Character name of palette. Depending on the color scale, can 14 | be one of \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, \code{"contrast"}, 15 | \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, or 16 | \code{black_first_original}. The latter three options are especially for the 17 | Okabe-Ito color palette. The default is \code{NULL} and either \code{"contrast"} or 18 | \code{"gradient"} is used (depending on whether \code{discrete} is \code{TRUE} or \code{FALSE}), 19 | which are the two scale useful for discrete or gradient color scales, 20 | respectively.} 21 | 22 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 23 | 24 | \item{order}{A vector of numbers from 1 to 9 indicating the order of colors to use 25 | (default: \code{1:9})} 26 | 27 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 28 | } 29 | \description{ 30 | The palette based proposed by Okabe and Ito (2008). 31 | } 32 | \details{ 33 | This function is usually not called directly, but from within 34 | \code{\link[=scale_color_material]{scale_color_material()}}. 35 | } 36 | \references{ 37 | Okabe, M., & Ito, K. (2008). Color universal design (CUD): 38 | How to make figures and presentations that are friendly to colorblind people. 39 | https://jfly.uni-koeln.de/color/#pallet (Original work published 2002) 40 | } 41 | -------------------------------------------------------------------------------- /man/palette_pizza.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_pizza.R 3 | \name{palette_pizza} 4 | \alias{palette_pizza} 5 | \title{Pizza color palette} 6 | \usage{ 7 | palette_pizza(palette = "margherita", reverse = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{palette}{Pizza type. Can be \code{"margherita"} (default), \code{"margherita crust"}, 11 | \code{"diavola"} or \code{"diavola crust"}.} 12 | 13 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 14 | 15 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 16 | } 17 | \description{ 18 | The palette based on authentic neapolitan pizzas. 19 | } 20 | \details{ 21 | This function is usually not called directly, but from within 22 | \code{\link[=scale_color_pizza]{scale_color_pizza()}}. 23 | } 24 | -------------------------------------------------------------------------------- /man/palette_see.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_see.R 3 | \name{palette_see} 4 | \alias{palette_see} 5 | \title{See design color palette} 6 | \usage{ 7 | palette_see(palette = "contrast", reverse = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{palette}{Character name of palette. Depending on the color scale, can 11 | be one of \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, \code{"contrast"}, 12 | \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, or 13 | \code{black_first_original}. The latter three options are especially for the 14 | Okabe-Ito color palette. The default is \code{NULL} and either \code{"contrast"} or 15 | \code{"gradient"} is used (depending on whether \code{discrete} is \code{TRUE} or \code{FALSE}), 16 | which are the two scale useful for discrete or gradient color scales, 17 | respectively.} 18 | 19 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 20 | 21 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 22 | } 23 | \description{ 24 | See design color palette 25 | } 26 | \details{ 27 | This function is usually not called directly, but from within 28 | \code{\link[=scale_color_see]{scale_color_see()}}. 29 | } 30 | -------------------------------------------------------------------------------- /man/palette_social.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_social.R 3 | \name{palette_social} 4 | \alias{palette_social} 5 | \title{Social color palette} 6 | \usage{ 7 | palette_social(palette = "complement", reverse = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{palette}{Character name of palette. Depending on the color scale, can 11 | be one of \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, \code{"contrast"}, 12 | \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, or 13 | \code{black_first_original}. The latter three options are especially for the 14 | Okabe-Ito color palette. The default is \code{NULL} and either \code{"contrast"} or 15 | \code{"gradient"} is used (depending on whether \code{discrete} is \code{TRUE} or \code{FALSE}), 16 | which are the two scale useful for discrete or gradient color scales, 17 | respectively.} 18 | 19 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 20 | 21 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 22 | } 23 | \description{ 24 | The palette based \href{https://materialui.co/socialcolors}{Social colors}. 25 | } 26 | \details{ 27 | This function is usually not called directly, but from within 28 | \code{\link[=scale_color_social]{scale_color_social()}}. 29 | } 30 | -------------------------------------------------------------------------------- /man/pizza_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_pizza.R 3 | \name{pizza_colors} 4 | \alias{pizza_colors} 5 | \title{Extract pizza colors as hex codes} 6 | \usage{ 7 | pizza_colors(...) 8 | } 9 | \arguments{ 10 | \item{...}{Character names of pizza ingredients.} 11 | } 12 | \value{ 13 | A character vector with color-codes. 14 | } 15 | \description{ 16 | Extract pizza colors as hex codes 17 | } 18 | -------------------------------------------------------------------------------- /man/plot.datawizard_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.dw_data_tabulate.R 3 | \name{plot.datawizard_tables} 4 | \alias{plot.datawizard_tables} 5 | \alias{plot.datawizard_table} 6 | \title{Plot tabulated data.} 7 | \usage{ 8 | \method{plot}{datawizard_tables}( 9 | x, 10 | label_values = TRUE, 11 | show_na = "if_any", 12 | na_label = "(Missing)", 13 | error_bar = TRUE, 14 | ci = 0.95, 15 | color_fill = "#87CEFA", 16 | color_error_bar = "#607B8B", 17 | ... 18 | ) 19 | 20 | \method{plot}{datawizard_table}( 21 | x, 22 | label_values = TRUE, 23 | show_na = "if_any", 24 | na_label = "(Missing)", 25 | error_bar = TRUE, 26 | ci = 0.95, 27 | color_fill = "#87CEFA", 28 | color_error_bar = "#607B8B", 29 | ... 30 | ) 31 | } 32 | \arguments{ 33 | \item{x}{Object created by \code{datawizard::data_tabulate()}.} 34 | 35 | \item{label_values}{Logical. Should values and percentages be displayed at the 36 | top of each bar.} 37 | 38 | \item{show_na}{Should missing values be dropped? Can be \code{"if_any"} (default) 39 | to show the missing category only if any missing values are present, 40 | \code{"always"} to always show the missing category, or \code{"never"} to never show 41 | the missing category.} 42 | 43 | \item{na_label}{The label given to missing values when they are shown.} 44 | 45 | \item{error_bar}{Logical. Should error bars be displayed? If \code{TRUE}, 46 | confidence intervals computed using the Wilson method are shown. See Brown 47 | et al. (2001) for details.} 48 | 49 | \item{ci}{Confidence Interval (CI) level. Defaults to \code{0.95} (\verb{95\%}).} 50 | 51 | \item{color_fill}{Color to use for category columns (default: \code{"#87CEFA"}).} 52 | 53 | \item{color_error_bar}{Color to use for error bars (default: \code{"#607B8B"}).} 54 | 55 | \item{...}{Unused} 56 | } 57 | \description{ 58 | Plot tabulated data. 59 | } 60 | \references{ 61 | Brown, L. D., Cai, T. T., & Dasgupta, A. (2001). 62 | Interval estimation for a binomial proportion. 63 | \emph{Statistical Science}, \emph{16}(2), 101-133. \doi{10.1214/ss/1009213286} 64 | } 65 | -------------------------------------------------------------------------------- /man/plot.see_bayesfactor_models.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.bayesfactor_models.R 3 | \name{plot.see_bayesfactor_models} 4 | \alias{plot.see_bayesfactor_models} 5 | \title{Plot method for Bayes Factors for model comparison} 6 | \usage{ 7 | \method{plot}{see_bayesfactor_models}( 8 | x, 9 | n_pies = c("one", "many"), 10 | value = c("none", "BF", "probability"), 11 | sort = FALSE, 12 | log = FALSE, 13 | prior_odds = NULL, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{An object.} 19 | 20 | \item{n_pies}{Number of pies.} 21 | 22 | \item{value}{What value to display.} 23 | 24 | \item{sort}{The behavior of this argument depends on the plotting contexts. 25 | \itemize{ 26 | \item \emph{Plotting model parameters}: 27 | If \code{NULL}, coefficients are plotted in the order as they appear in the 28 | summary. Setting \code{sort = "ascending"} or \code{sort = "descending"} sorts 29 | coefficients in ascending or descending order, respectively. 30 | Setting \code{sort = TRUE} is the same as \code{sort = "ascending"}. 31 | \item \emph{Plotting Bayes factors}: 32 | Sort pie-slices by posterior probability (descending)? 33 | }} 34 | 35 | \item{log}{Logical that decides whether to display log-transformed Bayes 36 | factors.} 37 | 38 | \item{prior_odds}{An optional vector of prior odds for the models. See 39 | \code{BayesFactor::priorOdds}. As the size of the pizza slices corresponds to 40 | posterior probability (which is a function of prior probability and the 41 | Bayes Factor), custom \code{prior_odds} will change the slices' size.} 42 | 43 | \item{...}{Arguments passed to or from other methods.} 44 | } 45 | \value{ 46 | A ggplot2-object. 47 | } 48 | \description{ 49 | The \code{plot()} method for the \code{bayestestR::bayesfactor_models()} function. 50 | These plots visualize the \strong{posterior probabilities} of the compared models. 51 | } 52 | \examples{ 53 | library(bayestestR) 54 | library(see) 55 | 56 | lm0 <- lm(qsec ~ 1, data = mtcars) 57 | lm1 <- lm(qsec ~ drat, data = mtcars) 58 | lm2 <- lm(qsec ~ wt, data = mtcars) 59 | lm3 <- lm(qsec ~ drat + wt, data = mtcars) 60 | 61 | result <- bayesfactor_models(lm1, lm2, lm3, denominator = lm0) 62 | 63 | plot(result, n_pies = "one", value = "probability", sort = TRUE) + 64 | scale_fill_pizza(reverse = TRUE) 65 | 66 | plot(result, n_pies = "many", value = "BF", log = TRUE) + 67 | scale_fill_pizza(reverse = FALSE) 68 | } 69 | -------------------------------------------------------------------------------- /man/plot.see_bayesfactor_parameters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.bayesfactor_parameters.R 3 | \name{plot.see_bayesfactor_parameters} 4 | \alias{plot.see_bayesfactor_parameters} 5 | \title{Plot method for Bayes Factors for a single parameter} 6 | \usage{ 7 | \method{plot}{see_bayesfactor_parameters}( 8 | x, 9 | size_point = 2, 10 | color_rope = "#0171D3", 11 | alpha_rope = 0.2, 12 | show_intercept = FALSE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{x}{An object.} 18 | 19 | \item{size_point}{Numeric specifying size of point-geoms.} 20 | 21 | \item{color_rope}{Character specifying color of ROPE ribbon.} 22 | 23 | \item{alpha_rope}{Numeric specifying transparency level of ROPE ribbon.} 24 | 25 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 26 | in the plot. By default, it is hidden because in many cases the 27 | intercept-parameter has a posterior distribution on a very different 28 | location, so density curves of posterior distributions for other parameters 29 | are hardly visible.} 30 | 31 | \item{...}{Arguments passed to or from other methods.} 32 | } 33 | \value{ 34 | A ggplot2-object. 35 | } 36 | \description{ 37 | The \code{plot()} method for the \code{bayestestR::bayesfactor_parameters()} function. 38 | } 39 | -------------------------------------------------------------------------------- /man/plot.see_check_collinearity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_collinearity.R 3 | \name{plot.see_check_collinearity} 4 | \alias{plot.see_check_collinearity} 5 | \title{Plot method for multicollinearity checks} 6 | \usage{ 7 | \method{plot}{see_check_collinearity}( 8 | x, 9 | data = NULL, 10 | colors = c("#3aaf85", "#1b6ca8", "#cd201f"), 11 | size_point = 3.5, 12 | linewidth = 0.8, 13 | size_title = 12, 14 | size_axis_title = base_size, 15 | base_size = 10, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{x}{An object.} 21 | 22 | \item{data}{The original data used to create this object. Can be a 23 | statistical model.} 24 | 25 | \item{colors}{Character vector of length two, indicating the colors (in 26 | hex-format) for points and line.} 27 | 28 | \item{size_point}{Numeric specifying size of point-geoms.} 29 | 30 | \item{linewidth}{Numeric value specifying size of line geoms.} 31 | 32 | \item{base_size, size_axis_title, size_title}{Numeric value specifying size of 33 | axis and plot titles.} 34 | 35 | \item{...}{Arguments passed to or from other methods.} 36 | } 37 | \value{ 38 | A ggplot2-object. 39 | } 40 | \description{ 41 | The \code{plot()} method for the \code{performance::check_collinearity()} function. 42 | } 43 | \examples{ 44 | library(performance) 45 | m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 46 | result <- check_collinearity(m) 47 | result 48 | plot(result) 49 | 50 | } 51 | -------------------------------------------------------------------------------- /man/plot.see_check_dag.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_dag.R 3 | \name{plot.see_check_dag} 4 | \alias{plot.see_check_dag} 5 | \title{Plot method for check DAGs} 6 | \usage{ 7 | \method{plot}{see_check_dag}( 8 | x, 9 | size_point = 20, 10 | size_text = 4.5, 11 | colors = NULL, 12 | which = "all", 13 | effect = "total", 14 | check_colliders = TRUE, 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{x}{A \code{check_dag} object.} 20 | 21 | \item{size_point}{Numeric value specifying size of point geoms.} 22 | 23 | \item{size_text}{Numeric value specifying size of text elements.} 24 | 25 | \item{colors}{Character vector of length five, indicating the colors (in 26 | hex-format) for different types of variables, which are assigned in following 27 | order: \code{outcome}, \code{exposure}, \code{adjusted}, \code{unadjusted}, and \code{collider}.} 28 | 29 | \item{which}{Character string indicating which plot to show. Can be either 30 | \code{"all"}, \code{"current"} or \code{"required"}.} 31 | 32 | \item{effect}{Character string indicating which effect for the required model 33 | is to be estimated. Can be either \code{"total"} or \code{"direct"}.} 34 | 35 | \item{check_colliders}{Logical indicating whether to highlight colliders. 36 | Set to \code{FALSE} if the algorithm to detect colliders is very slow.} 37 | 38 | \item{...}{Currently not used.} 39 | } 40 | \value{ 41 | A ggplot2-object. 42 | } 43 | \description{ 44 | The \code{plot()} method for the \code{performance::check_dag()} function. 45 | } 46 | \examples{ 47 | \dontshow{if (require("ggdag", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 48 | library(performance) 49 | # incorrect adjustment 50 | dag <- check_dag( 51 | y ~ x + b + c, 52 | x ~ b, 53 | outcome = "y", 54 | exposure = "x" 55 | ) 56 | dag 57 | plot(dag) 58 | 59 | # plot only model with required adjustments 60 | plot(dag, which = "required") 61 | 62 | # collider-bias? 63 | dag <- check_dag( 64 | y ~ x + c + d, 65 | x ~ c + d, 66 | b ~ x, 67 | b ~ y, 68 | outcome = "y", 69 | exposure = "x", 70 | adjusted = "c" 71 | ) 72 | plot(dag) 73 | 74 | # longer labels, automatic detection of outcome and exposure 75 | dag <- check_dag( 76 | QoL ~ age + education + gender, 77 | age ~ education 78 | ) 79 | plot(dag) 80 | \dontshow{\}) # examplesIf} 81 | } 82 | -------------------------------------------------------------------------------- /man/plot.see_check_distribution.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_distribution.R 3 | \name{plot.see_check_distribution} 4 | \alias{plot.see_check_distribution} 5 | \title{Plot method for classifying the distribution of a model-family} 6 | \usage{ 7 | \method{plot}{see_check_distribution}(x, size_point = 2, panel = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object.} 11 | 12 | \item{size_point}{Numeric specifying size of point-geoms.} 13 | 14 | \item{panel}{Logical, if \code{TRUE}, plots are arranged as panels; else, 15 | single plots are returned.} 16 | 17 | \item{...}{Arguments passed to or from other methods.} 18 | } 19 | \value{ 20 | A ggplot2-object. 21 | } 22 | \description{ 23 | The \code{plot()} method for the \code{performance::check_distribution()} 24 | function. 25 | } 26 | \examples{ 27 | \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && require("randomForest")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 28 | library(performance) 29 | m <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 30 | result <- check_distribution(m) 31 | result 32 | plot(result) 33 | \dontshow{\}) # examplesIf} 34 | } 35 | -------------------------------------------------------------------------------- /man/plot.see_check_heteroscedasticity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_heteroscedasticity.R 3 | \name{plot.see_check_heteroscedasticity} 4 | \alias{plot.see_check_heteroscedasticity} 5 | \title{Plot method for (non-)constant error variance checks} 6 | \usage{ 7 | \method{plot}{see_check_heteroscedasticity}( 8 | x, 9 | data = NULL, 10 | size_point = 2, 11 | linewidth = 0.8, 12 | size_title = 12, 13 | size_axis_title = base_size, 14 | base_size = 10, 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{x}{An object.} 20 | 21 | \item{data}{The original data used to create this object. Can be a 22 | statistical model.} 23 | 24 | \item{size_point}{Numeric specifying size of point-geoms.} 25 | 26 | \item{linewidth}{Numeric value specifying size of line geoms.} 27 | 28 | \item{base_size, size_axis_title, size_title}{Numeric value specifying size of 29 | axis and plot titles.} 30 | 31 | \item{...}{Arguments passed to or from other methods.} 32 | } 33 | \value{ 34 | A ggplot2-object. 35 | } 36 | \description{ 37 | The \code{plot()} method for the 38 | \code{performance::check_heteroscedasticity()} function. 39 | } 40 | \examples{ 41 | m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 42 | result <- performance::check_heteroscedasticity(m) 43 | result 44 | plot(result, data = m) # data required for pkgdown 45 | } 46 | \seealso{ 47 | See also the vignette about \href{https://easystats.github.io/performance/articles/check_model.html}{\code{check_model()}}. 48 | } 49 | -------------------------------------------------------------------------------- /man/plot.see_check_homogeneity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_homogeneity.R 3 | \name{plot.see_check_homogeneity} 4 | \alias{plot.see_check_homogeneity} 5 | \title{Plot method for homogeneity of variances checks} 6 | \usage{ 7 | \method{plot}{see_check_homogeneity}(x, data = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object.} 11 | 12 | \item{data}{The original data used to create this object. Can be a 13 | statistical model.} 14 | 15 | \item{...}{Arguments passed to or from other methods.} 16 | } 17 | \value{ 18 | A ggplot2-object. 19 | } 20 | \description{ 21 | The \code{plot()} method for the \code{performance::check_homogeneity()} 22 | function. 23 | } 24 | \examples{ 25 | library(performance) 26 | 27 | model <<- lm(len ~ supp + dose, data = ToothGrowth) 28 | result <- check_homogeneity(model) 29 | result 30 | plot(result) 31 | 32 | } 33 | -------------------------------------------------------------------------------- /man/plot.see_check_model.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_model.R 3 | \name{plot.see_check_model} 4 | \alias{plot.see_check_model} 5 | \title{Plot method for checking model assumptions} 6 | \usage{ 7 | \method{plot}{see_check_model}( 8 | x, 9 | style = theme_lucid, 10 | colors = NULL, 11 | type = c("density", "discrete_dots", "discrete_interval", "discrete_both"), 12 | n_columns = 2, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{x}{An object.} 18 | 19 | \item{style}{A ggplot2-theme.} 20 | 21 | \item{colors}{Character vector of length two, indicating the colors (in 22 | hex-format) for points and line.} 23 | 24 | \item{type}{Plot type for the posterior predictive checks plot. Can be \code{"density"} 25 | (default), \code{"discrete_dots"}, \code{"discrete_interval"} or \code{"discrete_both"} (the 26 | \verb{discrete_*} options are appropriate for models with discrete - binary, integer 27 | or ordinal etc. - outcomes).} 28 | 29 | \item{n_columns}{Number of columns to align plots.} 30 | 31 | \item{...}{Arguments passed to or from other methods.} 32 | } 33 | \value{ 34 | A ggplot2-object. 35 | } 36 | \description{ 37 | The \code{plot()} method for the \code{performance::check_model()} function. 38 | Diagnostic plots for regression models. 39 | } 40 | \examples{ 41 | \dontshow{if (require("patchwork")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 42 | library(performance) 43 | 44 | model <- lm(qsec ~ drat + wt, data = mtcars) 45 | plot(check_model(model)) 46 | \dontshow{\}) # examplesIf} 47 | } 48 | \seealso{ 49 | See also the vignette about \href{https://easystats.github.io/performance/articles/check_model.html}{\code{check_model()}}. 50 | } 51 | -------------------------------------------------------------------------------- /man/plot.see_check_normality.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_normality.R 3 | \name{plot.see_check_normality} 4 | \alias{plot.see_check_normality} 5 | \title{Plot method for check model for (non-)normality of residuals} 6 | \usage{ 7 | \method{plot}{see_check_normality}( 8 | x, 9 | type = c("qq", "pp", "density"), 10 | data = NULL, 11 | linewidth = 0.8, 12 | size_point = 2, 13 | size_title = 12, 14 | size_axis_title = base_size, 15 | base_size = 10, 16 | alpha = 0.2, 17 | alpha_dot = 0.8, 18 | colors = c("#3aaf85", "#1b6ca8"), 19 | detrend = TRUE, 20 | method = "ell", 21 | ... 22 | ) 23 | } 24 | \arguments{ 25 | \item{x}{An object.} 26 | 27 | \item{type}{Character vector, indicating the type of plot. 28 | Options are \code{"qq"} (default) for quantile-quantile (Q-Q) plots, 29 | \code{"pp"} for probability-probability (P-P) plots, or 30 | \code{"density"} for density overlay plots.} 31 | 32 | \item{data}{The original data used to create this object. Can be a 33 | statistical model.} 34 | 35 | \item{linewidth}{Numeric value specifying size of line geoms.} 36 | 37 | \item{size_point}{Numeric specifying size of point-geoms.} 38 | 39 | \item{base_size, size_axis_title, size_title}{Numeric value specifying size of 40 | axis and plot titles.} 41 | 42 | \item{alpha}{Numeric value specifying alpha level of the confidence bands.} 43 | 44 | \item{alpha_dot}{Numeric value specifying alpha level of the point geoms.} 45 | 46 | \item{colors}{Character vector of length two, indicating the colors (in 47 | hex-format) for points and line.} 48 | 49 | \item{detrend}{Logical that decides if Q-Q and P-P plots should be de-trended 50 | (also known as \emph{worm plots}).} 51 | 52 | \item{method}{The method used for estimating the qq/pp bands. Default to 53 | \code{"ell"} (equal local levels / simultaneous testing - recommended). Can also 54 | be one of \code{"pointwise"} or \code{"boot"} for pointwise confidence bands, or 55 | \code{"ks"} or \code{"ts"} for simultaneous testing. See \code{qqplotr::stat_qq_band()} 56 | for details.} 57 | 58 | \item{...}{Arguments passed to or from other methods.} 59 | } 60 | \value{ 61 | A ggplot2-object. 62 | } 63 | \description{ 64 | The \code{plot()} method for the \code{performance::check_normality()} 65 | function. 66 | } 67 | \examples{ 68 | library(performance) 69 | 70 | m <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 71 | result <- check_normality(m) 72 | plot(result) 73 | 74 | \dontshow{if (require("qqplotr")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 75 | plot(result, type = "qq", detrend = TRUE) 76 | \dontshow{\}) # examplesIf} 77 | } 78 | \seealso{ 79 | See also the vignette about \href{https://easystats.github.io/performance/articles/check_model.html}{\code{check_model()}}. 80 | } 81 | -------------------------------------------------------------------------------- /man/plot.see_check_outliers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_outliers.R 3 | \name{plot.see_check_outliers} 4 | \alias{plot.see_check_outliers} 5 | \title{Plot method for checking outliers} 6 | \usage{ 7 | \method{plot}{see_check_outliers}( 8 | x, 9 | size_text = 3.5, 10 | linewidth = 0.8, 11 | size_title = 12, 12 | size_axis_title = base_size, 13 | base_size = 10, 14 | alpha_dot = 0.8, 15 | colors = c("#3aaf85", "#1b6ca8", "#cd201f"), 16 | rescale_distance = TRUE, 17 | type = c("dots", "bars"), 18 | show_labels = TRUE, 19 | ... 20 | ) 21 | } 22 | \arguments{ 23 | \item{x}{An object.} 24 | 25 | \item{size_text}{Numeric value specifying size of text labels.} 26 | 27 | \item{linewidth}{Numeric value specifying size of line geoms.} 28 | 29 | \item{base_size, size_axis_title, size_title}{Numeric value specifying size of 30 | axis and plot titles.} 31 | 32 | \item{alpha_dot}{Numeric value specifying alpha level of the point geoms.} 33 | 34 | \item{colors}{Character vector of length two, indicating the colors (in 35 | hex-format) for points and line.} 36 | 37 | \item{rescale_distance}{Logical. If \code{TRUE}, distance values are rescaled 38 | to a range from 0 to 1. This is mainly due to better catch the differences 39 | between distance values.} 40 | 41 | \item{type}{Character vector, indicating the type of plot. 42 | Options are \code{"dots"} (default) for a scatterplot of leverage (hat) values 43 | versus residuals, with Cook's Distance contours for evaluating influential 44 | points, or \code{"bars"} for a bar chart of (rescaled) outlier statistic values 45 | for each data point. Only used for outlier plots of fitted models; for 46 | outlier plots of raw data values, \code{type = "bars"} is always used.} 47 | 48 | \item{show_labels}{Logical. If \code{TRUE}, text labels are displayed.} 49 | 50 | \item{...}{Arguments passed to or from other methods.} 51 | } 52 | \value{ 53 | A ggplot2-object. 54 | } 55 | \description{ 56 | The \code{plot()} method for the \code{performance::check_outliers()} 57 | function. 58 | } 59 | \examples{ 60 | library(performance) 61 | data(mtcars) 62 | mt1 <- mtcars[, c(1, 3, 4)] 63 | mt2 <- rbind( 64 | mt1, 65 | data.frame(mpg = c(37, 40), disp = c(300, 400), hp = c(110, 120)) 66 | ) 67 | model <- lm(disp ~ mpg + hp, data = mt2) 68 | plot(check_outliers(model)) 69 | } 70 | -------------------------------------------------------------------------------- /man/plot.see_compare_parameters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.compare_parameters.R 3 | \name{plot.see_compare_parameters} 4 | \alias{plot.see_compare_parameters} 5 | \title{Plot method for comparison of model parameters} 6 | \usage{ 7 | \method{plot}{see_compare_parameters}( 8 | x, 9 | show_intercept = FALSE, 10 | size_point = 0.8, 11 | size_text = NA, 12 | dodge_position = 0.8, 13 | sort = NULL, 14 | n_columns = NULL, 15 | show_labels = FALSE, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{x}{An object.} 21 | 22 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 23 | in the plot. By default, it is hidden because in many cases the 24 | intercept-parameter has a posterior distribution on a very different 25 | location, so density curves of posterior distributions for other parameters 26 | are hardly visible.} 27 | 28 | \item{size_point}{Numeric specifying size of point-geoms.} 29 | 30 | \item{size_text}{Numeric value specifying size of text labels.} 31 | 32 | \item{dodge_position}{Numeric value specifying the amount of "dodging" 33 | (spacing) between geoms.} 34 | 35 | \item{sort}{The behavior of this argument depends on the plotting contexts. 36 | \itemize{ 37 | \item \emph{Plotting model parameters}: 38 | If \code{NULL}, coefficients are plotted in the order as they appear in the 39 | summary. Setting \code{sort = "ascending"} or \code{sort = "descending"} sorts 40 | coefficients in ascending or descending order, respectively. 41 | Setting \code{sort = TRUE} is the same as \code{sort = "ascending"}. 42 | \item \emph{Plotting Bayes factors}: 43 | Sort pie-slices by posterior probability (descending)? 44 | }} 45 | 46 | \item{n_columns}{For models with multiple components (like fixed and random, 47 | count and zero-inflated), defines the number of columns for the 48 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 49 | 50 | \item{show_labels}{Logical. If \code{TRUE}, text labels are displayed.} 51 | 52 | \item{...}{Arguments passed to or from other methods.} 53 | } 54 | \value{ 55 | A ggplot2-object. 56 | } 57 | \description{ 58 | The \code{plot()} method for the \code{parameters::compare_parameters()} 59 | function. 60 | } 61 | \examples{ 62 | data(iris) 63 | lm1 <- lm(Sepal.Length ~ Species, data = iris) 64 | lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris) 65 | lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris) 66 | result <- parameters::compare_parameters(lm1, lm2, lm3) 67 | plot(result) 68 | } 69 | -------------------------------------------------------------------------------- /man/plot.see_compare_performance.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.compare_performance.R 3 | \name{plot.see_compare_performance} 4 | \alias{plot.see_compare_performance} 5 | \title{Plot method for comparing model performances} 6 | \usage{ 7 | \method{plot}{see_compare_performance}(x, linewidth = 1, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object.} 11 | 12 | \item{linewidth}{Numeric value specifying size of line geoms.} 13 | 14 | \item{...}{Arguments passed to or from other methods.} 15 | } 16 | \value{ 17 | A ggplot2-object. 18 | } 19 | \description{ 20 | The \code{plot()} method for the \code{performance::compare_performance()} function. 21 | } 22 | \examples{ 23 | library(performance) 24 | data(iris) 25 | lm1 <- lm(Sepal.Length ~ Species, data = iris) 26 | lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris) 27 | lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris) 28 | result <- compare_performance(lm1, lm2, lm3) 29 | result 30 | plot(result) 31 | 32 | } 33 | -------------------------------------------------------------------------------- /man/plot.see_effectsize_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.effectsize_table.R 3 | \name{plot.see_effectsize_table} 4 | \alias{plot.see_effectsize_table} 5 | \title{Plot method for effect size tables} 6 | \usage{ 7 | \method{plot}{see_effectsize_table}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object.} 11 | 12 | \item{...}{Arguments passed to or from other methods.} 13 | } 14 | \value{ 15 | A ggplot2-object. 16 | } 17 | \description{ 18 | The \code{plot()} method for the \code{effectsize::effectsize()} function. 19 | } 20 | \examples{ 21 | library(effectsize) 22 | m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars) 23 | result <- eta_squared(m) 24 | plot(result) 25 | } 26 | -------------------------------------------------------------------------------- /man/plot.see_equivalence_test.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.effectsize_table.R, 3 | % R/plot.equivalence_test.R 4 | \name{plot.see_equivalence_test_effectsize} 5 | \alias{plot.see_equivalence_test_effectsize} 6 | \alias{plot.see_equivalence_test} 7 | \alias{plot.see_equivalence_test_lm} 8 | \title{Plot method for (conditional) equivalence testing} 9 | \usage{ 10 | \method{plot}{see_equivalence_test_effectsize}(x, ...) 11 | 12 | \method{plot}{see_equivalence_test}( 13 | x, 14 | color_rope = "#0171D3", 15 | alpha_rope = 0.2, 16 | show_intercept = FALSE, 17 | n_columns = 1, 18 | ... 19 | ) 20 | 21 | \method{plot}{see_equivalence_test_lm}( 22 | x, 23 | size_point = 0.7, 24 | color_rope = "#0171D3", 25 | alpha_rope = 0.2, 26 | show_intercept = FALSE, 27 | n_columns = 1, 28 | ... 29 | ) 30 | } 31 | \arguments{ 32 | \item{x}{An object.} 33 | 34 | \item{...}{Arguments passed to or from other methods.} 35 | 36 | \item{color_rope}{Character specifying color of ROPE ribbon.} 37 | 38 | \item{alpha_rope}{Numeric specifying transparency level of ROPE ribbon.} 39 | 40 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 41 | in the plot. By default, it is hidden because in many cases the 42 | intercept-parameter has a posterior distribution on a very different 43 | location, so density curves of posterior distributions for other parameters 44 | are hardly visible.} 45 | 46 | \item{n_columns}{For models with multiple components (like fixed and random, 47 | count and zero-inflated), defines the number of columns for the 48 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 49 | 50 | \item{size_point}{Numeric specifying size of point-geoms.} 51 | } 52 | \value{ 53 | A ggplot2-object. 54 | } 55 | \description{ 56 | The \code{plot()} method for the \code{bayestestR::equivalence_test()} function. 57 | } 58 | \examples{ 59 | library(effectsize) 60 | m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars) 61 | result <- eta_squared(m) 62 | plot(result) 63 | } 64 | -------------------------------------------------------------------------------- /man/plot.see_estimate_contrasts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.estimate_contrasts.R 3 | \name{plot.see_estimate_contrasts} 4 | \alias{plot.see_estimate_contrasts} 5 | \title{Plot method for estimating contrasts} 6 | \usage{ 7 | \method{plot}{see_estimate_contrasts}(x, data = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object.} 11 | 12 | \item{data}{The original data used to create this object. Can be a 13 | statistical model.} 14 | 15 | \item{...}{Arguments passed to or from other methods.} 16 | } 17 | \value{ 18 | A ggplot2-object. 19 | } 20 | \description{ 21 | The \code{plot()} method for the \code{modelbased::estimate_contrasts()} 22 | function. 23 | } 24 | \examples{ 25 | \dontshow{if (all(insight::check_if_installed(c("marginaleffects", "Formula"), quietly = TRUE))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 26 | \donttest{ 27 | library(modelbased) 28 | 29 | model <- lm(Sepal.Width ~ Species, data = iris) 30 | contrasts <- estimate_contrasts(model) 31 | means <- estimate_means(model) 32 | plot(contrasts, means) 33 | } 34 | \dontshow{\}) # examplesIf} 35 | } 36 | -------------------------------------------------------------------------------- /man/plot.see_estimate_density.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.estimate_density.R 3 | \name{plot.see_estimate_density} 4 | \alias{plot.see_estimate_density} 5 | \title{Plot method for density estimation of posterior samples} 6 | \usage{ 7 | \method{plot}{see_estimate_density}( 8 | x, 9 | stack = TRUE, 10 | show_intercept = FALSE, 11 | n_columns = 1, 12 | priors = FALSE, 13 | alpha_priors = 0.4, 14 | alpha_posteriors = 0.7, 15 | linewidth = 0.9, 16 | size_point = 2, 17 | centrality = "median", 18 | ci = 0.95, 19 | ... 20 | ) 21 | } 22 | \arguments{ 23 | \item{x}{An object.} 24 | 25 | \item{stack}{Logical. If \code{TRUE}, densities are plotted as stacked lines. 26 | Else, densities are plotted for each parameter among each other.} 27 | 28 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 29 | in the plot. By default, it is hidden because in many cases the 30 | intercept-parameter has a posterior distribution on a very different 31 | location, so density curves of posterior distributions for other parameters 32 | are hardly visible.} 33 | 34 | \item{n_columns}{For models with multiple components (like fixed and random, 35 | count and zero-inflated), defines the number of columns for the 36 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 37 | 38 | \item{priors}{Logical. If \code{TRUE}, prior distributions are simulated 39 | (using \code{\link[bayestestR:simulate_prior]{bayestestR::simulate_prior()}}) and added 40 | to the plot.} 41 | 42 | \item{alpha_priors}{Numeric value specifying alpha for the prior 43 | distributions.} 44 | 45 | \item{alpha_posteriors}{Numeric value specifying alpha for the posterior 46 | distributions.} 47 | 48 | \item{linewidth}{Numeric value specifying size of line geoms.} 49 | 50 | \item{size_point}{Numeric specifying size of point-geoms.} 51 | 52 | \item{centrality}{Character specifying the point-estimate (centrality index) 53 | to compute. Can be \code{"median"}, \code{"mean"} or \code{"MAP"}.} 54 | 55 | \item{ci}{Numeric value of probability of the CI (between 0 and 1) to be 56 | estimated. Default to \code{0.95}.} 57 | 58 | \item{...}{Arguments passed to or from other methods.} 59 | } 60 | \value{ 61 | A ggplot2-object. 62 | } 63 | \description{ 64 | The \code{plot()} method for the \code{bayestestR::estimate_density()} function. 65 | } 66 | \examples{ 67 | \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 68 | library(rstanarm) 69 | library(bayestestR) 70 | set.seed(123) 71 | m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) 72 | result <- estimate_density(m) 73 | plot(result) 74 | \dontshow{\}) # examplesIf} 75 | } 76 | -------------------------------------------------------------------------------- /man/plot.see_hdi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.hdi.R 3 | \name{plot.see_hdi} 4 | \alias{plot.see_hdi} 5 | \title{Plot method for uncertainty or credible intervals} 6 | \usage{ 7 | \method{plot}{see_hdi}( 8 | x, 9 | data = NULL, 10 | show_intercept = FALSE, 11 | show_zero = TRUE, 12 | show_title = TRUE, 13 | n_columns = 1, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{An object.} 19 | 20 | \item{data}{The original data used to create this object. Can be a 21 | statistical model.} 22 | 23 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 24 | in the plot. By default, it is hidden because in many cases the 25 | intercept-parameter has a posterior distribution on a very different 26 | location, so density curves of posterior distributions for other parameters 27 | are hardly visible.} 28 | 29 | \item{show_zero}{Logical. If \code{TRUE}, will add a vertical (dotted) line 30 | at 0.} 31 | 32 | \item{show_title}{Logical. If \code{TRUE}, will show the title of the plot.} 33 | 34 | \item{n_columns}{For models with multiple components (like fixed and random, 35 | count and zero-inflated), defines the number of columns for the 36 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 37 | 38 | \item{...}{Arguments passed to or from other methods.} 39 | } 40 | \value{ 41 | A ggplot2-object. 42 | } 43 | \description{ 44 | The \code{plot()} method for the \code{bayestestR::hdi()} and related 45 | function. 46 | } 47 | \examples{ 48 | \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 49 | library(rstanarm) 50 | library(bayestestR) 51 | set.seed(123) 52 | m <- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) 53 | result <- bayestestR::hdi(m) 54 | result 55 | plot(result) 56 | \dontshow{\}) # examplesIf} 57 | } 58 | -------------------------------------------------------------------------------- /man/plot.see_n_factors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.n_factors.R 3 | \name{plot.see_n_factors} 4 | \alias{plot.see_n_factors} 5 | \title{Plot method for numbers of clusters to extract or factors to retain} 6 | \usage{ 7 | \method{plot}{see_n_factors}(x, data = NULL, type = c("bar", "line", "area"), size = 1, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object.} 11 | 12 | \item{data}{The original data used to create this object. Can be a 13 | statistical model.} 14 | 15 | \item{type}{Character vector, indicating the type of plot. 16 | Options are three different shapes to illustrate the degree of consensus 17 | between dimensionality methods for each number of factors; 18 | \code{"bar"} (default) for a bar chart, 19 | \code{"line"} for a horizontal point and line chart, or 20 | \code{"area"} for an area chart (frequency polygon).} 21 | 22 | \item{size}{Depending on \code{type}, a numeric value specifying size of bars, 23 | lines, or segments.} 24 | 25 | \item{...}{Arguments passed to or from other methods.} 26 | } 27 | \value{ 28 | A ggplot2-object. 29 | } 30 | \description{ 31 | The \code{plot()} method for the \code{parameters::n_factors()} and \code{parameters::n_clusters()} 32 | } 33 | \examples{ 34 | \dontshow{if (require("nFactors")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 35 | data(mtcars) 36 | result <- parameters::n_factors(mtcars, type = "PCA") 37 | result 38 | 39 | plot(result) # type = "bar" by default 40 | plot(result, type = "line") 41 | plot(result, type = "area") 42 | \dontshow{\}) # examplesIf} 43 | } 44 | -------------------------------------------------------------------------------- /man/plot.see_p_direction.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.p_direction.R 3 | \name{plot.see_p_direction} 4 | \alias{plot.see_p_direction} 5 | \title{Plot method for probability of direction} 6 | \usage{ 7 | \method{plot}{see_p_direction}( 8 | x, 9 | data = NULL, 10 | show_intercept = FALSE, 11 | priors = FALSE, 12 | alpha_priors = 0.4, 13 | n_columns = 1, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{An object.} 19 | 20 | \item{data}{The original data used to create this object. Can be a 21 | statistical model.} 22 | 23 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 24 | in the plot. By default, it is hidden because in many cases the 25 | intercept-parameter has a posterior distribution on a very different 26 | location, so density curves of posterior distributions for other parameters 27 | are hardly visible.} 28 | 29 | \item{priors}{Logical. If \code{TRUE}, prior distributions are simulated 30 | (using \code{\link[bayestestR:simulate_prior]{bayestestR::simulate_prior()}}) and added 31 | to the plot.} 32 | 33 | \item{alpha_priors}{Numeric value specifying alpha for the prior 34 | distributions.} 35 | 36 | \item{n_columns}{For models with multiple components (like fixed and random, 37 | count and zero-inflated), defines the number of columns for the 38 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 39 | 40 | \item{...}{Arguments passed to or from other methods.} 41 | } 42 | \value{ 43 | A ggplot2-object. 44 | } 45 | \description{ 46 | The \code{plot()} method for the \code{bayestestR::p_direction()} function. 47 | } 48 | \examples{ 49 | \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 50 | library(rstanarm) 51 | library(bayestestR) 52 | set.seed(123) 53 | m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) 54 | result <- p_direction(m) 55 | plot(result) 56 | \dontshow{\}) # examplesIf} 57 | } 58 | -------------------------------------------------------------------------------- /man/plot.see_p_function.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.p_function.R 3 | \name{plot.see_p_function} 4 | \alias{plot.see_p_function} 5 | \title{Plot method for plotting p-functions (aka consonance functions)} 6 | \usage{ 7 | \method{plot}{see_p_function}( 8 | x, 9 | colors = c("black", "#1b6ca8"), 10 | size_point = 1.2, 11 | linewidth = c(0.7, 0.9), 12 | size_text = 3, 13 | alpha_line = 0.15, 14 | show_labels = TRUE, 15 | n_columns = NULL, 16 | show_intercept = FALSE, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{x}{An object returned by \code{parameters::p_function ()}.} 22 | 23 | \item{colors}{Character vector of length two, indicating the colors (in 24 | hex-format) used when only one parameter is plotted, resp. when panels 25 | are plotted as facets.} 26 | 27 | \item{size_point}{Numeric specifying size of point-geoms.} 28 | 29 | \item{linewidth}{Numeric value specifying size of line geoms.} 30 | 31 | \item{size_text}{Numeric value specifying size of text labels.} 32 | 33 | \item{alpha_line}{Numeric value specifying alpha of lines indicating the 34 | emphasized compatibility interval levels (see \code{?parameters::p_function}).} 35 | 36 | \item{show_labels}{Logical. If \code{TRUE}, text labels are displayed.} 37 | 38 | \item{n_columns}{For models with multiple components (like fixed and random, 39 | count and zero-inflated), defines the number of columns for the 40 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 41 | 42 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 43 | in the plot. By default, it is hidden because in many cases the 44 | intercept-parameter has a posterior distribution on a very different 45 | location, so density curves of posterior distributions for other parameters 46 | are hardly visible.} 47 | 48 | \item{...}{Arguments passed to or from other methods.} 49 | } 50 | \value{ 51 | A ggplot2-object. 52 | } 53 | \description{ 54 | The \code{plot()} method for the \code{parameters::p_function ()}. 55 | } 56 | \examples{ 57 | library(parameters) 58 | model <- lm(Sepal.Length ~ Species + Sepal.Width + Petal.Length, data = iris) 59 | result <- p_function(model) 60 | plot(result, n_columns = 2, show_labels = FALSE) 61 | 62 | result <- p_function(model, keep = "Sepal.Width") 63 | plot(result) 64 | } 65 | -------------------------------------------------------------------------------- /man/plot.see_p_significance.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.p_significance.R 3 | \name{plot.see_p_significance} 4 | \alias{plot.see_p_significance} 5 | \title{Plot method for practical significance} 6 | \usage{ 7 | \method{plot}{see_p_significance}( 8 | x, 9 | data = NULL, 10 | show_intercept = FALSE, 11 | priors = FALSE, 12 | alpha_priors = 0.4, 13 | n_columns = 1, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{An object.} 19 | 20 | \item{data}{The original data used to create this object. Can be a 21 | statistical model.} 22 | 23 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 24 | in the plot. By default, it is hidden because in many cases the 25 | intercept-parameter has a posterior distribution on a very different 26 | location, so density curves of posterior distributions for other parameters 27 | are hardly visible.} 28 | 29 | \item{priors}{Logical. If \code{TRUE}, prior distributions are simulated 30 | (using \code{\link[bayestestR:simulate_prior]{bayestestR::simulate_prior()}}) and added 31 | to the plot.} 32 | 33 | \item{alpha_priors}{Numeric value specifying alpha for the prior 34 | distributions.} 35 | 36 | \item{n_columns}{For models with multiple components (like fixed and random, 37 | count and zero-inflated), defines the number of columns for the 38 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 39 | 40 | \item{...}{Arguments passed to or from other methods.} 41 | } 42 | \value{ 43 | A ggplot2-object. 44 | } 45 | \description{ 46 | The \code{plot()} method for the \code{bayestestR::p_significance()} function. 47 | } 48 | \examples{ 49 | \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 50 | library(rstanarm) 51 | library(bayestestR) 52 | set.seed(123) 53 | m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) 54 | result <- p_significance(m) 55 | plot(result) 56 | \dontshow{\}) # examplesIf} 57 | } 58 | -------------------------------------------------------------------------------- /man/plot.see_parameters_brms_meta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.parameters_brms_meta.R 3 | \name{plot.see_parameters_brms_meta} 4 | \alias{plot.see_parameters_brms_meta} 5 | \title{Plot method for Model Parameters from Bayesian Meta-Analysis} 6 | \usage{ 7 | \method{plot}{see_parameters_brms_meta}( 8 | x, 9 | size_point = 2, 10 | linewidth = 0.8, 11 | size_text = 3.5, 12 | alpha_posteriors = 0.7, 13 | alpha_rope = 0.15, 14 | color_rope = "cadetblue", 15 | normalize_height = TRUE, 16 | show_labels = TRUE, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{x}{An object.} 22 | 23 | \item{size_point}{Numeric specifying size of point-geoms.} 24 | 25 | \item{linewidth}{Numeric value specifying size of line geoms.} 26 | 27 | \item{size_text}{Numeric value specifying size of text labels.} 28 | 29 | \item{alpha_posteriors}{Numeric value specifying alpha for the posterior 30 | distributions.} 31 | 32 | \item{alpha_rope}{Numeric specifying transparency level of ROPE ribbon.} 33 | 34 | \item{color_rope}{Character specifying color of ROPE ribbon.} 35 | 36 | \item{normalize_height}{Logical. If \code{TRUE}, height of mcmc-areas is 37 | "normalized", to avoid overlap. In certain cases when the range of a 38 | posterior distribution is narrow for some parameters, this may result in 39 | very flat mcmc-areas. In such cases, set \code{normalize_height = FALSE}.} 40 | 41 | \item{show_labels}{Logical. If \code{TRUE}, text labels are displayed.} 42 | 43 | \item{...}{Arguments passed to or from other methods.} 44 | } 45 | \value{ 46 | A ggplot2-object. 47 | } 48 | \description{ 49 | The \code{plot()} method for the \code{parameters::model_parameters()} 50 | function when used with brms-meta-analysis models. 51 | } 52 | \details{ 53 | \subsection{Colors of density areas and errorbars}{ 54 | To change the colors of the density areas, use \code{scale_fill_manual()} 55 | with named color-values, e.g. \code{scale_fill_manual(values = c("Study" = "blue", "Overall" = "green"))}. 56 | To change the color of the error bars, use \code{scale_color_manual(values = c("Errorbar" = "red"))}. 57 | } 58 | \subsection{Show or hide estimates and CI}{ 59 | Use \code{show_labels = FALSE} to hide the textual 60 | output of estimates and credible intervals. 61 | } 62 | } 63 | \examples{ 64 | \dontshow{if (require("brms") && require("metafor") && require("RcppEigen") && require("BH")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 65 | \donttest{ 66 | library(parameters) 67 | library(brms) 68 | library(metafor) 69 | data(dat.bcg) 70 | 71 | dat <- escalc( 72 | measure = "RR", 73 | ai = tpos, 74 | bi = tneg, 75 | ci = cpos, 76 | di = cneg, 77 | data = dat.bcg 78 | ) 79 | dat$author <- make.unique(dat$author) 80 | 81 | # model 82 | set.seed(123) 83 | priors <- c( 84 | prior(normal(0, 1), class = Intercept), 85 | prior(cauchy(0, 0.5), class = sd) 86 | ) 87 | model <- suppressWarnings( 88 | brm(yi | se(vi) ~ 1 + (1 | author), data = dat, refresh = 0, silent = 2) 89 | ) 90 | 91 | # result 92 | mp <- model_parameters(model) 93 | plot(mp) 94 | } 95 | \dontshow{\}) # examplesIf} 96 | } 97 | -------------------------------------------------------------------------------- /man/plot.see_parameters_distribution.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.describe_distribution.R 3 | \name{plot.see_parameters_distribution} 4 | \alias{plot.see_parameters_distribution} 5 | \title{Plot method for describing distributions of vectors} 6 | \usage{ 7 | \method{plot}{see_parameters_distribution}( 8 | x, 9 | dispersion = FALSE, 10 | alpha_dispersion = 0.3, 11 | color_dispersion = "#3498db", 12 | dispersion_style = c("ribbon", "curve"), 13 | size_bar = 0.7, 14 | highlight = NULL, 15 | color_highlight = NULL, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{x}{An object.} 21 | 22 | \item{dispersion}{Logical. If \code{TRUE}, a range of dispersion for 23 | each variable to the plot will be added.} 24 | 25 | \item{alpha_dispersion}{Numeric value specifying the transparency level of dispersion ribbon.} 26 | 27 | \item{color_dispersion}{Character specifying the color of dispersion ribbon.} 28 | 29 | \item{dispersion_style}{Character describing the style of dispersion area. 30 | \code{"ribbon"} for a ribbon, \code{"curve"} for a normal-curve.} 31 | 32 | \item{size_bar}{Size of bar geoms.} 33 | 34 | \item{highlight}{A vector with names of categories in \code{x} that should be 35 | highlighted.} 36 | 37 | \item{color_highlight}{A vector of color values for highlighted categories. 38 | The remaining (non-highlighted) categories will be filled with a lighter 39 | grey.} 40 | 41 | \item{...}{Arguments passed to or from other methods.} 42 | } 43 | \value{ 44 | A ggplot2-object. 45 | } 46 | \description{ 47 | The \code{plot()} method for the \code{parameters::describe_distribution()} 48 | function. 49 | } 50 | \examples{ 51 | library(parameters) 52 | set.seed(333) 53 | x <- sample(1:100, 1000, replace = TRUE) 54 | result <- describe_distribution(x) 55 | result 56 | plot(result) 57 | } 58 | -------------------------------------------------------------------------------- /man/plot.see_parameters_pca.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.parameters_pca.R 3 | \name{plot.see_parameters_pca} 4 | \alias{plot.see_parameters_pca} 5 | \title{Plot method for principal component analysis} 6 | \usage{ 7 | \method{plot}{see_parameters_pca}( 8 | x, 9 | type = c("bar", "line"), 10 | size_text = 3.5, 11 | color_text = "black", 12 | size = 1, 13 | show_labels = TRUE, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{An object.} 19 | 20 | \item{type}{Character vector, indicating the type of plot. 21 | Options are three different shapes to represent component loadings; 22 | \code{"bar"} (default) for a horizontal bar chart, or 23 | \code{"line"} for a horizontal point and line chart.} 24 | 25 | \item{size_text}{Numeric value specifying size of text labels.} 26 | 27 | \item{color_text}{Character specifying color of text labels.} 28 | 29 | \item{size}{Depending on \code{type}, a numeric value specifying size of bars, 30 | lines, or segments.} 31 | 32 | \item{show_labels}{Logical. If \code{TRUE}, text labels are displayed.} 33 | 34 | \item{...}{Arguments passed to or from other methods.} 35 | } 36 | \value{ 37 | A ggplot2-object. 38 | } 39 | \description{ 40 | The \code{plot()} method for the \code{parameters::principal_components()} function. 41 | } 42 | \examples{ 43 | library(parameters) 44 | data(mtcars) 45 | result <- principal_components(mtcars[, 1:7], n = "all", threshold = 0.2) 46 | result 47 | plot(result) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /man/plot.see_parameters_simulate.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.parameters_simulate.R 3 | \name{plot.see_parameters_simulate} 4 | \alias{plot.see_parameters_simulate} 5 | \title{Plot method for simulated model parameters} 6 | \usage{ 7 | \method{plot}{see_parameters_simulate}( 8 | x, 9 | data = NULL, 10 | stack = TRUE, 11 | show_intercept = FALSE, 12 | n_columns = NULL, 13 | normalize_height = FALSE, 14 | linewidth = 0.9, 15 | alpha_posteriors = 0.7, 16 | centrality = "median", 17 | ci = 0.95, 18 | ... 19 | ) 20 | } 21 | \arguments{ 22 | \item{x}{An object.} 23 | 24 | \item{data}{The original data used to create this object. Can be a 25 | statistical model.} 26 | 27 | \item{stack}{Logical. If \code{TRUE}, densities are plotted as stacked lines. 28 | Else, densities are plotted for each parameter among each other.} 29 | 30 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 31 | in the plot. By default, it is hidden because in many cases the 32 | intercept-parameter has a posterior distribution on a very different 33 | location, so density curves of posterior distributions for other parameters 34 | are hardly visible.} 35 | 36 | \item{n_columns}{For models with multiple components (like fixed and random, 37 | count and zero-inflated), defines the number of columns for the 38 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 39 | 40 | \item{normalize_height}{Logical. If \code{TRUE}, height of density-areas is 41 | "normalized", to avoid overlap. In certain cases when the range of a 42 | distribution of simulated draws is narrow for some parameters, this may 43 | result in very flat density-areas. In such cases, set 44 | \code{normalize_height = FALSE}.} 45 | 46 | \item{linewidth}{Numeric value specifying size of line geoms.} 47 | 48 | \item{alpha_posteriors}{Numeric value specifying alpha for the posterior 49 | distributions.} 50 | 51 | \item{centrality}{Character specifying the point-estimate (centrality index) 52 | to compute. Can be \code{"median"}, \code{"mean"} or \code{"MAP"}.} 53 | 54 | \item{ci}{Numeric value of probability of the CI (between 0 and 1) to be 55 | estimated. Default to \code{0.95}.} 56 | 57 | \item{...}{Arguments passed to or from other methods.} 58 | } 59 | \value{ 60 | A ggplot2-object. 61 | } 62 | \description{ 63 | The \code{plot()} method for the \code{parameters::simulate_parameters()} 64 | function. 65 | } 66 | \examples{ 67 | library(parameters) 68 | m <<- lm(mpg ~ wt + cyl + gear, data = mtcars) 69 | result <- simulate_parameters(m) 70 | result 71 | plot(result) 72 | } 73 | -------------------------------------------------------------------------------- /man/plot.see_performance_roc.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.performance_roc.R 3 | \name{plot.see_performance_roc} 4 | \alias{plot.see_performance_roc} 5 | \title{Plot method for ROC curves} 6 | \usage{ 7 | \method{plot}{see_performance_roc}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object.} 11 | 12 | \item{...}{Arguments passed to or from other methods.} 13 | } 14 | \value{ 15 | A ggplot2-object. 16 | } 17 | \description{ 18 | The \code{plot()} method for the \code{performance::performance_roc()} 19 | function. 20 | } 21 | \examples{ 22 | library(performance) 23 | data(iris) 24 | set.seed(123) 25 | iris$y <- rbinom(nrow(iris), size = 1, .3) 26 | 27 | folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE) 28 | test_data <- iris[folds, ] 29 | train_data <- iris[-folds, ] 30 | 31 | model <- glm(y ~ Sepal.Length + Sepal.Width, data = train_data, family = "binomial") 32 | result <- performance_roc(model, new_data = test_data) 33 | result 34 | plot(result) 35 | } 36 | -------------------------------------------------------------------------------- /man/plot.see_performance_simres.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.performance_simres.R 3 | \name{plot.see_performance_simres} 4 | \alias{plot.see_performance_simres} 5 | \title{Plot method for check model for (non-)normality of residuals} 6 | \usage{ 7 | \method{plot}{see_performance_simres}( 8 | x, 9 | linewidth = 0.8, 10 | size_point = 2, 11 | size_title = 12, 12 | size_axis_title = base_size, 13 | base_size = 10, 14 | alpha = 0.2, 15 | alpha_dot = 0.8, 16 | colors = c("#3aaf85", "#1b6ca8"), 17 | detrend = FALSE, 18 | transform = NULL, 19 | style = theme_lucid, 20 | ... 21 | ) 22 | } 23 | \arguments{ 24 | \item{x}{An object.} 25 | 26 | \item{linewidth}{Numeric value specifying size of line geoms.} 27 | 28 | \item{size_point}{Numeric specifying size of point-geoms.} 29 | 30 | \item{base_size, size_axis_title, size_title}{Numeric value specifying size of 31 | axis and plot titles.} 32 | 33 | \item{alpha}{Numeric value specifying alpha level of the confidence bands.} 34 | 35 | \item{alpha_dot}{Numeric value specifying alpha level of the point geoms.} 36 | 37 | \item{colors}{Character vector of length two, indicating the colors (in 38 | hex-format) for points and line.} 39 | 40 | \item{detrend}{Logical that decides if Q-Q and P-P plots should be de-trended 41 | (also known as \emph{worm plots}).} 42 | 43 | \item{transform}{Function to transform the residuals. If \code{NULL} (default), 44 | no transformation is applied and uniformly distributed residuals are expected. 45 | See argument \code{quantileFuntion} in \code{?DHARMa:::residuals.DHARMa} for more details.} 46 | 47 | \item{style}{A ggplot2-theme.} 48 | 49 | \item{...}{Arguments passed to or from other methods.} 50 | } 51 | \value{ 52 | A ggplot2-object. 53 | } 54 | \description{ 55 | The \code{plot()} method for the \code{performance::check_residuals()} resp. 56 | \code{performance::simulate_residuals()} function. 57 | } 58 | \examples{ 59 | \dontshow{if (require("glmmTMB") && require("qqplotr") && require("DHARMa")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 60 | data(Salamanders, package = "glmmTMB") 61 | model <- glmmTMB::glmmTMB( 62 | count ~ mined + spp + (1 | site), 63 | family = poisson(), 64 | data = Salamanders 65 | ) 66 | simulated_residuals <- performance::simulate_residuals(model) 67 | plot(simulated_residuals) 68 | 69 | # or 70 | simulated_residuals <- performance::simulate_residuals(model) 71 | result <- performance::check_residuals(simulated_residuals) 72 | plot(result) 73 | \dontshow{\}) # examplesIf} 74 | } 75 | \seealso{ 76 | See also the vignette about \href{https://easystats.github.io/performance/articles/check_model.html}{\code{check_model()}}. 77 | } 78 | -------------------------------------------------------------------------------- /man/plot.see_point_estimate.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.point_estimates.R 3 | \name{plot.see_point_estimate} 4 | \alias{plot.see_point_estimate} 5 | \title{Plot method for point estimates of posterior samples} 6 | \usage{ 7 | \method{plot}{see_point_estimate}( 8 | x, 9 | data = NULL, 10 | size_point = 2, 11 | size_text = 3.5, 12 | panel = TRUE, 13 | show_labels = TRUE, 14 | show_intercept = FALSE, 15 | priors = FALSE, 16 | alpha_priors = 0.4, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{x}{An object.} 22 | 23 | \item{data}{The original data used to create this object. Can be a 24 | statistical model.} 25 | 26 | \item{size_point}{Numeric specifying size of point-geoms.} 27 | 28 | \item{size_text}{Numeric value specifying size of text labels.} 29 | 30 | \item{panel}{Logical, if \code{TRUE}, plots are arranged as panels; else, 31 | single plots are returned.} 32 | 33 | \item{show_labels}{Logical. If \code{TRUE}, the text labels for the point 34 | estimates (i.e. \emph{"Mean"}, \emph{"Median"} and/or \emph{"MAP"}) are 35 | shown. You may set \code{show_labels = FALSE} in case of overlapping 36 | labels, and add your own legend or footnote to the plot.} 37 | 38 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 39 | in the plot. By default, it is hidden because in many cases the 40 | intercept-parameter has a posterior distribution on a very different 41 | location, so density curves of posterior distributions for other parameters 42 | are hardly visible.} 43 | 44 | \item{priors}{Logical. If \code{TRUE}, prior distributions are simulated 45 | (using \code{\link[bayestestR:simulate_prior]{bayestestR::simulate_prior()}}) and added 46 | to the plot.} 47 | 48 | \item{alpha_priors}{Numeric value specifying alpha for the prior 49 | distributions.} 50 | 51 | \item{...}{Arguments passed to or from other methods.} 52 | } 53 | \value{ 54 | A ggplot2-object. 55 | } 56 | \description{ 57 | The \code{plot()} method for the \code{bayestestR::point_estimate()}. 58 | } 59 | \examples{ 60 | \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 61 | library(rstanarm) 62 | library(bayestestR) 63 | set.seed(123) 64 | m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) 65 | result <- point_estimate(m, centrality = "median") 66 | result 67 | plot(result) 68 | \dontshow{\}) # examplesIf} 69 | } 70 | -------------------------------------------------------------------------------- /man/plot.see_rope.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.rope.R 3 | \name{plot.see_rope} 4 | \alias{plot.see_rope} 5 | \title{Plot method for Region of Practical Equivalence} 6 | \usage{ 7 | \method{plot}{see_rope}( 8 | x, 9 | data = NULL, 10 | alpha_rope = 0.5, 11 | color_rope = "cadetblue", 12 | show_intercept = FALSE, 13 | n_columns = 1, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{An object.} 19 | 20 | \item{data}{The original data used to create this object. Can be a 21 | statistical model.} 22 | 23 | \item{alpha_rope}{Numeric specifying transparency level of ROPE ribbon.} 24 | 25 | \item{color_rope}{Character specifying color of ROPE ribbon.} 26 | 27 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 28 | in the plot. By default, it is hidden because in many cases the 29 | intercept-parameter has a posterior distribution on a very different 30 | location, so density curves of posterior distributions for other parameters 31 | are hardly visible.} 32 | 33 | \item{n_columns}{For models with multiple components (like fixed and random, 34 | count and zero-inflated), defines the number of columns for the 35 | panel-layout. If \code{NULL}, a single, integrated plot is shown.} 36 | 37 | \item{...}{Arguments passed to or from other methods.} 38 | } 39 | \value{ 40 | A ggplot2-object. 41 | } 42 | \description{ 43 | The \code{plot()} method for the \code{bayestestR::rope()}. 44 | } 45 | \examples{ 46 | \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 47 | library(rstanarm) 48 | library(bayestestR) 49 | set.seed(123) 50 | m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) 51 | result <- rope(m) 52 | result 53 | plot(result) 54 | \dontshow{\}) # examplesIf} 55 | } 56 | -------------------------------------------------------------------------------- /man/plot.see_si.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.si.R 3 | \name{plot.see_si} 4 | \alias{plot.see_si} 5 | \title{Plot method for support intervals} 6 | \usage{ 7 | \method{plot}{see_si}( 8 | x, 9 | color_si = "#0171D3", 10 | alpha_si = 0.2, 11 | show_intercept = FALSE, 12 | support_only = FALSE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{x}{An object.} 18 | 19 | \item{color_si}{Character specifying color of SI ribbon.} 20 | 21 | \item{alpha_si}{Numeric value specifying Transparency level of SI ribbon.} 22 | 23 | \item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included 24 | in the plot. By default, it is hidden because in many cases the 25 | intercept-parameter has a posterior distribution on a very different 26 | location, so density curves of posterior distributions for other parameters 27 | are hardly visible.} 28 | 29 | \item{support_only}{Logical. Decides whether to plot only the support data, 30 | or show the "raw" prior and posterior distributions? Only applies when 31 | plotting \code{\link[bayestestR:si]{bayestestR::si()}}.} 32 | 33 | \item{...}{Arguments passed to or from other methods.} 34 | } 35 | \value{ 36 | A ggplot2-object. 37 | } 38 | \description{ 39 | The \code{plot()} method for the \code{bayestestR::si()}. 40 | } 41 | \examples{ 42 | \dontshow{if (identical(Sys.getenv("NOT_CRAN"), "true") && require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 43 | library(rstanarm) 44 | library(bayestestR) 45 | set.seed(123) 46 | m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) 47 | result <- si(m, verbose = FALSE) 48 | result 49 | plot(result) 50 | \dontshow{\}) # examplesIf} 51 | } 52 | -------------------------------------------------------------------------------- /man/plots.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plots.R 3 | \name{plots} 4 | \alias{plots} 5 | \title{Multiple plots side by side} 6 | \usage{ 7 | plots( 8 | ..., 9 | n_rows = NULL, 10 | n_columns = NULL, 11 | guides = NULL, 12 | tags = FALSE, 13 | tag_prefix = NULL, 14 | tag_suffix = NULL, 15 | tag_sep = NULL, 16 | title = NULL, 17 | subtitle = NULL, 18 | caption = NULL, 19 | theme = NULL 20 | ) 21 | } 22 | \arguments{ 23 | \item{...}{Multiple \code{ggplot}s or a list containing \code{ggplot} objects} 24 | 25 | \item{n_rows}{Number of rows to align plots.} 26 | 27 | \item{n_columns}{Number of columns to align plots.} 28 | 29 | \item{guides}{A string specifying how guides should be treated in the 30 | layout. \code{'collect'} will collect shared guides across plots, removing 31 | duplicates. \code{'keep'} will keep guides alongside their plot. 32 | \code{'auto'} will inherit from a higher patchwork level (if any). See 33 | \code{\link[patchwork:plot_layout]{patchwork::plot_layout()}} for details.} 34 | 35 | \item{tags}{Add tags to your subfigures. Can be \code{NULL} to omit (default) 36 | or a character vector containing tags for each plot. Automatic tags can 37 | also be generated with \code{'1'} for Arabic numerals, \code{'A'} for 38 | uppercase Latin letters, \code{'a'} for lowercase Latin letters, \code{'I'} 39 | for uppercase Roman numerals, and \code{'i'} for lowercase Roman numerals. 40 | For backwards compatibility, can also be \code{FALSE} (equivalent to 41 | \code{NULL}), \code{NA} (equivalent to \code{NULL}), or \code{TRUE} 42 | (equivalent to \code{'A'}).} 43 | 44 | \item{tag_prefix, tag_suffix}{Text strings that should appear before or after 45 | the tag.} 46 | 47 | \item{tag_sep}{Text string giving the separator to use between different tag 48 | levels.} 49 | 50 | \item{title, subtitle, caption}{Text strings to use for the various plot 51 | annotations to add to the composed patchwork.} 52 | 53 | \item{theme}{A ggplot theme specification to use for the plot. Only elements 54 | related to titles, caption, and tags, as well as plot margin and 55 | background, are used.} 56 | } 57 | \description{ 58 | A wrapper around \emph{patchwork} to plot multiple figures side by side on 59 | the same page. 60 | } 61 | \details{ 62 | See \href{https://patchwork.data-imaginist.com/articles/patchwork.html}{the \emph{patchwork} documentation} 63 | for more advanced control of plot layouts. 64 | } 65 | \examples{ 66 | \dontshow{if (require("patchwork", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} 67 | library(ggplot2) 68 | library(see) 69 | 70 | p1 <- ggplot(mtcars, aes(x = disp, y = mpg)) + 71 | geom_point() 72 | p2 <- ggplot(mtcars, aes(x = mpg)) + 73 | geom_density() 74 | p3 <- ggplot(mtcars, aes(x = factor(cyl))) + 75 | geom_bar() + 76 | scale_x_discrete("cyl") 77 | 78 | plots(p1, p2) 79 | plots(p1, p2, n_columns = 2, tags = "A") 80 | plots( 81 | p1, p2, p3, 82 | n_columns = 1, tags = c("Fig. 1", "Fig. 2", "Fig. 3"), 83 | title = "The surprising truth about mtcars" 84 | ) 85 | \dontshow{\}) # examplesIf} 86 | } 87 | -------------------------------------------------------------------------------- /man/print.see_performance_pp_check.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.check_predictions.R 3 | \name{print.see_performance_pp_check} 4 | \alias{print.see_performance_pp_check} 5 | \alias{plot.see_performance_pp_check} 6 | \title{Plot method for posterior predictive checks} 7 | \usage{ 8 | \method{print}{see_performance_pp_check}( 9 | x, 10 | linewidth = 0.5, 11 | size_point = 2, 12 | size_bar = 0.7, 13 | size_axis_title = base_size, 14 | size_title = 12, 15 | base_size = 10, 16 | alpha_line = 0.15, 17 | style = theme_lucid, 18 | colors = unname(social_colors(c("green", "blue"))), 19 | type = "density", 20 | x_limits = NULL, 21 | ... 22 | ) 23 | 24 | \method{plot}{see_performance_pp_check}( 25 | x, 26 | linewidth = 0.5, 27 | size_point = 2, 28 | size_bar = 0.7, 29 | size_axis_title = base_size, 30 | size_title = 12, 31 | base_size = 10, 32 | alpha_line = 0.15, 33 | style = theme_lucid, 34 | colors = unname(social_colors(c("green", "blue"))), 35 | type = "density", 36 | x_limits = NULL, 37 | ... 38 | ) 39 | } 40 | \arguments{ 41 | \item{x}{An object.} 42 | 43 | \item{linewidth}{Numeric value specifying size of line geoms.} 44 | 45 | \item{size_point}{Numeric specifying size of point-geoms.} 46 | 47 | \item{size_bar}{Size of bar geoms.} 48 | 49 | \item{base_size, size_axis_title, size_title}{Numeric value specifying size of 50 | axis and plot titles.} 51 | 52 | \item{alpha_line}{Numeric value specifying alpha of lines indicating \code{yrep}.} 53 | 54 | \item{style}{A ggplot2-theme.} 55 | 56 | \item{colors}{Character vector of length two, indicating the colors (in 57 | hex-format) for points and line.} 58 | 59 | \item{type}{Plot type for the posterior predictive checks plot. Can be \code{"density"} 60 | (default), \code{"discrete_dots"}, \code{"discrete_interval"} or \code{"discrete_both"} (the 61 | \verb{discrete_*} options are appropriate for models with discrete - binary, integer 62 | or ordinal etc. - outcomes).} 63 | 64 | \item{x_limits}{Numeric vector of length 2 specifying the limits of the x-axis. 65 | If not \code{NULL}, will zoom in the x-axis to the specified limits.} 66 | 67 | \item{...}{Arguments passed to or from other methods.} 68 | } 69 | \value{ 70 | A ggplot2-object. 71 | } 72 | \description{ 73 | The \code{plot()} method for the \code{performance::check_predictions()} function. 74 | } 75 | \examples{ 76 | library(performance) 77 | 78 | model <- lm(Sepal.Length ~ Species * Petal.Width + Petal.Length, data = iris) 79 | check_predictions(model) 80 | 81 | # dot-plot style for count-models 82 | d <- iris 83 | d$poisson_var <- rpois(150, 1) 84 | model <- glm( 85 | poisson_var ~ Species + Petal.Length + Petal.Width, 86 | data = d, 87 | family = poisson() 88 | ) 89 | out <- check_predictions(model) 90 | plot(out, type = "discrete_dots") 91 | } 92 | \seealso{ 93 | See also the vignette about \href{https://easystats.github.io/performance/articles/check_model.html}{\code{check_model()}}. 94 | } 95 | -------------------------------------------------------------------------------- /man/scale_color_bluebrown.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_bluebrown.R 3 | \name{scale_color_bluebrown} 4 | \alias{scale_color_bluebrown} 5 | \alias{scale_color_bluebrown_d} 6 | \alias{scale_color_bluebrown_c} 7 | \alias{scale_colour_bluebrown} 8 | \alias{scale_colour_bluebrown_c} 9 | \alias{scale_colour_bluebrown_d} 10 | \alias{scale_fill_bluebrown} 11 | \alias{scale_fill_bluebrown_d} 12 | \alias{scale_fill_bluebrown_c} 13 | \title{Blue-brown color palette} 14 | \usage{ 15 | scale_color_bluebrown( 16 | palette = NULL, 17 | discrete = TRUE, 18 | reverse = FALSE, 19 | aesthetics = "color", 20 | ... 21 | ) 22 | 23 | scale_color_bluebrown_d( 24 | palette = NULL, 25 | discrete = TRUE, 26 | reverse = FALSE, 27 | aesthetics = "color", 28 | ... 29 | ) 30 | 31 | scale_color_bluebrown_c( 32 | palette = NULL, 33 | discrete = FALSE, 34 | reverse = FALSE, 35 | aesthetics = "color", 36 | ... 37 | ) 38 | 39 | scale_colour_bluebrown( 40 | palette = NULL, 41 | discrete = TRUE, 42 | reverse = FALSE, 43 | aesthetics = "color", 44 | ... 45 | ) 46 | 47 | scale_colour_bluebrown_c( 48 | palette = NULL, 49 | discrete = FALSE, 50 | reverse = FALSE, 51 | aesthetics = "color", 52 | ... 53 | ) 54 | 55 | scale_colour_bluebrown_d( 56 | palette = NULL, 57 | discrete = TRUE, 58 | reverse = FALSE, 59 | aesthetics = "color", 60 | ... 61 | ) 62 | 63 | scale_fill_bluebrown( 64 | palette = NULL, 65 | discrete = TRUE, 66 | reverse = FALSE, 67 | aesthetics = "fill", 68 | ... 69 | ) 70 | 71 | scale_fill_bluebrown_d( 72 | palette = NULL, 73 | discrete = TRUE, 74 | reverse = FALSE, 75 | aesthetics = "fill", 76 | ... 77 | ) 78 | 79 | scale_fill_bluebrown_c( 80 | palette = NULL, 81 | discrete = FALSE, 82 | reverse = FALSE, 83 | aesthetics = "fill", 84 | ... 85 | ) 86 | } 87 | \arguments{ 88 | \item{palette}{Character name of palette. Depending on the color scale, can 89 | be one of \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, \code{"contrast"}, 90 | \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, or 91 | \code{black_first_original}. The latter three options are especially for the 92 | Okabe-Ito color palette. The default is \code{NULL} and either \code{"contrast"} or 93 | \code{"gradient"} is used (depending on whether \code{discrete} is \code{TRUE} or \code{FALSE}), 94 | which are the two scale useful for discrete or gradient color scales, 95 | respectively.} 96 | 97 | \item{discrete}{Boolean indicating whether color aesthetic is discrete or not.} 98 | 99 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 100 | 101 | \item{aesthetics}{A vector of names of the aesthetics that this scale 102 | should be applied to (e.g., \code{c('color', 'fill')}).} 103 | 104 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 105 | } 106 | \description{ 107 | A blue-brown color palette. Use \code{scale_color_bluebrown_d()} for 108 | \emph{discrete} categories and \code{scale_color_bluebrown_c()} for 109 | a \emph{continuous} scale. 110 | } 111 | \examples{ 112 | library(ggplot2) 113 | library(see) 114 | 115 | ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + 116 | geom_boxplot() + 117 | theme_modern() + 118 | scale_fill_bluebrown_d() 119 | } 120 | -------------------------------------------------------------------------------- /man/scale_color_pizza.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_pizza.R 3 | \name{scale_color_pizza} 4 | \alias{scale_color_pizza} 5 | \alias{scale_color_pizza_d} 6 | \alias{scale_color_pizza_c} 7 | \alias{scale_colour_pizza} 8 | \alias{scale_colour_pizza_c} 9 | \alias{scale_colour_pizza_d} 10 | \alias{scale_fill_pizza} 11 | \alias{scale_fill_pizza_d} 12 | \alias{scale_fill_pizza_c} 13 | \title{Pizza color palette} 14 | \usage{ 15 | scale_color_pizza( 16 | palette = "margherita", 17 | discrete = TRUE, 18 | reverse = FALSE, 19 | aesthetics = "color", 20 | ... 21 | ) 22 | 23 | scale_color_pizza_d( 24 | palette = "margherita", 25 | discrete = TRUE, 26 | reverse = FALSE, 27 | aesthetics = "color", 28 | ... 29 | ) 30 | 31 | scale_color_pizza_c( 32 | palette = "margherita", 33 | discrete = FALSE, 34 | reverse = FALSE, 35 | aesthetics = "color", 36 | ... 37 | ) 38 | 39 | scale_colour_pizza( 40 | palette = "margherita", 41 | discrete = TRUE, 42 | reverse = FALSE, 43 | aesthetics = "color", 44 | ... 45 | ) 46 | 47 | scale_colour_pizza_c( 48 | palette = "margherita", 49 | discrete = FALSE, 50 | reverse = FALSE, 51 | aesthetics = "color", 52 | ... 53 | ) 54 | 55 | scale_colour_pizza_d( 56 | palette = "margherita", 57 | discrete = TRUE, 58 | reverse = FALSE, 59 | aesthetics = "color", 60 | ... 61 | ) 62 | 63 | scale_fill_pizza( 64 | palette = "margherita", 65 | discrete = TRUE, 66 | reverse = FALSE, 67 | aesthetics = "fill", 68 | ... 69 | ) 70 | 71 | scale_fill_pizza_d( 72 | palette = "margherita", 73 | discrete = TRUE, 74 | reverse = FALSE, 75 | aesthetics = "fill", 76 | ... 77 | ) 78 | 79 | scale_fill_pizza_c( 80 | palette = "margherita", 81 | discrete = FALSE, 82 | reverse = FALSE, 83 | aesthetics = "fill", 84 | ... 85 | ) 86 | } 87 | \arguments{ 88 | \item{palette}{Pizza type. Can be \code{"margherita"} (default), \code{"margherita crust"}, 89 | \code{"diavola"} or \code{"diavola crust"}.} 90 | 91 | \item{discrete}{Boolean indicating whether color aesthetic is discrete or not.} 92 | 93 | \item{reverse}{Boolean indicating whether the palette should be reversed.} 94 | 95 | \item{aesthetics}{A vector of names of the aesthetics that this scale 96 | should be applied to (e.g., \code{c('color', 'fill')}).} 97 | 98 | \item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} 99 | } 100 | \description{ 101 | The palette based on authentic neapolitan pizzas. 102 | Use \code{scale_color_pizza_d()} for \emph{discrete} categories and 103 | \code{scale_color_pizza_c()} for a \emph{continuous} scale. 104 | } 105 | \examples{ 106 | library(ggplot2) 107 | library(see) 108 | 109 | ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + 110 | geom_boxplot() + 111 | theme_modern() + 112 | scale_fill_pizza_d() 113 | 114 | ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + 115 | geom_point() + 116 | theme_modern() + 117 | scale_color_pizza_c() 118 | } 119 | -------------------------------------------------------------------------------- /man/see-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/see-package.R 3 | \docType{package} 4 | \name{see-package} 5 | \alias{see-package} 6 | \alias{see} 7 | \title{see: Framework for Easy Statistical Modeling, Visualization, and Reporting} 8 | \description{ 9 | Provides plotting utilities supporting packages in the 'easystats' ecosystem 10 | (\url{https://github.com/easystats/easystats}) and some extra themes, geoms, and 11 | scales for 'ggplot2'. Color scales are based on 12 | \url{https://materialui.co/}. 13 | 14 | References: Luedecke et al. (2021) \doi{10.21105/joss.03393}. 15 | } 16 | \details{ 17 | \code{see} 18 | } 19 | \seealso{ 20 | Useful links: 21 | \itemize{ 22 | \item \url{https://easystats.github.io/see/} 23 | \item Report bugs at \url{https://github.com/easystats/see/issues} 24 | } 25 | 26 | } 27 | \author{ 28 | \strong{Maintainer}: Indrajeet Patil \email{patilindrajeet.science@gmail.com} (\href{https://orcid.org/0000-0003-1995-6531}{ORCID}) 29 | 30 | Authors: 31 | \itemize{ 32 | \item Daniel Lüdecke \email{d.luedecke@uke.de} (\href{https://orcid.org/0000-0002-8895-3206}{ORCID}) [contributor] 33 | \item Dominique Makowski \email{dom.makowski@gmail.com} (\href{https://orcid.org/0000-0001-5375-9967}{ORCID}) [inventor] 34 | \item Mattan S. Ben-Shachar \email{matanshm@post.bgu.ac.il} (\href{https://orcid.org/0000-0002-4287-4801}{ORCID}) [contributor] 35 | \item Brenton M. Wiernik \email{brenton@wiernik.org} (\href{https://orcid.org/0000-0001-9560-6336}{ORCID}) [contributor] 36 | \item Philip Waggoner \email{philip.waggoner@gmail.com} (\href{https://orcid.org/0000-0002-7825-7573}{ORCID}) [contributor] 37 | } 38 | 39 | Other contributors: 40 | \itemize{ 41 | \item Jeffrey R. Stevens \email{jeffrey.r.stevens@gmail.com} (\href{https://orcid.org/0000-0003-2375-1360}{ORCID}) [contributor] 42 | \item Matthew Smith \email{M.Smith3@napier.ac.uk} [reviewer] 43 | \item Jakob Bossek \email{bossek@wi.uni-muenster.de} [reviewer] 44 | } 45 | 46 | } 47 | \keyword{internal} 48 | -------------------------------------------------------------------------------- /man/see_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_see.R 3 | \name{see_colors} 4 | \alias{see_colors} 5 | \title{Extract See colors as hex codes} 6 | \usage{ 7 | see_colors(...) 8 | } 9 | \arguments{ 10 | \item{...}{Character names of colors.} 11 | } 12 | \value{ 13 | A character vector with color-codes. 14 | } 15 | \description{ 16 | Can be used to get the hex code of specific colors from the See color 17 | palette. Use \code{see_colors()} to see all available colors. 18 | } 19 | \examples{ 20 | see_colors() 21 | 22 | see_colors("indigo", "lime") 23 | } 24 | -------------------------------------------------------------------------------- /man/social_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scale_color_social.R 3 | \name{social_colors} 4 | \alias{social_colors} 5 | \title{Extract Social colors as hex codes} 6 | \usage{ 7 | social_colors(...) 8 | } 9 | \arguments{ 10 | \item{...}{Character names of colors.} 11 | } 12 | \value{ 13 | A character vector with color-codes. 14 | } 15 | \description{ 16 | Can be used to get the hex code of specific colors from the Social color 17 | palette. Use \code{social_colors()} to see all available colors. 18 | } 19 | \examples{ 20 | social_colors() 21 | 22 | social_colors("dark red", "teal") 23 | } 24 | -------------------------------------------------------------------------------- /man/theme_abyss.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/theme_abyss.R 3 | \name{theme_abyss} 4 | \alias{theme_abyss} 5 | \title{Abyss theme} 6 | \usage{ 7 | theme_abyss( 8 | base_size = 11, 9 | base_family = "", 10 | plot.title.size = 1.35 * base_size, 11 | plot.title.face = "plain", 12 | plot.title.space = 1.8 * base_size, 13 | plot.title.position = "plot", 14 | legend.position = "right", 15 | axis.title.space = 1.8 * base_size, 16 | legend.title.size = 1.2 * base_size, 17 | legend.text.size = 1.1 * base_size, 18 | axis.title.size = 1.2 * base_size, 19 | axis.title.face = "plain", 20 | axis.text.size = 1.1 * base_size, 21 | axis.text.angle = NULL, 22 | tags.size = 1.35 * base_size, 23 | tags.face = "bold", 24 | ... 25 | ) 26 | } 27 | \arguments{ 28 | \item{base_size}{base font size, given in pts.} 29 | 30 | \item{base_family}{base font family} 31 | 32 | \item{plot.title.size}{Title size in pts. Can be "none".} 33 | 34 | \item{plot.title.face}{Title font face ("plain", "italic", "bold", "bold.italic").} 35 | 36 | \item{plot.title.space}{Title spacing.} 37 | 38 | \item{plot.title.position}{Alignment of the plot title/subtitle and caption. 39 | The setting for plot.title.position applies to both the title and the 40 | subtitle. A value of "panel" (the default) means that titles and/or caption 41 | are aligned to the plot panels. A value of "plot" means that titles and/or 42 | caption are aligned to the entire plot (minus any space for margins and 43 | plot tag).} 44 | 45 | \item{legend.position}{the default position of legends ("none", "left", 46 | "right", "bottom", "top", "inside")} 47 | 48 | \item{axis.title.space}{Axis title spacing.} 49 | 50 | \item{legend.title.size}{Legend elements text size in pts.} 51 | 52 | \item{legend.text.size}{Legend elements text size in pts. Can be "none".} 53 | 54 | \item{axis.title.size}{Axis title text size in pts.} 55 | 56 | \item{axis.title.face}{Axis font face ("plain", "italic", "bold", "bold.italic").} 57 | 58 | \item{axis.text.size}{Axis text size in pts.} 59 | 60 | \item{axis.text.angle}{Rotate the x axis labels.} 61 | 62 | \item{tags.size}{Tags text size in pts.} 63 | 64 | \item{tags.face}{Tags font face ("plain", "italic", "bold", "bold.italic").} 65 | 66 | \item{...}{Further arguments passed to \code{ggplot2::theme()}.} 67 | } 68 | \description{ 69 | A deep dark blue theme for ggplot. 70 | } 71 | \note{ 72 | Base elements like plot borders, titles etc. are scaling with 73 | \code{base_size}, i.e. when \code{base_size} is increased, all other relevant elements 74 | are increased in proportion to the base size, to ensure proper scaling of 75 | the plot. Set arguments for the related elements explicitly to define custom 76 | sizes. 77 | } 78 | \examples{ 79 | library(ggplot2) 80 | library(see) 81 | 82 | ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + 83 | geom_point(color = "white") + 84 | theme_abyss() 85 | } 86 | -------------------------------------------------------------------------------- /man/theme_azurelight.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/theme_azurelight.R 3 | \name{theme_azurelight} 4 | \alias{theme_azurelight} 5 | \title{Azurelight theme} 6 | \usage{ 7 | theme_azurelight( 8 | base_size = 11, 9 | base_family = "", 10 | plot.title.size = 1.35 * base_size, 11 | plot.title.face = "plain", 12 | plot.title.space = 1.8 * base_size, 13 | plot.title.position = "plot", 14 | legend.position = "right", 15 | axis.title.space = 1.8 * base_size, 16 | legend.title.size = 1.2 * base_size, 17 | legend.text.size = 1.1 * base_size, 18 | axis.title.size = 1.2 * base_size, 19 | axis.title.face = "plain", 20 | axis.text.size = 1.1 * base_size, 21 | axis.text.angle = NULL, 22 | tags.size = 1.35 * base_size, 23 | tags.face = "bold", 24 | ... 25 | ) 26 | } 27 | \arguments{ 28 | \item{base_size}{base font size, given in pts.} 29 | 30 | \item{base_family}{base font family} 31 | 32 | \item{plot.title.size}{Title size in pts. Can be "none".} 33 | 34 | \item{plot.title.face}{Title font face ("plain", "italic", "bold", "bold.italic").} 35 | 36 | \item{plot.title.space}{Title spacing.} 37 | 38 | \item{plot.title.position}{Alignment of the plot title/subtitle and caption. 39 | The setting for plot.title.position applies to both the title and the 40 | subtitle. A value of "panel" (the default) means that titles and/or caption 41 | are aligned to the plot panels. A value of "plot" means that titles and/or 42 | caption are aligned to the entire plot (minus any space for margins and 43 | plot tag).} 44 | 45 | \item{legend.position}{the default position of legends ("none", "left", 46 | "right", "bottom", "top", "inside")} 47 | 48 | \item{axis.title.space}{Axis title spacing.} 49 | 50 | \item{legend.title.size}{Legend elements text size in pts.} 51 | 52 | \item{legend.text.size}{Legend elements text size in pts. Can be "none".} 53 | 54 | \item{axis.title.size}{Axis title text size in pts.} 55 | 56 | \item{axis.title.face}{Axis font face ("plain", "italic", "bold", "bold.italic").} 57 | 58 | \item{axis.text.size}{Axis text size in pts.} 59 | 60 | \item{axis.text.angle}{Rotate the x axis labels.} 61 | 62 | \item{tags.size}{Tags text size in pts.} 63 | 64 | \item{tags.face}{Tags font face ("plain", "italic", "bold", "bold.italic").} 65 | 66 | \item{...}{Further arguments passed to \code{ggplot2::theme()}.} 67 | } 68 | \description{ 69 | A light-blue, clear theme for ggplot with reduced usage of panel grids. 70 | } 71 | \note{ 72 | Base elements like plot borders, titles etc. are scaling with 73 | \code{base_size}, i.e. when \code{base_size} is increased, all other relevant elements 74 | are increased in proportion to the base size, to ensure proper scaling of 75 | the plot. Set arguments for the related elements explicitly to define custom 76 | sizes. 77 | } 78 | \examples{ 79 | library(ggplot2) 80 | library(see) 81 | 82 | data(iris) 83 | 84 | ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) + 85 | geom_point2(size = 2.5) + 86 | scale_color_social() + 87 | theme_azurelight() 88 | } 89 | -------------------------------------------------------------------------------- /man/theme_blackboard.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/theme_blackboard.R 3 | \name{theme_blackboard} 4 | \alias{theme_blackboard} 5 | \title{Blackboard dark theme} 6 | \usage{ 7 | theme_blackboard( 8 | base_size = 11, 9 | base_family = "", 10 | plot.title.size = 1.35 * base_size, 11 | plot.title.face = "plain", 12 | plot.title.space = 1.8 * base_size, 13 | plot.title.position = "plot", 14 | legend.position = "right", 15 | axis.title.space = 1.8 * base_size, 16 | legend.title.size = 1.2 * base_size, 17 | legend.text.size = 1.1 * base_size, 18 | axis.title.size = 1.2 * base_size, 19 | axis.title.face = "plain", 20 | axis.text.size = 1.1 * base_size, 21 | axis.text.angle = NULL, 22 | tags.size = 1.35 * base_size, 23 | tags.face = "bold", 24 | ... 25 | ) 26 | } 27 | \arguments{ 28 | \item{base_size}{base font size, given in pts.} 29 | 30 | \item{base_family}{base font family} 31 | 32 | \item{plot.title.size}{Title size in pts. Can be "none".} 33 | 34 | \item{plot.title.face}{Title font face ("plain", "italic", "bold", "bold.italic").} 35 | 36 | \item{plot.title.space}{Title spacing.} 37 | 38 | \item{plot.title.position}{Alignment of the plot title/subtitle and caption. 39 | The setting for plot.title.position applies to both the title and the 40 | subtitle. A value of "panel" (the default) means that titles and/or caption 41 | are aligned to the plot panels. A value of "plot" means that titles and/or 42 | caption are aligned to the entire plot (minus any space for margins and 43 | plot tag).} 44 | 45 | \item{legend.position}{the default position of legends ("none", "left", 46 | "right", "bottom", "top", "inside")} 47 | 48 | \item{axis.title.space}{Axis title spacing.} 49 | 50 | \item{legend.title.size}{Legend elements text size in pts.} 51 | 52 | \item{legend.text.size}{Legend elements text size in pts. Can be "none".} 53 | 54 | \item{axis.title.size}{Axis title text size in pts.} 55 | 56 | \item{axis.title.face}{Axis font face ("plain", "italic", "bold", "bold.italic").} 57 | 58 | \item{axis.text.size}{Axis text size in pts.} 59 | 60 | \item{axis.text.angle}{Rotate the x axis labels.} 61 | 62 | \item{tags.size}{Tags text size in pts.} 63 | 64 | \item{tags.face}{Tags font face ("plain", "italic", "bold", "bold.italic").} 65 | 66 | \item{...}{Further arguments passed to \code{ggplot2::theme()}.} 67 | } 68 | \description{ 69 | A modern, sleek and dark theme for ggplot. 70 | } 71 | \note{ 72 | Base elements like plot borders, titles etc. are scaling with 73 | \code{base_size}, i.e. when \code{base_size} is increased, all other relevant elements 74 | are increased in proportion to the base size, to ensure proper scaling of 75 | the plot. Set arguments for the related elements explicitly to define custom 76 | sizes. 77 | } 78 | \examples{ 79 | library(ggplot2) 80 | library(see) 81 | 82 | ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + 83 | geom_point(color = see_colors("lime")) + 84 | theme_blackboard() 85 | } 86 | -------------------------------------------------------------------------------- /man/theme_lucid.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/theme_lucid.R 3 | \name{theme_lucid} 4 | \alias{theme_lucid} 5 | \title{Lucid theme} 6 | \usage{ 7 | theme_lucid( 8 | base_size = 11, 9 | base_family = "", 10 | plot.title.size = 1.1 * base_size, 11 | plot.title.face = "plain", 12 | plot.title.space = 1.35 * base_size, 13 | plot.title.position = "plot", 14 | legend.position = "right", 15 | axis.title.space = 0.9 * base_size, 16 | legend.title.size = base_size, 17 | legend.text.size = 0.9 * base_size, 18 | axis.title.size = base_size, 19 | axis.title.face = "plain", 20 | axis.text.size = 0.9 * base_size, 21 | axis.text.angle = NULL, 22 | tags.size = base_size, 23 | tags.face = "plain", 24 | ... 25 | ) 26 | } 27 | \arguments{ 28 | \item{base_size}{base font size, given in pts.} 29 | 30 | \item{base_family}{base font family} 31 | 32 | \item{plot.title.size}{Title size in pts. Can be "none".} 33 | 34 | \item{plot.title.face}{Title font face ("plain", "italic", "bold", "bold.italic").} 35 | 36 | \item{plot.title.space}{Title spacing.} 37 | 38 | \item{plot.title.position}{Alignment of the plot title/subtitle and caption. 39 | The setting for plot.title.position applies to both the title and the 40 | subtitle. A value of "panel" (the default) means that titles and/or caption 41 | are aligned to the plot panels. A value of "plot" means that titles and/or 42 | caption are aligned to the entire plot (minus any space for margins and 43 | plot tag).} 44 | 45 | \item{legend.position}{the default position of legends ("none", "left", 46 | "right", "bottom", "top", "inside")} 47 | 48 | \item{axis.title.space}{Axis title spacing.} 49 | 50 | \item{legend.title.size}{Legend elements text size in pts.} 51 | 52 | \item{legend.text.size}{Legend elements text size in pts. Can be "none".} 53 | 54 | \item{axis.title.size}{Axis title text size in pts.} 55 | 56 | \item{axis.title.face}{Axis font face ("plain", "italic", "bold", "bold.italic").} 57 | 58 | \item{axis.text.size}{Axis text size in pts.} 59 | 60 | \item{axis.text.angle}{Rotate the x axis labels.} 61 | 62 | \item{tags.size}{Tags text size in pts.} 63 | 64 | \item{tags.face}{Tags font face ("plain", "italic", "bold", "bold.italic").} 65 | 66 | \item{...}{Further arguments passed to \code{ggplot2::theme()}.} 67 | } 68 | \description{ 69 | A light, clear theme for ggplot. 70 | } 71 | \note{ 72 | Base elements like plot borders, titles etc. are scaling with 73 | \code{base_size}, i.e. when \code{base_size} is increased, all other relevant elements 74 | are increased in proportion to the base size, to ensure proper scaling of 75 | the plot. Set arguments for the related elements explicitly to define custom 76 | sizes. 77 | } 78 | \examples{ 79 | library(ggplot2) 80 | library(see) 81 | 82 | ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + 83 | geom_point() + 84 | scale_color_metro() + 85 | theme_lucid() 86 | } 87 | -------------------------------------------------------------------------------- /man/theme_modern.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/theme_modern.R 3 | \name{theme_modern} 4 | \alias{theme_modern} 5 | \title{The easystats' minimal theme} 6 | \usage{ 7 | theme_modern( 8 | base_size = 11, 9 | base_family = "", 10 | plot.title.size = 1.35 * base_size, 11 | plot.title.face = "plain", 12 | plot.title.space = 1.8 * base_size, 13 | plot.title.position = "plot", 14 | legend.position = "right", 15 | axis.title.space = 1.8 * base_size, 16 | legend.title.size = 1.2 * base_size, 17 | legend.text.size = 1.1 * base_size, 18 | axis.title.size = 1.2 * base_size, 19 | axis.title.face = "plain", 20 | axis.text.size = 1.1 * base_size, 21 | axis.text.angle = NULL, 22 | tags.size = 1.35 * base_size, 23 | tags.face = "bold", 24 | show.ticks = FALSE, 25 | ... 26 | ) 27 | } 28 | \arguments{ 29 | \item{base_size}{base font size, given in pts.} 30 | 31 | \item{base_family}{base font family} 32 | 33 | \item{plot.title.size}{Title size in pts. Can be "none".} 34 | 35 | \item{plot.title.face}{Title font face ("plain", "italic", "bold", "bold.italic").} 36 | 37 | \item{plot.title.space}{Title spacing.} 38 | 39 | \item{plot.title.position}{Alignment of the plot title/subtitle and caption. 40 | The setting for plot.title.position applies to both the title and the 41 | subtitle. A value of "panel" (the default) means that titles and/or caption 42 | are aligned to the plot panels. A value of "plot" means that titles and/or 43 | caption are aligned to the entire plot (minus any space for margins and 44 | plot tag).} 45 | 46 | \item{legend.position}{the default position of legends ("none", "left", 47 | "right", "bottom", "top", "inside")} 48 | 49 | \item{axis.title.space}{Axis title spacing.} 50 | 51 | \item{legend.title.size}{Legend elements text size in pts.} 52 | 53 | \item{legend.text.size}{Legend elements text size in pts. Can be "none".} 54 | 55 | \item{axis.title.size}{Axis title text size in pts.} 56 | 57 | \item{axis.title.face}{Axis font face ("plain", "italic", "bold", "bold.italic").} 58 | 59 | \item{axis.text.size}{Axis text size in pts.} 60 | 61 | \item{axis.text.angle}{Rotate the x axis labels.} 62 | 63 | \item{tags.size}{Tags text size in pts.} 64 | 65 | \item{tags.face}{Tags font face ("plain", "italic", "bold", "bold.italic").} 66 | 67 | \item{show.ticks}{Logical, if \code{TRUE}, adds inner tick marks to the plot and 68 | slightly increases the padding between axis and the related labels.} 69 | 70 | \item{...}{Further arguments passed to \code{ggplot2::theme()}.} 71 | } 72 | \description{ 73 | A modern, sleek and elegant theme for ggplot. 74 | } 75 | \note{ 76 | Base elements like plot borders, titles etc. are scaling with 77 | \code{base_size}, i.e. when \code{base_size} is increased, all other relevant elements 78 | are increased in proportion to the base size, to ensure proper scaling of 79 | the plot. Set arguments for the related elements explicitly to define custom 80 | sizes. 81 | } 82 | \examples{ 83 | library(ggplot2) 84 | library(see) 85 | 86 | ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, color = Species)) + 87 | geom_point() + 88 | scale_color_see() + 89 | theme_modern() 90 | 91 | # for a slightly better orientation, tick marks can be added 92 | ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, color = Species)) + 93 | geom_point() + 94 | scale_color_see() + 95 | theme_modern(show.ticks = TRUE) 96 | } 97 | -------------------------------------------------------------------------------- /paper/paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper.pdf -------------------------------------------------------------------------------- /paper/paper_files/figure-latex/bayestestR-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper_files/figure-latex/bayestestR-1.pdf -------------------------------------------------------------------------------- /paper/paper_files/figure-latex/correlation-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper_files/figure-latex/correlation-1.pdf -------------------------------------------------------------------------------- /paper/paper_files/figure-latex/effectsize-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper_files/figure-latex/effectsize-1.pdf -------------------------------------------------------------------------------- /paper/paper_files/figure-latex/modelbased1-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper_files/figure-latex/modelbased1-1.pdf -------------------------------------------------------------------------------- /paper/paper_files/figure-latex/modelbased2-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper_files/figure-latex/modelbased2-1.pdf -------------------------------------------------------------------------------- /paper/paper_files/figure-latex/parameters1-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper_files/figure-latex/parameters1-1.pdf -------------------------------------------------------------------------------- /paper/paper_files/figure-latex/parameters2-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper_files/figure-latex/parameters2-1.pdf -------------------------------------------------------------------------------- /paper/paper_files/figure-latex/performance-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/paper/paper_files/figure-latex/performance-1.pdf -------------------------------------------------------------------------------- /pkgdown/_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: https://easystats.github.io/see/ 2 | 3 | template: 4 | bootstrap: 5 5 | package: easystatstemplate 6 | 7 | reference: 8 | - title: "Plotting Functions" 9 | contents: 10 | - contains("plot") 11 | 12 | - title: "Geoms" 13 | contents: 14 | - starts_with("geom_") 15 | 16 | - title: "Scales" 17 | contents: 18 | - starts_with("scale_color_") 19 | 20 | - title: "Themes" 21 | contents: 22 | - starts_with("theme_") 23 | 24 | - title: "Color Palettes" 25 | contents: 26 | - matches("_colors$") 27 | - matches("^palette_") 28 | 29 | - title: "Miscellaneous" 30 | contents: 31 | - add_plot_attributes 32 | - coord_radar 33 | - golden_ratio 34 | -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easystats/see/5fdeb7187e6c92a001b871a2218e8c149edc016b/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /revdep/README.md: -------------------------------------------------------------------------------- 1 | # Platform 2 | 3 | |field |value | 4 | |:--------|:-----------------------------------------| 5 | |version |R version 4.2.1 (2022-06-23) | 6 | |os |macOS Monterey 12.5.1 | 7 | |system |aarch64, darwin20 | 8 | |ui |RStudio | 9 | |language |(EN) | 10 | |collate |en_US.UTF-8 | 11 | |ctype |en_US.UTF-8 | 12 | |tz |Europe/Berlin | 13 | |date |2022-09-20 | 14 | |rstudio |2022.07.1+554 Spotted Wakerobin (desktop) | 15 | |pandoc |2.19.2 @ /usr/local/bin/ (via rmarkdown) | 16 | 17 | # Dependencies 18 | 19 | |package |old |new |Δ | 20 | |:-------|:-----|:-------|:--| 21 | |see |0.7.2 |0.7.2.3 |* | 22 | 23 | # Revdeps 24 | 25 | -------------------------------------------------------------------------------- /revdep/check.R: -------------------------------------------------------------------------------- 1 | tools::check_packages_in_dir( 2 | # dir = "C:/Users/mail/Documents/R/easystats", 3 | dir = "D:/mail/Documents/Coding/R/easystats/", 4 | check_args = c("--as-cran", ""), 5 | reverse = list(repos = getOption("repos")["CRAN"]) 6 | ) 7 | -------------------------------------------------------------------------------- /revdep/cran.md: -------------------------------------------------------------------------------- 1 | ## revdepcheck results 2 | 3 | We checked 16 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. 4 | 5 | * We saw 0 new problems 6 | * We failed to check 0 packages 7 | 8 | -------------------------------------------------------------------------------- /revdep/failures.md: -------------------------------------------------------------------------------- 1 | *Wow, no problems at all. :)* -------------------------------------------------------------------------------- /revdep/problems.md: -------------------------------------------------------------------------------- 1 | *Wow, no problems at all. :)* -------------------------------------------------------------------------------- /see.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | ProjectId: 8f812bb9-3e28-4923-9fd9-de63736dffd4 3 | 4 | RestoreWorkspace: No 5 | SaveWorkspace: No 6 | AlwaysSaveHistory: No 7 | 8 | EnableCodeIndexing: Yes 9 | UseSpacesForTab: Yes 10 | NumSpacesForTab: 2 11 | Encoding: UTF-8 12 | 13 | RnwWeave: Sweave 14 | LaTeX: pdfLaTeX 15 | 16 | AutoAppendNewline: Yes 17 | StripTrailingWhitespace: Yes 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | PackageRoxygenize: rd,collate,namespace 23 | 24 | QuitChildProcessesOnExit: Yes 25 | DisableExecuteRprofile: Yes 26 | -------------------------------------------------------------------------------- /see.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "version": "0.2.0", 9 | "configurations": [ 10 | { 11 | "type": "R-Debugger", 12 | "name": "Launch R-Workspace", 13 | "request": "launch", 14 | "debugMode": "workspace", 15 | "workingDirectory": "" 16 | } 17 | 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | # graphics engine changed in R 4.4, and so snapshots generated on 2 | # previous R version won't work 3 | if (getRversion() >= "4.4.0") { 4 | library(testthat) 5 | library(see) 6 | 7 | test_check("see") 8 | } 9 | -------------------------------------------------------------------------------- /tests/testthat/helper.R: -------------------------------------------------------------------------------- 1 | # commonly utilized models 2 | if ( 3 | suppressPackageStartupMessages(require( 4 | "rstanarm", 5 | warn.conflicts = FALSE, 6 | character.only = TRUE 7 | )) 8 | ) { 9 | m_rstan <<- suppressWarnings( 10 | rstanarm::stan_glm( 11 | Sepal.Length ~ Petal.Width * Species, 12 | data = datasets::iris, 13 | refresh = 0 14 | ) 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /tests/testthat/test-check_model.R: -------------------------------------------------------------------------------- 1 | test_that("`check_model()` works with lm", { 2 | skip_on_cran() 3 | skip_if_not_installed("merDeriv") 4 | 5 | data(mtcars) 6 | m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 7 | set.seed(123) 8 | x <- performance::check_model(m) 9 | # vdiffr test is too fragile for this complex of an output 10 | expect_s3_class(x, "check_model") 11 | }) 12 | -------------------------------------------------------------------------------- /tests/testthat/test-golden_ratio.R: -------------------------------------------------------------------------------- 1 | test_that("`golden_ratio()` works", { 2 | expect_equal(golden_ratio(10), 16.18034, tolerance = 0.01) 3 | }) 4 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.check_collinearity.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_check_collinearity()` works", { 2 | m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 3 | result <- performance::check_collinearity(m) 4 | expect_s3_class(plot(result), c("gg", "ggplot")) 5 | 6 | skip_if_not_installed("vdiffr") 7 | vdiffr::expect_doppelganger( 8 | title = "plot.check_collinearity", 9 | fig = plot(result) 10 | ) 11 | }) 12 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.check_distribution.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_check_distribution()` works", { 2 | skip_if_not_installed("randomForest") 3 | 4 | m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 5 | result <- performance::check_distribution(m) 6 | 7 | expect_s3_class(plot(result), "gg") 8 | }) 9 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.check_heteroscedasticity.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_check_heteroscedasticity()` works", { 2 | m <- stats::lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 3 | result <- performance::check_heteroscedasticity(m) 4 | 5 | expect_s3_class(plot(result, data = m), "gg") 6 | }) 7 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.check_homogeneity.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_check_homogeneity()` works", { 2 | m_lm <<- lm(len ~ supp + dose, data = ToothGrowth) 3 | result <- performance::check_homogeneity(m_lm) 4 | 5 | expect_s3_class(plot(result), "gg") 6 | }) 7 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.check_normality.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_check_normality()` works", { 2 | skip_if_not_installed("lme4") 3 | skip_if_not_installed("qqplotr") 4 | 5 | set.seed(123) 6 | m_lm <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) 7 | result1 <- performance::check_normality(m_lm) 8 | result2 <- performance::check_normality(m_lm) 9 | result3 <- performance::check_normality(m_lm) 10 | 11 | set.seed(123) 12 | data(sleepstudy, package = "lme4") 13 | m_lmer <<- lme4::lmer(Reaction ~ Days + (Days | Subject), sleepstudy) 14 | result4 <- performance::check_normality(m_lmer, "random") 15 | result5 <- performance::check_normality(m_lmer, "fixed") 16 | 17 | set.seed(123) 18 | vdiffr::expect_doppelganger( 19 | title = "check_normality works - lm - density", 20 | fig = plot(result1) 21 | ) 22 | 23 | vdiffr::expect_doppelganger( 24 | title = "check_normality works - lm - qq", 25 | fig = plot(result2, type = "qq") 26 | ) 27 | 28 | vdiffr::expect_doppelganger( 29 | title = "check_normality works - lm - pp", 30 | fig = plot(result3, type = "pp") 31 | ) 32 | 33 | set.seed(123) 34 | vdiffr::expect_doppelganger( 35 | title = "check_normality works - lmer - random", 36 | fig = plot(result4) 37 | ) 38 | 39 | vdiffr::expect_doppelganger( 40 | title = "check_normality works - lmer - fixed", 41 | fig = plot(result5) 42 | ) 43 | }) 44 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.check_outliers.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_check_outliers()` works", { 2 | mt1 <- mtcars[, c(1, 3, 4)] 3 | mt2 <- rbind( 4 | mt1, 5 | data.frame( 6 | mpg = c(37, 40), 7 | disp = c(300, 400), 8 | hp = c(110, 120) 9 | ) 10 | ) 11 | model <<- stats::lm(disp ~ mpg + hp, data = mt2) 12 | expect_s3_class( 13 | plot(performance::check_outliers(model, verbose = FALSE)), 14 | "gg" 15 | ) 16 | }) 17 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.cluster_analysis.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_cluster_analysis()` works", { 2 | groups <- parameters::cluster_analysis(iris[, 1:4], 3) 3 | expect_s3_class(plot(groups), "gg") 4 | }) 5 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.compare_parameters.R: -------------------------------------------------------------------------------- 1 | test_that("`plot()` for compare_parameters", { 2 | skip_if_not_installed("glmmTMB") 3 | skip_if_not_installed("lme4") 4 | skip_if_not_installed("parameters") 5 | gdat <- readRDS(system.file( 6 | "vignette_data", 7 | "gophertortoise.rds", 8 | package = "glmmTMB" 9 | )) 10 | form <- shells ~ prev + offset(log(Area)) + factor(year) + (1 | Site) 11 | gmod_glmer <- lme4::glmer(form, family = poisson, data = gdat) 12 | gprior <- data.frame( 13 | prior = "gamma(1e8, 2.5)", 14 | class = "theta", 15 | coef = "", 16 | stringsAsFactors = FALSE 17 | ) 18 | gmod_glmmTMB <- glmmTMB::glmmTMB( 19 | form, 20 | family = poisson, 21 | priors = gprior, 22 | data = gdat 23 | ) 24 | 25 | cp <- parameters::compare_parameters( 26 | gmod_glmer, 27 | gmod_glmmTMB, 28 | effects = "random" 29 | ) 30 | expect_warning(plot(cp), "No data left") 31 | 32 | vdiffr::expect_doppelganger( 33 | title = "plot.compare_parameters works", 34 | fig = plot(cp, show_intercept = TRUE) 35 | ) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.compare_performance.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_compare_performance()` works", { 2 | lm1 <- stats::lm(Sepal.Length ~ Species, data = iris) 3 | lm2 <- stats::lm(Sepal.Length ~ Species + Petal.Length, data = iris) 4 | lm3 <- stats::lm(Sepal.Length ~ Species * Petal.Length, data = iris) 5 | result <- performance::compare_performance(lm1, lm2, lm3) 6 | 7 | expect_s3_class(plot(result), "gg") 8 | }) 9 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.describe_distribution.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_parameters_distribution()` works", { 2 | set.seed(333) 3 | x <- sample.int(100, 1000, replace = TRUE) 4 | result <- datawizard::describe_distribution(x) 5 | expect_s3_class(plot(result), "gg") 6 | 7 | result <- datawizard::describe_distribution(iris) 8 | expect_true(all(vapply( 9 | plot(result), 10 | inherits, 11 | "gg", 12 | FUN.VALUE = logical(1L) 13 | ))) 14 | 15 | result <- datawizard::describe_distribution(iris, select = "Sepal.Length") 16 | expect_true(all(vapply( 17 | plot(result), 18 | inherits, 19 | "gg", 20 | FUN.VALUE = logical(1L) 21 | ))) 22 | }) 23 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.dw_data_tabulate.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.datawizard_table()` works with single table", { 2 | x <- datawizard::data_tabulate(mtcars, select = "cyl") 3 | expect_s3_class(plot(x), "gg") 4 | }) 5 | 6 | test_that("`plot.datawizard_table()` works with multiple tables", { 7 | x <- datawizard::data_tabulate(mtcars, select = c("cyl", "carb", "am")) 8 | expect_true(is.list(plot(x))) 9 | }) 10 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.easycormatrix.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_easycormatrix()` works", { 2 | result <- correlation::correlation(mtcars[, -(8:9)]) 3 | s <- summary(result) 4 | expect_s3_class(suppressWarnings(plot(s)), "gg") 5 | }) 6 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.effectsize_table.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_effectsize_table()` works", { 2 | m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars) 3 | result <- effectsize::eta_squared(m) 4 | set.seed(123) 5 | vdiffr::expect_doppelganger( 6 | title = "aov - eta_squared - dot plot", 7 | fig = plot(result) 8 | ) 9 | }) 10 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.equivalence_test.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_equivalence_test()` works", { 2 | skip_if_not_installed("ggridges") 3 | m_aov <- stats::aov(mpg ~ factor(am) * factor(cyl), data = mtcars) 4 | result_ez <- effectsize::eta_squared(m_aov, verbose = FALSE) 5 | expect_s3_class(plot(result_ez), "gg") 6 | }) 7 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.estimate_contrasts.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_estimate_contrasts()` works", { 2 | skip_if_not_installed("rstanarm") 3 | skip_if_not_installed("emmeans") 4 | skip_if_not_installed("marginaleffects") 5 | skip_if_not_installed("collapse") 6 | 7 | model <- stan_glm(Sepal.Width ~ Species, data = iris, refresh = 0) 8 | contrasts <- modelbased::estimate_contrasts(model, contrast = "Species") 9 | means <- modelbased::estimate_means(model, by = "Species") 10 | expect_s3_class(plot(contrasts, means), "gg") 11 | }) 12 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.estimate_density.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_estimate_density()` works", { 2 | skip_if_not_installed("correlation") 3 | skip_if_not_installed("rstanarm") 4 | skip_if_not_installed("ggridges") 5 | 6 | set.seed(123) 7 | result <- bayestestR::estimate_density(m_rstan) 8 | expect_s3_class(plot(result), "gg") 9 | }) 10 | 11 | 12 | test_that("`plot.see_estimate_density()`, adding prior layers works", { 13 | skip_if_not_installed("curl") 14 | skip_if_offline() 15 | skip_if_not_installed("httr2") 16 | skip_if_not_installed("rstanarm") 17 | skip_if_not_installed("ggridges") 18 | skip_if_not_installed("vdiffr") 19 | 20 | set.seed(123) 21 | m <<- insight::download_model("stanreg_glm_2") 22 | skip_if(is.null(m)) 23 | result <- bayestestR::estimate_density(m) 24 | set.seed(123) 25 | vdiffr::expect_doppelganger( 26 | title = "plot.estimate_density with piors", 27 | fig = plot(result, stack = FALSE, priors = TRUE) 28 | ) 29 | }) 30 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.hdi.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_hdi()` works", { 2 | skip_if_not_installed("rstanarm") 3 | skip_if_not_installed("ggridges") 4 | 5 | set.seed(123) 6 | result <- bayestestR::hdi(m_rstan) 7 | 8 | expect_s3_class(plot(result), "gg") 9 | }) 10 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.n_factors.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_n_factors()` works", { 2 | skip_if_not_installed("nFactors") 3 | 4 | result <- parameters::n_factors(datasets::mtcars, type = "PCA") 5 | 6 | set.seed(123) 7 | vdiffr::expect_doppelganger( 8 | title = "bar graph", 9 | fig = plot(result) 10 | ) 11 | 12 | set.seed(123) 13 | vdiffr::expect_doppelganger( 14 | title = "line graph", 15 | fig = plot(result, type = "line") 16 | ) 17 | 18 | set.seed(123) 19 | vdiffr::expect_doppelganger( 20 | title = "area graph", 21 | fig = plot(result, type = "area") 22 | ) 23 | }) 24 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.p_direction.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_p_direction()` works", { 2 | skip_if_not_installed("rstanarm") 3 | skip_if_not_installed("ggridges") 4 | 5 | set.seed(123) 6 | result <- bayestestR::p_direction(m_rstan) 7 | 8 | expect_s3_class(plot(result), "gg") 9 | }) 10 | 11 | skip_on_cran() 12 | skip_if_not_installed("bayestestR", minimum_version = "0.14.1") 13 | skip_if_not_installed("parameters", minimum_version = "0.22.3") 14 | 15 | test_that("`plot.see_p_direction` works {parameters}", { 16 | skip_if_not_installed("ggridges") 17 | 18 | data(qol_cancer, package = "parameters") 19 | model <- lm(QoL ~ time + age + education, data = qol_cancer) 20 | set.seed(123) 21 | out <- parameters::p_direction(model) 22 | vdiffr::expect_doppelganger( 23 | title = "plot.p_dir_frequ1", 24 | fig = plot(out) 25 | ) 26 | set.seed(123) 27 | out <- parameters::p_direction(model, null = 2) 28 | vdiffr::expect_doppelganger( 29 | title = "plot.p_dir_frequ2", 30 | fig = plot(out) 31 | ) 32 | }) 33 | 34 | test_that("plot p_direction, glmmTMB", { 35 | skip_if_not_installed("glmmTMB") 36 | skip_if_not_installed("ggridges") 37 | 38 | data(Salamanders, package = "glmmTMB") 39 | m1 <- glmmTMB::glmmTMB( 40 | count ~ mined + cover + (1 | site), 41 | zi = ~mined, 42 | family = poisson, 43 | data = Salamanders 44 | ) 45 | set.seed(123) 46 | out <- parameters::p_direction(m1) 47 | vdiffr::expect_doppelganger( 48 | title = "plot.p_dir_glmmTMB", 49 | fig = plot(out) 50 | ) 51 | }) 52 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.p_significance.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_p_significance()` works", { 2 | skip_if_not_installed("rstanarm") 3 | skip_if_not_installed("ggridges") 4 | 5 | set.seed(123) 6 | result <- bayestestR::p_significance(m_rstan) 7 | 8 | expect_s3_class(plot(result), "gg") 9 | }) 10 | 11 | skip_on_cran() 12 | skip_if_not_installed("bayestestR", minimum_version = "0.14.1") 13 | skip_if_not_installed("parameters", minimum_version = "0.22.3") 14 | 15 | test_that("`plot.see_p_significance works for two thresholds", { 16 | skip_if_not_installed("ggridges") 17 | 18 | set.seed(123) 19 | x <- rnorm(1000, 1, 1.2) 20 | out <- bayestestR::p_significance(x) 21 | vdiffr::expect_doppelganger( 22 | title = "plot.p_sig_simple_threshold", 23 | fig = plot(out) 24 | ) 25 | out <- bayestestR::p_significance(x, threshold = c(-0.2, 0.5)) 26 | vdiffr::expect_doppelganger( 27 | title = "plot.p_sig_threshold_2", 28 | fig = plot(out) 29 | ) 30 | }) 31 | 32 | test_that("`plot.see_p_significance works {parameters}}", { 33 | skip_if_not_installed("ggridges") 34 | 35 | data(qol_cancer, package = "parameters") 36 | model <- lm(QoL ~ time + age + education, data = qol_cancer) 37 | set.seed(123) 38 | out <- parameters::p_significance(model) 39 | vdiffr::expect_doppelganger( 40 | title = "plot.p_sig_frequ1", 41 | fig = plot(out) 42 | ) 43 | set.seed(123) 44 | out <- parameters::p_significance(model, threshold = c(-0.5, 3.3)) 45 | vdiffr::expect_doppelganger( 46 | title = "plot.p_sig_frequ2", 47 | fig = plot(out) 48 | ) 49 | set.seed(123) 50 | out <- parameters::p_significance(model, threshold = c(-0.5, 5)) 51 | vdiffr::expect_doppelganger( 52 | title = "plot.p_sig_frequ3", 53 | fig = plot(out) 54 | ) 55 | }) 56 | 57 | test_that("plot p_significance, glmmTMB", { 58 | skip_if_not_installed("glmmTMB") 59 | skip_if_not_installed("ggridges") 60 | 61 | data(Salamanders, package = "glmmTMB") 62 | m1 <- glmmTMB::glmmTMB( 63 | count ~ mined + cover + (1 | site), 64 | zi = ~mined, 65 | family = poisson, 66 | data = Salamanders 67 | ) 68 | set.seed(123) 69 | out <- parameters::p_significance(m1) 70 | vdiffr::expect_doppelganger( 71 | title = "plot.p_sig_glmmTMB", 72 | fig = plot(out) 73 | ) 74 | }) 75 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.parameters_pca.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_parameters_pca()` works", { 2 | result <- parameters::principal_components( 3 | mtcars[, 1:7], 4 | n = "all", 5 | threshold = 0.2 6 | ) 7 | expect_s3_class(plot(result), "gg") 8 | }) 9 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.parameters_simulate.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_parameters_simulate()` works", { 2 | m <<- lm(mpg ~ wt + cyl + gear, data = mtcars) 3 | result <- parameters::simulate_parameters(m) 4 | 5 | expect_s3_class(plot(result), "gg") 6 | }) 7 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.performance_pp_check.R: -------------------------------------------------------------------------------- 1 | test_that("`print.see_performance_pp_check()` works", { 2 | set.seed(123) 3 | model <- lm(Sepal.Length ~ Species * Petal.Width + Petal.Length, data = iris) 4 | result <- performance::check_predictions(model) 5 | 6 | vdiffr::expect_doppelganger( 7 | title = "pp check - lm", 8 | fig = plot(result) 9 | ) 10 | }) 11 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.performance_roc.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_performance_roc()` works", { 2 | set.seed(123) 3 | iris$y <- rbinom(nrow(iris), size = 1, 0.3) 4 | folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE) 5 | test_data <- iris[folds, ] 6 | train_data <- iris[-folds, ] 7 | model <- stats::glm( 8 | y ~ Sepal.Length + Sepal.Width, 9 | data = train_data, 10 | family = "binomial" 11 | ) 12 | result <- performance::performance_roc(model, new_data = test_data) 13 | 14 | vdiffr::expect_doppelganger( 15 | title = "plot.see_performance_roc() works", 16 | fig = plot(result) 17 | ) 18 | }) 19 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.point_estimates.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_point_estimate()` works", { 2 | skip_if_not_installed("rstanarm") 3 | 4 | set.seed(123) 5 | result <- bayestestR::point_estimate(m_rstan, centrality = "median") 6 | 7 | expect_s3_class(plot(result), "ggplot") 8 | }) 9 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.rope.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_rope()` works", { 2 | skip_if_not_installed("rstanarm") 3 | 4 | set.seed(123) 5 | result <- bayestestR::rope(m_rstan, verbose = FALSE) 6 | 7 | expect_s3_class(plot(result), "gg") 8 | }) 9 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.si.R: -------------------------------------------------------------------------------- 1 | test_that("`plot.see_si()` works", { 2 | skip_if_not_installed("rstanarm") 3 | skip_if_not_installed("logspline") 4 | 5 | set.seed(123) 6 | result <- bayestestR::si(m_rstan, verbose = FALSE) 7 | 8 | expect_s3_class(plot(result), "gg") 9 | }) 10 | -------------------------------------------------------------------------------- /tests/testthat/test-plot.simulate_parameters.R: -------------------------------------------------------------------------------- 1 | skip_if(TRUE) 2 | 3 | ## FIXME: currently does not retrieve the data 4 | 5 | skip_on_cran() 6 | skip_if_offline() 7 | skip_if_not_installed("mclogit") 8 | skip_if_not_installed("parameters") 9 | 10 | 11 | test_that("`plot()` for simulate_parameters", { 12 | pict <- base::readRDS(url("https://slcladal.github.io/data/pict.rda", "rb")) 13 | suppressWarnings({ 14 | m1.mn <- mclogit::mblogit( 15 | formula = Response ~ Gender + Group, 16 | random = ~ 1 | Item, 17 | data = pict 18 | ) 19 | }) 20 | set.seed(1234) 21 | ms <- parameters::simulate_parameters(m1.mn) 22 | set.seed(1234) 23 | vdiffr::expect_doppelganger( 24 | title = "plot.simulate_parameters works", 25 | fig = plot(ms) 26 | ) 27 | set.seed(1234) 28 | vdiffr::expect_doppelganger( 29 | title = "plot.simulate_parameters works-2", 30 | fig = plot(ms, stack = FALSE) 31 | ) 32 | set.seed(1234) 33 | vdiffr::expect_doppelganger( 34 | title = "plot.simulate_parameters works-3", 35 | fig = plot( 36 | ms, 37 | stack = FALSE, 38 | show_intercept = TRUE, 39 | normalize_height = TRUE 40 | ) 41 | ) 42 | set.seed(1234) 43 | vdiffr::expect_doppelganger( 44 | title = "plot.simulate_parameters works-4", 45 | fig = plot(ms, stack = TRUE, show_intercept = TRUE, normalize_height = TRUE) 46 | ) 47 | }) 48 | -------------------------------------------------------------------------------- /tests/testthat/test-plots.R: -------------------------------------------------------------------------------- 1 | test_that("`plots()` works", { 2 | skip_if_not_installed("patchwork") 3 | 4 | p1 <- ggplot(iris, aes(x = Petal.Length, y = Sepal.Width)) + 5 | geom_point() 6 | p2 <- ggplot(iris, aes(x = Petal.Length)) + 7 | geom_density() 8 | 9 | expect_s3_class(plots(p1, p2), "ggplot") 10 | }) 11 | -------------------------------------------------------------------------------- /tests/testthat/test-scale_color_colorhex_c.R: -------------------------------------------------------------------------------- 1 | test_that("scale_fill_colorhex works as expected", { 2 | set.seed(123) 3 | vdiffr::expect_doppelganger( 4 | title = "scale_fill_colorhex_d works", 5 | fig = ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + 6 | geom_violin() + 7 | scale_fill_colorhex_d(palette = 1014416) 8 | ) 9 | 10 | set.seed(123) 11 | vdiffr::expect_doppelganger( 12 | title = "scale_fill_colorhex_c works", 13 | fig = ggplot( 14 | iris, 15 | aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length) 16 | ) + 17 | geom_point() + 18 | scale_color_colorhex_c(palette = 1014416) 19 | ) 20 | }) 21 | -------------------------------------------------------------------------------- /tests/testthat/test-scale_color_values.R: -------------------------------------------------------------------------------- 1 | test_that("`bluebrown_colors()` works", { 2 | expect_identical( 3 | as.vector(bluebrown_colors("blue", "brown")), 4 | c("#5B93AE", "#61381A") 5 | ) 6 | }) 7 | 8 | 9 | test_that("`material_colors()` works", { 10 | expect_identical( 11 | as.vector(material_colors("indigo", "lime")), 12 | c("#3F51B5", "#CDDC39") 13 | ) 14 | }) 15 | 16 | 17 | test_that("`social_colors()` works", { 18 | expect_identical( 19 | as.vector(social_colors("dark red", "teal")), 20 | c("#b92b27", "#00b489") 21 | ) 22 | }) 23 | 24 | test_that("`see_colors()` works", { 25 | expect_identical( 26 | as.vector(see_colors("indigo", "lime")), 27 | c("#303960", "#f7fbe1") 28 | ) 29 | }) 30 | 31 | test_that("`flat_colors()` works", { 32 | expect_identical( 33 | as.vector(flat_colors("dark red", "teal")), 34 | c("#c0392b", "#16a085") 35 | ) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/testthat/test-vdiffr_bayestestr_plots.R: -------------------------------------------------------------------------------- 1 | test_that("bayestestR package plots rendered correctly", { 2 | # plot.see_bayesfactor_models() -------------------- 3 | 4 | lm0 <- stats::lm(qsec ~ 1, data = mtcars) 5 | lm1 <- stats::lm(qsec ~ drat, data = mtcars) 6 | lm2 <- stats::lm(qsec ~ wt, data = mtcars) 7 | lm3 <- stats::lm(qsec ~ drat + wt, data = mtcars) 8 | result <- bayestestR::bayesfactor_models(lm1, lm2, lm3, denominator = lm0) 9 | 10 | set.seed(123) 11 | vdiffr::expect_doppelganger( 12 | title = "`plot.see_bayesfactor_models()` works - 1", 13 | fig = plot(result, n_pies = "one", value = "probability", sort = TRUE) + 14 | scale_fill_pizza(reverse = TRUE) 15 | ) 16 | 17 | set.seed(123) 18 | vdiffr::expect_doppelganger( 19 | title = "`plot.see_bayesfactor_models()` works - 2", 20 | fig = plot(result, n_pies = "many", value = "BF", log = TRUE) + 21 | scale_fill_pizza(reverse = FALSE) 22 | ) 23 | }) 24 | -------------------------------------------------------------------------------- /tests/testthat/test-vdiffr_geoms_coords.R: -------------------------------------------------------------------------------- 1 | test_that("geom and coord functions work correctly", { 2 | skip_if_not_installed("ggplot2") 3 | # coord_radar() ------------------ 4 | 5 | data <- aggregate(iris[1:4], list(Species = iris$Species), mean) 6 | data <- datawizard::reshape_longer( 7 | data, 8 | c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width") 9 | ) 10 | 11 | set.seed(123) 12 | vdiffr::expect_doppelganger( 13 | title = "coord_radar() works", 14 | fig = ggplot2::ggplot( 15 | data, 16 | ggplot2::aes( 17 | x = name, 18 | y = value, 19 | color = Species, 20 | group = Species 21 | ) 22 | ) + 23 | ggplot2::geom_polygon(fill = NA, linewidth = 2) + 24 | coord_radar(start = -pi / 4) 25 | ) 26 | 27 | # geom_point2() ---------------------- 28 | 29 | normal <- ggplot2::ggplot( 30 | iris, 31 | ggplot2::aes(x = Petal.Width, y = Sepal.Length) 32 | ) + 33 | ggplot2::geom_point(size = 8, alpha = 0.3) + 34 | theme_modern() 35 | new <- ggplot2::ggplot( 36 | iris, 37 | ggplot2::aes(x = Petal.Width, y = Sepal.Length) 38 | ) + 39 | geom_point2(size = 8, alpha = 0.3) + 40 | theme_modern() 41 | 42 | set.seed(123) 43 | vdiffr::expect_doppelganger( 44 | title = "geom_point2()` works", 45 | fig = plots(normal, new, n_columns = 2) 46 | ) 47 | 48 | # geom_poolpoint() ---------------- 49 | 50 | set.seed(123) 51 | vdiffr::expect_doppelganger( 52 | title = "`geom_poolpoint()` works - 1", 53 | fig = ggplot2::ggplot( 54 | iris, 55 | ggplot2::aes(x = Petal.Width, y = Sepal.Length, color = Species) 56 | ) + 57 | geom_poolpoint(label = rownames(iris)) + 58 | scale_color_flat_d() + 59 | theme_modern() 60 | ) 61 | 62 | set.seed(123) 63 | vdiffr::expect_doppelganger( 64 | title = "`geom_poolpoint()` works - 2", 65 | fig = ggplot2::ggplot( 66 | iris, 67 | ggplot2::aes(x = Petal.Width, y = Sepal.Length, color = Species) 68 | ) + 69 | geom_pooljitter(label = rownames(iris)) + 70 | scale_color_flat_d() + 71 | theme_modern() 72 | ) 73 | 74 | # geom_violindot() ---------------------------- 75 | 76 | set.seed(123) 77 | vdiffr::expect_doppelganger( 78 | title = "geom_violindot() works", 79 | fig = ggplot2::ggplot( 80 | iris, 81 | ggplot2::aes(x = Species, y = Sepal.Length, fill = Species) 82 | ) + 83 | geom_violindot() + 84 | theme_modern() 85 | ) 86 | 87 | # geom_violinhalf() --------------------- 88 | 89 | set.seed(123) 90 | vdiffr::expect_doppelganger( 91 | title = "geom_violinhalf() works", 92 | fig = ggplot2::ggplot( 93 | iris, 94 | ggplot2::aes(x = Species, y = Sepal.Length, fill = Species) 95 | ) + 96 | geom_violinhalf() + 97 | theme_modern() + 98 | scale_fill_material_d() 99 | ) 100 | }) 101 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /vignettes/effectsize.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Plotting Functions for the 'effectsize' Package" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{Plotting Functions for the 'effectsize' Package} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include=FALSE, warning=FALSE, message=FALSE, echo=FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>", 14 | fig.width = 7, 15 | fig.height = 5, 16 | warning = FALSE, 17 | message = FALSE 18 | ) 19 | 20 | pkgs <- c("effectsize", "ggplot2") 21 | successfully_loaded <- vapply(pkgs, requireNamespace, FUN.VALUE = logical(1L), quietly = TRUE) 22 | can_evaluate <- all(successfully_loaded) 23 | 24 | if (can_evaluate && getRversion() >= "4.1.0") { 25 | knitr::opts_chunk$set(eval = TRUE) 26 | vapply(pkgs, require, FUN.VALUE = logical(1L), quietly = TRUE, character.only = TRUE) 27 | } else { 28 | knitr::opts_chunk$set(eval = FALSE) 29 | } 30 | ``` 31 | 32 | This vignette can be referred to by citing the package: 33 | 34 | ```{r} 35 | citation("see") 36 | ``` 37 | 38 | # Introduction 39 | 40 | The *effectsize* package in *easystats* provides utilities to work with indices of effect size and standardized parameters, allowing computation and conversion of indices such as Cohen’s *d*, *r*, odds-ratios, etc. 41 | 42 | For more, see: 43 | 44 | # Setup 45 | 46 | ```{r setup} 47 | library(effectsize) 48 | library(see) 49 | data(mtcars) 50 | data(iris) 51 | ``` 52 | 53 | # Effect size tables 54 | 55 | _([related function documentation](https://easystats.github.io/effectsize/reference/eta_squared.html))_ 56 | 57 | ```{r} 58 | aov(mpg ~ factor(am) * factor(cyl), data = mtcars) |> 59 | eta_squared() |> 60 | plot() 61 | 62 | 63 | t_to_d(t = c(1, -1.3, -3, 2.3), df_error = c(40, 35, 40, 85)) |> 64 | plot() 65 | ``` 66 | 67 | # Equivalence tests 68 | 69 | _([related function documentation](https://easystats.github.io/effectsize/reference/equivalence_test.effectsize_table.html))_ 70 | 71 | ```{r} 72 | aov(mpg ~ factor(am) * factor(cyl), data = mtcars) |> 73 | eta_squared() |> 74 | equivalence_test(range = 0.3) |> 75 | plot() 76 | 77 | 78 | t_to_d(t = c(1, -1.3, -3, 2.3), df_error = c(40, 35, 40, 85)) |> 79 | equivalence_test(range = 1) |> 80 | plot() 81 | ``` 82 | --------------------------------------------------------------------------------