diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index b6dc6779..b7fa6c96 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,31 +1,136 @@ -This is an R package that must strictly follow CRAN guidelines for code, documentation, and package structure. +# GitHub Copilot Instructions for RoBMA -Always use snake_case for function and variable names throughout the codebase. Use consistent style with the existing R code. +You are an expert R developer specializing in Bayesian statistics, meta-analysis, and package development. You are assisting with the `RoBMA` package. -Place all R scripts in the R/ directory, tests in tests/testthat/, and vignettes in vignettes/. +## Project Context +`RoBMA` (Robust Bayesian Meta-Analysis) is an R package that implements a framework for estimating ensembles of meta-analytic models. It uses Bayesian model averaging to combine competing models (e.g., presence/absence of effect, heterogeneity, publication bias). +- **Backend**: JAGS (via `runjags`/`rjags`) with custom C++ module for specialized distributions +- **Core Dependency**: `BayesTools` (handles priors, plotting, diagnostics, and generic Bayesian infrastructure) +- **Algorithms**: Two estimation approaches: `"bridge"` (bridge sampling, default) and `"ss"` (spike-and-slab approximation) -All exported functions require roxygen2 documentation with clear parameter descriptions, return values, and examples. +## Code Style & Conventions +- **Naming**: Use `snake_case` for all function names, arguments, and variables +- **Assignment**: Use `<-` for assignment (never `=`) +- **Indentation**: Use 2 spaces. No tabs +- **Boolean**: Always use `TRUE` and `FALSE`, never `T` or `F` +- **Comments**: Document complex logic with inline comments; use roxygen2 `#'` for function headers +- **Package calls**: Use explicit `::` notation (e.g., `BayesTools::check_bool()`), never `library()` or `require()` -Use testthat for all tests and ensure tests cover edge cases, error handling, and input validation. +## Documentation (roxygen2) +- All exported functions must be fully documented +- Required tags: `@title`, `@description`, `@param` (with types and defaults), `@return`, `@examples`, `@export` (if public) +- Use `\code{}` for variable names and code in docs; `\insertCite{key}{RoBMA}` for literature references +- Internal functions (starting with `.`) should have brief header comments explaining purpose and key concepts -When deprecating functions or arguments, use lifecycle badges and provide deprecation warnings with clear migration paths. +## Testing +- **Framework**: `testthat` in `tests/testthat/` +- **Naming**: Test files are numbered `test-XX-topic.R` (e.g., `test-04-fit.R`, `test-05-methods.R`) +- **Fast testing**: When developing, run `devtools::test(filter = "topic")` to focus on specific areas, model fits are cached to speed up tests (`devtools::test(filter = "fit")` must be run first to generate cached fits) +- **CRAN tests**: Use `skip_on_cran()` for computationally intensive model fitting tests +- **Requirements**: Test edge cases, error conditions, reproducibility; ensure CRAN compliance -Use message(), warning(), and stop() for user feedback instead of hardcoded messages. +## Architecture & Model Fitting Pipeline -Ensure all examples and vignettes are reproducible and do not rely on random seeds unless explicitly set. +### Component Separation (BayesTools vs RoBMA) +- **BayesTools**: Generic Bayesian infrastructure (general input validation via `check_XXX()`, JAGS settings via `JAGS_check_and_list_fit_settings()`, posterior mixing, plotting) +- **RoBMA**: Meta-analysis-specific logic (ensemble construction, model averaging, publication bias adjustment) +- **Rule**: If a feature is generic (not meta-analysis specific), suggest implementing it in `BayesTools` instead -Avoid using non-CRAN dependencies to maintain CRAN compliance. +### Model Fitting Flow (`R/fit-and-marglik.R`) +1. **Different Algorithms**: `algorithm = "bridge"` fits individual models and computes marginal likelihoods via bridge sampling; `algorithm = "ss"` fits a single spike-and-slab model +2. **Model Type Detection**: Helpers `.is_model_constant()`, `.is_model_regression()`, `.is_model_multivariate()` determine model characteristics +3. **Data Ordering**: Multivariate models require special data ordering via `.order_data.mv()` +4. **JAGS Model Generation**: Model syntax created via `.generate_model_syntax()` or `.generate_model_syntax.mv()` +5. **MCMC Sampling**: Uses `runjags::run.jags()` with automatic convergence checking (if `autofit = TRUE`) +6. **Marginal Likelihood Calculation**: Bridge sampling via `bridgesampling::bridge_sampler()` (for `algorithm = "bridge"`) +7. **Convergence**: Automatic refitting until criteria satisfied (see `.balance_component_probability()`) -Follow test-driven development practices and ensure comprehensive test coverage. +### Model Structure & Classes +- **Base class**: `RoBMA` (S3 object containing `models` list, `data`, `fit_control`, etc.) +- **Subclasses**: `RoBMA.reg` (meta-regression), `BiBMA` (binomial-normal for binary outcomes) +- **Class hierarchy**: `c("BiBMA", "RoBMA")` or `c("RoBMA", "RoBMA.reg")` for method dispatch +- **Key methods**: `summary.RoBMA()`, `plot.RoBMA()`, `update.RoBMA()`, `predict.RoBMA()` -RoBMA is a meta-analysis package that implements Bayesian meta-analytic models using JAGS. -It is designed to be a user-friendly interface for conducting Bayesian meta-analyses, -while providing flexibility for advanced users to customize their analyses. +### Model Averaging & Inference (`R/inference-and-model-averaging.R`) +- **Component Structure**: Each model characterized by which components are null vs alternative hypothesis +- **Averaged vs Conditional Estimates**: Separate functions for overall averaged estimates and conditional estimates given specific components +- **Regression Terms**: Handled separately via `predictors_test` and `terms_test` -For interaction with JAGS, posterior samples, prior distributions, plotting, diagnostics, etc., -import functions from the BayesTools package. The purpose of the BayesTools package is to contain all -generic functionality that is not meta-analysis specific and that can be reused across different packages. +## Key Files & Their Roles +- `R/RoBMA.R`: Main user interface; ensemble specification via prior lists +- `R/RoBMA-reg.R`: Meta-regression wrapper (uses formula interface) +- `R/BiBMA.R`, `R/BiBMA-reg.R`: Binomial-normal models for binary outcomes +- `R/NoBMA.R`: Publication bias unadjusted models +- `R/priors.R`: Re-exports from `BayesTools` (e.g., `prior()`, `prior_weightfunction()`, `prior_PET()`) +- `R/fit-and-marglik.R`: MCMC fitting and marginal likelihood computation (1745 lines, core logic) +- `R/inference-and-model-averaging.R`: BMA weights, Bayes factors, posterior mixing +- `R/check-input-and-settings.R`: Input validation and `check_setup()` for previewing ensembles +- `R/check-priors-and-models.R`: Prior specification validation +- `R/summary.R`, `R/summary-effect.R`, `R/summary-heterogeneity.R`: Result summaries and statistics +- `R/plots.R`: Plotting methods (forest, funnel, model weights) +- `R/zcurve.R`: Meta-analytic z-curve diagnostics for publication bias +- `R/transformations.R`: Effect size conversions (Cohen's d ↔ Fisher's z ↔ log OR ↔ r) -If a new generic functionality is needed, make note that such a feature should be implemented in BayesTools directly. +## JAGS Extension (src/) +The package includes a compiled JAGS module with custom distributions for meta-analysis. -When you need to use R console, call radian. \ No newline at end of file +### Structure +- `src/RoBMA.cc`: Module registration (registers all distributions and functions) +- `src/distributions/`: Custom JAGS distributions (e.g., `DWT1.cc` for weighted t-distribution, `DWMN1.cc` for weighted multivariate normal) +- `src/functions/`: Custom JAGS functions (e.g., `mnorm.cc`, `wmnorm.cc`) +- `src/transformations/`: Effect size transformations (d, r, z, logOR, omega) +- `src/Makevars.win`, `src/Makevars.ucrt`, `src/Makevars.in`: Platform-specific build configs +- `configure`, `configure.ac`, `configure.win`: Detect JAGS installation + +### Adding New JAGS Distributions +1. Implement `.cc` and `.h` files in `src/distributions/` (follow existing patterns like `DWT1.cc`) +2. Add common functions to `src/source/` if needed +3. Register in `src/RoBMA.cc` via `insert(new YourDistribution);` +4. Add to `OBJECTS` in all `Makevars*` files + +### Build Notes +- Requires JAGS ≥ 4.3.1 installed +- Windows: Uses `PKG_CXXFLAGS = -D_GLIBCXX_USE_CXX11_ABI=0` to match JAGS 4.x ABI +- On Windows, JAGS is detected via `JAGS_ROOT` (defaults to `/c/progra~1/JAGS/JAGS-4.3.1`) + +## Developer Workflows + +### Building & Checking +```r +# Standard R CMD check workflow +devtools::load_all() # Load during development +devtools::document() # Update documentation +devtools::test() # Run tests +devtools::check() # Full package check +``` + +### Common Development Tasks +- **Preview ensemble**: Use `check_setup()` to see model structure before fitting +- **Debugging fits**: Check `.is_model_constant()`, `.is_model_regression()`, `.is_model_multivariate()` helpers +- **Algorithm differences**: `algorithm = "bridge"` (individual models + bridge sampling) vs `algorithm = "ss"` (single spike-and-slab model) +- **Convergence issues**: `.balance_component_probability()` handles failed models automatically + +### Vignettes (vignettes/) +- `Tutorial.Rmd`: Main introduction to RoBMA-PSMA +- `ReproducingBMA.Rmd`: Classic Bayesian model-averaged meta-analysis +- `MetaRegression.Rmd`: `RoBMA.reg()` with moderators +- `HierarchicalRoBMA.Rmd`: Multilevel RoBMA +- `HierarchicalRoBMARegression.Rmd`: Multilevel RoBMA with moderators +- `HierarchicalBMA.Rmd`: Multilevel models via `study_ids` +- `MedicineBMA.Rmd`, `MedicineBiBMA.Rmd`: Informed priors for medical meta-analysis +- `CustomEnsembles.Rmd`: Advanced ensemble customization +- `FastRoBMA.Rmd`: Spike-and-slab algorithm (`algorithm = "ss"`) +- `ZCurveDiagnostics.Rmd`: Publication bias diagnostics + +## CRAN Compliance +- **Dependencies**: Minimize new dependencies; prefer base R or `BayesTools` utilities +- **No tidyverse**: Package maintains low dependency footprint +- **No side effects**: Never write to user directories without permission +- **Namespace**: Always use `::` for package functions (no `library()` in code) +- **Tests**: Wrap long-running tests with `skip_on_cran()` + +## Interaction Guidelines +- When implementing features, check if they belong in `BayesTools` (generic) or `RoBMA` (meta-analysis-specific) +- For effect size code, check `R/transformations.R` first (conversions already implemented) +- When modifying JAGS distributions, update all relevant Makevars files +- Keep this instruction file concise and focused on RoBMA-specific patterns diff --git a/.github/instructions/vignettes.instructions.md b/.github/instructions/vignettes.instructions.md new file mode 100644 index 00000000..8dc4e09e --- /dev/null +++ b/.github/instructions/vignettes.instructions.md @@ -0,0 +1,355 @@ +--- +applyTo: "**/vignettes/*.Rmd" +--- + +# Vignette Writing Instructions for RoBMA + +This document provides guidance for writing and maintaining vignettes in the RoBMA package. + +## Overview + +RoBMA vignettes are R Markdown documents that demonstrate package functionality with real-world examples. They are pre-computed and cached to avoid CRAN check timeouts, as Bayesian model fitting is computationally intensive. + +## Vignette Structure + +### Current Vignettes +1. **Tutorial.Rmd** - Introduction to RoBMA-PSMA (publication bias adjustment) +2. **ReproducingBMA.Rmd** - Classic Bayesian model-averaged meta-analysis (no publication bias) +3. **MetaRegression.Rmd** - `RoBMA.reg()` with moderators +4. **HierarchicalRoBMA.Rmd** - Multilevel RoBMA +5. **HierarchicalRoBMARegression.Rmd** - Multilevel RoBMA with moderators +6. **HierarchicalBMA.Rmd** - Simpler multilevel models via `study_ids` +7. **MedicineBMA.Rmd** - Informed priors for medical meta-analysis (continuous outcomes) +8. **MedicineBiBMA.Rmd** - Informed priors for binary outcomes (log OR, RR, RD, HR) +9. **CustomEnsembles.Rmd** - Advanced ensemble customization +10. **FastRoBMA.Rmd** - Spike-and-slab algorithm (`algorithm = "ss"`) +11. **ZCurveDiagnostics.Rmd** - Meta-analytic z-curve publication bias diagnostics + +## Standard YAML Header + +```yaml +--- +title: "Your Vignette Title" +author: "Author Name(s)" +date: "`r Sys.Date()`" # or fixed year for published papers +output: + rmarkdown::html_vignette: + self_contained: yes +bibliography: ../inst/REFERENCES.bib +csl: ../inst/apa.csl +vignette: > + %\VignetteIndexEntry{Your Vignette Title} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} + %\VignetteEngine{knitr::rmarkdown_notangle} +--- +``` + +**Important**: Use `../inst/REFERENCES.bib` (relative path) for bibliography, not absolute paths. + +## Code Chunk Strategy (Pre-computation Pattern) + +All vignettes follow a **three-chunk pattern** to handle computationally expensive model fitting: + +### Chunk 1: Setup & Check Detection +```r +```{r setup, include = FALSE} +is_check <- ("CheckExEnv" %in% search()) || + any(c("_R_CHECK_TIMINGS_", "_R_CHECK_LICENSE_") %in% names(Sys.getenv())) || + !file.exists("../models/YourVignette/your_model.RDS") +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + eval = !is_check, + dev = "png") +if(.Platform$OS.type == "windows"){ + knitr::opts_chunk$set(dev.args = list(type = "cairo")) +} +``` +``` + +**Purpose**: Detect CRAN checks or missing cached models and disable evaluation to avoid timeouts. + +### Chunk 2: Load Pre-computed Models +```r +```{r include = FALSE} +library(RoBMA) +# Pre-load fitted models to avoid re-fitting during vignette build +fit_model <- readRDS(file = "../models/YourVignette/your_model.RDS") +``` +``` + +**Purpose**: Load cached model results silently (not shown to user). + +### Chunk 3: Model Fitting Code (Not Evaluated) +```r +```{r include = FALSE, eval = FALSE} +# R package version updating +library(RoBMA) + +# Actual model fitting code that was used to create cached models +fit_model <- RoBMA(d = data$d, se = data$se, seed = 1, parallel = TRUE) + +# Save for future vignette builds +saveRDS(fit_model, file = "../models/YourVignette/your_model.RDS") +``` +``` + +**Purpose**: Document the exact code used to generate cached models. This is **never evaluated** during package checks but serves as a record for updating models when package versions change. + +### Why This Pattern? + +- **CRAN compliance**: Vignettes must build in < 10 minutes; MCMC fitting takes much longer +- **Reproducibility**: Exact fitting code is preserved but not executed +- **Version tracking**: When RoBMA updates, re-run chunk 3 to regenerate all cached models +- **User clarity**: Users see the actual fitting code in chunk 3 (via `include = FALSE` it doesn't clutter output) + +## Model Caching Location + +All pre-computed models are stored in `models/` directory: +``` +models/ + Tutorial/ + fit_RoBMA_Lui2015.RDS + ReproducingBMA/ + PowerPoseTest.RDS + MetaRegression/ + fit_RoBMA.RDS + ... +``` + +- **Naming convention**: Use descriptive names (dataset + model type) +- **Compression**: Use `compress = "xz"` for large models: `saveRDS(fit, file = "path.RDS", compress = "xz")` +- **Git tracking**: Models are committed to the repository (not gitignored) + +## Code Presentation for Users + +Code that **users should see and run** goes in regular chunks: + +```r +```{r} +library(RoBMA) +data("Lui2015", package = "RoBMA") +head(Lui2015) +``` +``` + +**Never show** the model loading code (`readRDS()`) to users. They should see the fitting code from chunk 3. + +## Displaying Pre-computed Results + +After loading cached models with `readRDS()`, display them normally: + +```r +```{r} +# This uses the pre-loaded fit_model from chunk 2 +summary(fit_model) +plot(fit_model, parameter = "mu") +``` +``` + +Users see the output without knowing it came from cache. + +## Citations + +Use `\insertCite{key}{RoBMA}` for inline citations: +- `\insertCite{bartos2021no}{RoBMA}` → (Bartoš et al., 2021) +- `\insertCite{bartos2021no;textual}{RoBMA}` → Bartoš et al. (2021) + +Add new references to `inst/REFERENCES.bib`. The bibliography is automatically rendered at the end. + +## Code Style in Vignettes + +- **Function calls**: Use full argument names for clarity (no abbreviations) +- **Seeds**: Always set `seed = 1` (or another fixed value) for reproducibility +- **Parallel processing**: Use `parallel = TRUE` when fitting to speed up model generation +- **Save argument**: Consider `save = "min"` to reduce model size if posterior samples aren't needed + +### Example +```r +fit <- RoBMA( + d = data$effectSize, + se = data$SE, + seed = 1, + parallel = TRUE, + save = "min" # Reduces file size +) +``` + +## Figures + +- **Captions**: Use `fig.cap` for meaningful captions + ```r + ```{r, fig.cap="Forest Plot of Effect Sizes"} + forest(fit_model) + ``` + ``` +- **Size**: Let knitr use defaults; override only if necessary +- **Device**: The setup chunk handles Windows Cairo device automatically + +## Updating Vignettes for New Package Versions + +When RoBMA is updated and model structures change: + +1. **Identify affected vignettes** (check NEWS.md for breaking changes) +2. **Re-run chunk 3** in each affected vignette: + ```r + # Set eval = TRUE temporarily in chunk 3 header + ```{r include = FALSE, eval = TRUE} + ``` +3. **Verify outputs** match expectations +4. **Commit updated .RDS files** to `models/` +5. **Reset chunk 3** back to `eval = FALSE` +6. **Rebuild vignettes**: `devtools::build_vignettes()` + +## Testing Vignettes Locally + +```r +# Build all vignettes +devtools::build_vignettes() + +# Preview specific vignette +rmarkdown::render("vignettes/Tutorial.Rmd") + +# Check if vignettes build during R CMD check +devtools::check() +``` + +## Common Pitfalls + +❌ **Don't** use `library()` or `require()` in package functions (only in vignettes is OK) +❌ **Don't** use absolute paths (`C:/Users/...`) +❌ **Don't** commit temporary files (`.html` vignette outputs go to `doc/`) +❌ **Don't** use `eval = TRUE` in chunk 3 (model fitting) unless intentionally regenerating +✅ **Do** use relative paths (`../models/`, `../inst/`) +✅ **Do** compress models (`compress = "xz"`) +✅ **Do** test that vignettes build with `is_check = TRUE` condition (simulates CRAN) + +## Example Vignette Skeleton + +```rmd +--- +title: "My New RoBMA Vignette" +author: "Your Name" +date: "`r Sys.Date()`" +output: + rmarkdown::html_vignette: + self_contained: yes +bibliography: ../inst/REFERENCES.bib +csl: ../inst/apa.csl +vignette: > + %\VignetteIndexEntry{My New RoBMA Vignette} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup, include = FALSE} +is_check <- ("CheckExEnv" %in% search()) || + any(c("_R_CHECK_TIMINGS_", "_R_CHECK_LICENSE_") %in% names(Sys.getenv())) || + !file.exists("../models/MyVignette/my_model.RDS") +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + eval = !is_check, + dev = "png") +if(.Platform$OS.type == "windows"){ + knitr::opts_chunk$set(dev.args = list(type = "cairo")) +} +``` + +```{r include = FALSE} +library(RoBMA) +my_model <- readRDS(file = "../models/MyVignette/my_model.RDS") +``` + +```{r include = FALSE, eval = FALSE} +library(RoBMA) +data("MyData", package = "RoBMA") + +my_model <- RoBMA(d = MyData$d, se = MyData$se, seed = 1, parallel = TRUE) +saveRDS(my_model, file = "../models/MyVignette/my_model.RDS") +``` + +## Introduction + +This vignette demonstrates... + +```{r} +library(RoBMA) +data("MyData", package = "RoBMA") +head(MyData) +``` + +## Analysis + +```{r} +summary(my_model) +``` + +## References +``` + +## Prose Editing Guidelines + +When editing vignette prose, follow the Eric-Jan Wagenmakers style: concise, direct, and logically structured. Clarify meaning, tighten flow, and preserve all scientific content. + +### Writing Style & Formatting +- **Concise and Direct**: Use simple sentences to describe outputs. Avoid flowery language or filler phrases. +- **No Excessive Bold**: Use bold text sparingly. Do not bold every list item or emphasis point. Use it only for headers or defining key terms. +- **Flowing Text**: Prefer paragraphs over bulleted lists when describing plots or outputs. Integrate the description into a narrative flow. +- **Interpretation Focused**: Focus on what the output *means* (interpretation) rather than just listing what is displayed. +- **Concrete Examples**: Use specific values from the example to illustrate points (e.g., "In our example, we find..."). +- **Technical but Accessible**: Use correct terminology (e.g., "heterogeneity allocation parameter") but explain it simply. + +### Non-Negotiables +- **Do not** add/remove references, change results, mathematical notation, or variable names +- **Preserve UI specifics exactly**: argument names like `priors_effect`, function names like `RoBMA.reg()`, parameter names like `mu`, `tau`, `omega` +- **Keep defined abbreviations**; spell out on first use (e.g., "Markov Chain Monte Carlo (MCMC)") +- **Prefer full terms**: "prior distributions" over "priors"; spell out "null hypothesis" and "alternative hypothesis" +- **Do not omit technical details**: exact argument labels, full file paths, figure references + +### Voice & Rhythm +- **Prefer passive tense** for objectivity, but use collaborative first-person plural ("we set...", "we estimate...") when it improves flow +- **Avoid "we... we..." runs**: vary sentence structure to maintain rhythm +- **Keep tone precise and readable**: cut redundancy, avoid filler phrases, use commas for disambiguation only + +### Editing Passes (Apply in Order) + +1. **Meaning**: Remove clutter; define key terms briefly when first introduced; add a concrete example if needed for clarity +2. **Structure**: Smooth transitions between paragraphs; align parallel or contrasting ideas; keep section logic tight +3. **Emphasis & Rhythm**: Place key words in strong positions (sentence start/end); use light anaphora/epistrophe only if it clarifies +4. **Style**: One tasteful rhetorical device per sentence at most (e.g., parallelism, anticipating objections); maintain EJW tone +5. **Polish**: Fix punctuation for disambiguation; correct typos quietly + +### Clarity Techniques (Use Sparingly) +- **Parallelism**: Align list items or related sentences for easier comparison +- **Procatalepsis**: Anticipate and answer likely reader objections in one sentence when helpful +- **Selective repetition**: Repeat key terms for emphasis, but avoid redundancy + +### Examples + +❌ **Verbose**: "In this section, we are going to discuss how to fit models using the RoBMA package" +✅ **Concise**: "We fit models using the `RoBMA()` function" + +❌ **Vague**: "We can use different priors for the analysis" +✅ **Specific**: "We specify prior distributions via the `priors_effect` and `priors_heterogeneity` arguments" + +❌ **Redundant**: "The results show that the effect is significant and statistically significant" +✅ **Tight**: "The effect is statistically significant" + +❌ **Cluttered**: "We can see from the output that..." +✅ **Direct**: "The output shows..." + +❌ **Excessive Bold/Lists**: +> This plot displays: +> - **x-axis**: One-sided *p*-value cutoffs +> - **y-axis**: Relative probability of publication + +✅ **Flowing Description**: +> The plot displays one-sided *p*-value cutoffs (x-axis) against relative publication probability (y-axis). + +## Additional Resources + +- [R Markdown Guide](https://rmarkdown.rstudio.com/articles_intro.html) +- [Vignette Best Practices](https://r-pkgs.org/vignettes.html) +- RoBMA paper: \insertCite{bartos2022adjusting}{RoBMA} diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 4df8201f..b6f63886 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -137,26 +137,23 @@ jobs: # This follows the rjags installation advice: pass --with-jags-prefix when needed. Rscript -e "install.packages('rjags', configure.args=c('--with-jags-prefix=${jags_prefix}'), repos='https://cloud.r-project.org')" - # Set up renv - - name: Setup renv - uses: r-lib/actions/setup-renv@v2 # Install the package - name: Install devtools and the RoBMA Package run: | options(repos = c(CRAN = "https://cloud.r-project.org")) - + # Check if packages are already installed before installing - required_packages <- c('devtools', 'rcmdcheck', 'metaBMA', 'metafor', 'weightr', 'lme4', 'fixest', 'emmeans', 'metadat', 'vdiffr', 'testthat', 'covr', 'pandoc') + required_packages <- c('devtools', 'rcmdcheck', 'metaBMA', 'metafor', 'weightr', 'lme4', 'fixest', 'emmeans', 'metadat', 'vdiffr', 'testthat', 'covr', 'pandoc', 'cli') missing_packages <- required_packages[!sapply(required_packages, requireNamespace, quietly = TRUE)] - + if (length(missing_packages) > 0) { cat("Installing missing packages:", paste(missing_packages, collapse = ", "), "\n") install.packages(missing_packages) } else { cat("All required packages are already installed\n") } - + devtools::install() shell: Rscript {0} diff --git a/.github/workflows/R-CMD-tests.yaml b/.github/workflows/R-CMD-tests.yaml index 7a12dd74..14599a7e 100644 --- a/.github/workflows/R-CMD-tests.yaml +++ b/.github/workflows/R-CMD-tests.yaml @@ -131,26 +131,22 @@ jobs: # Pre-install rjags so tests can load it later Rscript -e "install.packages('rjags', configure.args=c('--with-jags-prefix=${jags_prefix}'), repos='https://cloud.r-project.org')" - # Set up renv - - name: Setup renv - uses: r-lib/actions/setup-renv@v2 - # Install the package - name: Install devtools and the RoBMA Package run: | options(repos = c(CRAN = "https://cloud.r-project.org")) - + # Check if packages are already installed before installing required_packages <- c('devtools', 'metaBMA', 'metafor', 'weightr', 'lme4', 'fixest', 'emmeans', 'metadat', 'vdiffr', 'testthat', 'covr', 'pandoc') missing_packages <- required_packages[!sapply(required_packages, requireNamespace, quietly = TRUE)] - + if (length(missing_packages) > 0) { cat("Installing missing packages:", paste(missing_packages, collapse = ", "), "\n") install.packages(missing_packages) } else { cat("All required packages are already installed\n") } - + devtools::install() shell: Rscript {0} diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index a0354226..0e688560 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -62,22 +62,18 @@ jobs: libcairo2-dev \ jags - # Set up renv to match the R-CMD-tests workflow - - name: Setup renv - uses: r-lib/actions/setup-renv@v2 - # Install packages matching R-CMD-tests workflow - name: Install R packages run: | options(repos = c(CRAN = "https://cloud.r-project.org")) - + # Check if packages are already installed before installing core_packages <- c('devtools', 'metaBMA', 'metafor', 'weightr', 'lme4', 'fixest', 'emmeans', 'metadat', 'vdiffr', 'testthat', 'covr', 'pandoc') dev_packages <- c('roxygen2', 'pkgdown', 'rcmdcheck', 'rjags', 'runjags', 'BayesTools', 'coda', 'bridgesampling', 'mvtnorm', 'extraDistr', 'ggplot2', 'scales', 'checkmate') all_packages <- c(core_packages, dev_packages) - + missing_packages <- all_packages[!sapply(all_packages, requireNamespace, quietly = TRUE)] - + if (length(missing_packages) > 0) { cat("Installing missing packages:", paste(missing_packages, collapse = ", "), "\n") install.packages(missing_packages) @@ -100,7 +96,7 @@ jobs: - name: Test JAGS R interface run: | cat('R version:', R.version.string, '\n') - + # Test rjags connection if (require(rjags, quietly = TRUE)) { cat('rjags loaded successfully\n') @@ -128,7 +124,7 @@ jobs: # Load example data data("Anderson2010", package = "RoBMA") cat('Example data loaded successfully\n') - + # Test basic package loading library(RoBMA) cat('RoBMA package loaded successfully\n') diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index e2c21f64..64b1823f 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -68,10 +68,6 @@ jobs: echo JAGS_MAJOR_VERSION=4>> %GITHUB_ENV% echo PATH=C:\Program Files\JAGS\JAGS-4.3.1\bin;%PATH%>> %GITHUB_ENV% - # Set up renv - - name: Setup renv - uses: r-lib/actions/setup-renv@v2 - # Install Pandoc - name: Setup Pandoc uses: r-lib/actions/setup-pandoc@v2 @@ -80,18 +76,18 @@ jobs: - name: Install devtools and the RoBMA Package run: | options(repos = c(CRAN = "https://cloud.r-project.org")) - + # Check if packages are already installed before installing required_packages <- c('devtools', 'pkgdown', 'metaBMA', 'metafor', 'weightr', 'lme4', 'fixest', 'emmeans', 'metadat', 'vdiffr', 'testthat', 'covr', 'pandoc') missing_packages <- required_packages[!sapply(required_packages, requireNamespace, quietly = TRUE)] - + if (length(missing_packages) > 0) { cat("Installing missing packages:", paste(missing_packages, collapse = ", "), "\n") install.packages(missing_packages) } else { cat("All required packages are already installed\n") } - + devtools::install() shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index a8e05787..316fa617 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: RoBMA Title: Robust Bayesian Meta-Analyses -Version: 3.6.0 +Version: 3.6.1 Maintainer: František Bartoš Authors@R: c( person("František", "Bartoš", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index ea10bffc..6ad31400 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +## version 3.6.1 +### Features +- `Explanation` vignette that helps navigate users through the vignettes +- two vignettes demonstrating robust Bayesian meta-analysis and meta-regressions +- `summary()` function now provides publication bias model type summary (`type = "models"`) for models fitted using `algorithm = "ss"` +- improves control over `plot.zcurve_RoBMA` (i.e., specifying col, border, etc for the individual elements) + ## version 3.6 ### Features - `funnel()` plot to visualize residuals vs the expected sampling distribution for `RoBMA()` and `RoBMA.reg()` models when using the `algorithm = "ss"` diff --git a/R/datasets.R b/R/datasets.R index 6ce21fb5..8e374880 100644 --- a/R/datasets.R +++ b/R/datasets.R @@ -172,7 +172,7 @@ #' dataset type (proximal vs. distal), and mediation variables (r_xm, r_my). #' The meta-analysis examined whether subjective ease mediates the ease-of-retrieval effect, #' where participants list either few or many examples and then make judgments -#' \insertCite{weingarten2018does}{RoBMA}. +#' \insertCite{weingarten2018does}{RoBMA}. #' #' @format A data.frame with 12 columns and 582 observations. #' @@ -182,3 +182,36 @@ #' \insertAllCited{} "Weingarten2018" + +#' @title 412 effect sizes from a meta-analysis of secondary benefits of family-based treatments +#' by \insertCite{johnides2025secondary;textual}{RoBMA} +#' +#' @description The data set contains Cohen's d effect sizes, standard errors, and study labels +#' from a meta-analysis investigating the extent to which family-based treatments for children +#' with mental health, physical health, and developmental disorders provide secondary benefits +#' to the children's siblings and caregivers \insertCite{johnides2025secondary}{RoBMA}. +#' +#' @format A data.frame with 3 columns and 412 observations. +#' +#' @return a data.frame. +#' +#' @references +#' \insertAllCited{} +"Johnides2025" + + +#' @title 1159 effect sizes from a meta-analysis of beauty and professional success +#' by \insertCite{havrankova2025beauty;textual}{RoBMA} +#' +#' @description The data set contains effect sizes (percent increase in earnings), standard errors, +#' study identifiers, sample sizes, and the type of customer contact (no, some, or direct). +#' The meta-analysis examined the relationship between perceived beauty and professional success +#' \insertCite{havrankova2025beauty}{RoBMA}. +#' +#' @format A data.frame with 5 columns and 1159 observations. +#' +#' @return a data.frame. +#' +#' @references +#' \insertAllCited{} +"Havrankova2025" \ No newline at end of file diff --git a/R/plots.R b/R/plots.R index 2c167962..2869067c 100644 --- a/R/plots.R +++ b/R/plots.R @@ -382,13 +382,13 @@ forest <- function(x, conditional = FALSE, plot_type = "base", output_scale = NU plot <- ggplot2::ggplot() # add the studies - plot <- plot +ggplot2::geom_errorbarh( + plot <- plot +ggplot2::geom_errorbar( mapping = ggplot2::aes( xmin = data$lCI, xmax = data$uCI, y = data$x), color = "black", - height = .25) + width = .25) plot <- plot +ggplot2::geom_point( mapping = ggplot2::aes( x = data$y, diff --git a/R/summary.R b/R/summary.R index 25b4cbae..40aa06d1 100644 --- a/R/summary.R +++ b/R/summary.R @@ -523,7 +523,7 @@ summary.RoBMA <- function(object, type = "ensemble", conditional = FALSE, return(output) - }else{ + }else if(substr(type,1,1) == "d"){ # transform the estimates if needed if(object$add_info[["output_scale"]] != output_scale){ @@ -574,6 +574,76 @@ summary.RoBMA <- function(object, type = "ensemble", conditional = FALSE, return(output) + }else if(substr(type,1,1) == "m"){ + + # obtain priors + priors <- object[["model"]][["priors"]] + bias <- if(!is.null(priors[["bias"]])) !.is.prior_null(priors[["bias"]]) + + if(all(!bias)) + stop("'model summary' is available only for models with publication bias adjustment components") + + # determine prior type + weightfunctions <- sapply(priors[["bias"]], is.prior.weightfunction) + PET_PEESE <- sapply(priors[["bias"]], function(x) is.prior.PET(x) | is.prior.PEESE(x)) + no_bias <- !(weightfunctions | PET_PEESE) + + ### overall bias type summary + # a bit of an abuse of `runjags_inference_table` by overwriting the prior attributes + model <- object[["model"]] + attr(model[["fit"]], "prior_list")[names(attr(model[["fit"]], "prior_list")) != "bias"] <- NULL + attr(attr(model[["fit"]], "prior_list")[["bias"]], "components")[PET_PEESE] <- "PET-PEESE" + attr(attr(model[["fit"]], "prior_list")[["bias"]], "components")[weightfunctions] <- "Weight functions" + attr(attr(model[["fit"]], "prior_list")[["bias"]], "components")[no_bias] <- "None" + + summary <- BayesTools::runjags_inference_table(model[["fit"]], formula_prefix = FALSE) + attr(summary, "parameters") <- gsub("bias [", "", attr(summary, "parameters"), fixed = TRUE) + attr(summary, "parameters") <- gsub("]", "", attr(summary, "parameters"), fixed = TRUE) + rownames(summary) <- attr(summary, "parameters") + + ### specific bias type summary + # a bit of an abuse of `runjags_inference_table` by overwriting the prior attributes + model <- object[["model"]] + attr(model[["fit"]], "prior_list")[names(attr(model[["fit"]], "prior_list")) != "bias"] <- NULL + components_text <- sapply(priors[["bias"]], print, silent = TRUE) + components_text <- sub(" ~.*$", "", components_text) + components_text <- gsub("omega", "Weight function", components_text) + attr(attr(model[["fit"]], "prior_list")[["bias"]], "components") <- components_text + + components <- BayesTools::runjags_inference_table(model[["fit"]], formula_prefix = FALSE) + attr(components, "parameters") <- gsub("bias [", "", attr(components, "parameters"), fixed = TRUE) + attr(components, "parameters") <- substr(attr(components, "parameters"), 1, nchar(attr(components, "parameters")) - 1) + rownames(components) <- attr(components, "parameters") + + + summary <- BayesTools:::update.BayesTools_table( + summary, + title = "Publication bias adjustment summary:", + BF01 = BF01, + logBF = logBF + ) + + components <- BayesTools:::update.BayesTools_table( + components, + title = "Publication bias adjustment models summary:", + BF01 = BF01, + logBF = logBF + ) + + # create the output object + output <- list( + call = object[["call"]], + title = .object_title(object), + summary = summary, + components = components + ) + + class(output) <- "summary.RoBMA" + attr(output, "type") <- "models" + + return(output) + }else{ + stop(paste0("Unknown summary type: '", type, "'.")) } } @@ -609,8 +679,12 @@ print.summary.RoBMA <- function(x, ...){ }else if(attr(x, "type") == "models"){ - cat("\n") - print(x[["summary"]]) + for(type in c("summary", "components")){ + if(!is.null(x[[type]])){ + cat("\n") + print(x[[type]]) + } + } return(invisible()) @@ -651,7 +725,7 @@ print.summary.RoBMA <- function(x, ...){ #' #' @param x object to be tested #' -#' @details +#' @details #' These functions test whether an object inherits from specific RoBMA classes: #' \itemize{ #' \item \code{is.RoBMA}: Tests for \code{"RoBMA"} class (Robust Bayesian Meta-Analysis) @@ -670,7 +744,7 @@ print.summary.RoBMA <- function(x, ...){ #' fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n) #' is.RoBMA(fit) # TRUE #' is.BiBMA(fit) # FALSE -#' +#' #' # Example with regression #' fit_reg <- RoBMA.reg(r ~ 1, data = Anderson2010) #' is.RoBMA.reg(fit_reg) # TRUE diff --git a/R/utilities.R b/R/utilities.R index 2dfb4d1d..f8c23023 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -99,6 +99,7 @@ assign("check_scaling", TRUE, envir = Ro "3.5.0" = c("0.2.19", "999.999.999"), "3.5.1" = c("0.2.19", "999.999.999"), "3.6.0" = c("0.2.19", "999.999.999"), + "3.6.1" = c("0.2.19", "999.999.999"), stop("New RoBMA version needs to be defined in '.check_BayesTools' function!") ) diff --git a/R/zcurve.R b/R/zcurve.R index ca521904..9be2bc7a 100644 --- a/R/zcurve.R +++ b/R/zcurve.R @@ -166,7 +166,27 @@ summary.zcurve_RoBMA <- function(object, conditional = FALSE, probs = c(.025, .9 #' @param length.out.hist Number of bins for the histogram. If NULL, determined by by.hist. Defaults to NULL. #' @param by.lines Step size for plotting model fit and extrapolation lines. Defaults to 0.05. #' @param length.out.lines Number of points for plotting lines. If NULL, determined by by.lines. Defaults to NULL. -#' @param ... Additional arguments passed to the underlying plotting functions. +#' @param dots_hist List of additional graphical parameters for the histogram. +#' For base R: \code{border}, \code{col}, \code{density}, \code{angle}. +#' For ggplot2: \code{color}, \code{fill}, \code{alpha}. +#' @param dots_extrapolation List of additional graphical parameters for the extrapolation line/ribbon. +#' For base R lines: \code{lwd}, \code{col}, \code{lty}. +#' For base R ribbon: \code{col} (will be alpha-blended), \code{border}. +#' For ggplot2 lines: \code{linewidth}, \code{color}, \code{linetype}. +#' For ggplot2 ribbon: \code{fill}, \code{alpha}. +#' @param dots_thresholds List of additional graphical parameters for the threshold lines. +#' For base R: \code{col}, \code{lty}, \code{lwd}. +#' For ggplot2: \code{color}, \code{linetype}, \code{linewidth}. +#' @param ... Additional graphical arguments for the main fit line and ribbon (passed to lines.zcurve_RoBMA), +#' as well as basic plotting arguments. +#' For base R lines: \code{lwd}, \code{col}, \code{lty}. +#' For base R ribbon: \code{col} (will be alpha-blended), \code{border}. +#' For ggplot2 lines: \code{linewidth}, \code{color}, \code{linetype}. +#' For ggplot2 ribbon: \code{fill}, \code{alpha}. +#' Basic plotting arguments (both base R and ggplot2): \code{xlab} (x-axis label, default: "Z-Statistic"), +#' \code{ylab} (y-axis label, default: "Density"), \code{main} (plot title, default: ""), +#' \code{ylim} (y-axis limits). For base R only: \code{xaxt} (x-axis type, default: "s"), +#' \code{yaxt} (y-axis type, default: "s"). #' @inheritParams as_zcurve #' @inheritParams plot.RoBMA #' @inheritParams summary.RoBMA @@ -190,7 +210,8 @@ summary.zcurve_RoBMA <- function(object, conditional = FALSE, probs = c(.025, .9 plot.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", probs = c(.025, .975), max_samples = 500, plot_fit = TRUE, plot_extrapolation = TRUE, plot_CI = TRUE, plot_thresholds = TRUE, - from = -6, to = 6, by.hist = 0.5, length.out.hist = NULL, by.lines = 0.05, length.out.lines = NULL, ...){ + from = -6, to = 6, by.hist = 0.5, length.out.hist = NULL, by.lines = 0.05, length.out.lines = NULL, + dots_hist = NULL, dots_extrapolation = NULL, dots_thresholds = NULL, ...){ # plots the z-curve object # most functions are based on the zcurve package @@ -208,38 +229,58 @@ plot.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", BayesTools::check_bool(plot_thresholds, "plot_thresholds") BayesTools::check_real(probs, "probs", lower = 0, upper = 1, check_length = 2) + # extract dots for main fit line + dots <- list(...) + # construct the plot # get the line values first so we can set-up ylim of the histogram ymax <- 0 if(plot_fit){ - lines_fit <- lines.zcurve_RoBMA(x, conditional = conditional, plot_type = plot_type, - probs = probs, max_samples = max_samples, - extrapolate = FALSE, plot_CI = plot_CI, - from = from, to = to, by = by.lines, length.out = length.out.lines, as_data = TRUE) + lines_fit <- do.call(lines.zcurve_RoBMA, c( + list(x = x, conditional = conditional, plot_type = plot_type, + probs = probs, max_samples = max_samples, + extrapolate = FALSE, plot_CI = plot_CI, + from = from, to = to, by = by.lines, length.out = length.out.lines, + as_data = TRUE), + dots + )) ymax <- max(c(ymax, lines_fit$y, if(plot_CI) lines_fit$y_uCI)) } if(plot_extrapolation){ - lines_extrapolation <- lines.zcurve_RoBMA(x, conditional = conditional, plot_type = plot_type, - probs = probs, max_samples = max_samples, - extrapolate = TRUE, plot_CI = plot_CI, - from = from, to = to, by = by.lines, length.out = length.out.lines, as_data = TRUE) + # prepare extrapolation dots with default blue color + dots_extrapolation <- if(!is.null(dots_extrapolation)) dots_extrapolation else list() + lines_extrapolation <- do.call(lines.zcurve_RoBMA, c( + list(x = x, conditional = conditional, plot_type = plot_type, + probs = probs, max_samples = max_samples, + extrapolate = TRUE, plot_CI = plot_CI, + from = from, to = to, by = by.lines, length.out = length.out.lines, + as_data = TRUE), + dots_extrapolation + )) ymax <- max(c(ymax, lines_extrapolation$y, if(plot_CI) lines_extrapolation$y_uCI)) } - plot <- hist.zcurve_RoBMA(x, plot_type = plot_type, from = from, to = to, by = by.hist, length.out = length.out.hist, - ylim = if(ymax != 0) c(0, ymax) else NULL, plot_thresholds = plot_thresholds) + plot <- hist.zcurve_RoBMA( + x = x, plot_type = plot_type, from = from, to = to, by = by.hist, length.out = length.out.hist, + plot_thresholds = plot_thresholds, dots_thresholds = dots_thresholds, + ylim = if(ymax != 0) c(0, ymax) else NULL, + dots_hist = dots_hist, dots_all = dots + ) # add plot lines if(plot_fit){ + dots_fit_lines <- .get_dots_lines_zcurve(dots, plot_type = plot_type) + if(plot_type == "base"){ if(plot_CI){ graphics::polygon( c(lines_fit$x, rev(lines_fit$x)), c(lines_fit$y_lCI, rev(lines_fit$y_uCI)), - border = NA, col = scales::alpha("black", 0.40)) + border = NA, + col = scales::alpha(dots_fit_lines$col, dots_fit_lines$alpha)) } - graphics::lines(lines_fit$x, lines_fit$y, lwd = 2, col = "black", lty = 1) + graphics::lines(lines_fit$x, lines_fit$y, lwd = dots_fit_lines$lwd, col = dots_fit_lines$col, lty = dots_fit_lines$lty) }else if(plot_type == "ggplot"){ if(plot_CI){ plot <- plot + ggplot2::geom_ribbon( @@ -247,30 +288,35 @@ plot.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", x = lines_fit$x, ymin = lines_fit$y_lCI, ymax = lines_fit$y_uCI), - fill = scales::alpha("black", 0.40) + fill = dots_fit_lines$color, + alpha = dots_fit_lines$alpha ) } plot <- plot + ggplot2::geom_line( ggplot2::aes( x = lines_fit$x, y = lines_fit$y), - color = "black", - linewidth = 1, - linetype = 1 + color = dots_fit_lines$color, + linewidth = dots_fit_lines$linewidth, + linetype = dots_fit_lines$linetype ) } } # add extrapolation lines if(plot_extrapolation){ + dots_extrapolation <- if(!is.null(dots_extrapolation)) dots_extrapolation else list() + dots_extrapolation_lines <- .get_dots_lines_zcurve(dots_extrapolation, plot_type = plot_type, col = "blue", alpha = 0.40) + if(plot_type == "base"){ if(plot_CI){ graphics::polygon( c(lines_extrapolation$x, rev(lines_extrapolation$x)), c(lines_extrapolation$y_lCI, rev(lines_extrapolation$y_uCI)), - border = NA, col = scales::alpha("blue", 0.40)) + border = NA, + col = scales::alpha(dots_extrapolation_lines$col, dots_extrapolation_lines$alpha)) } - graphics::lines(lines_extrapolation$x, lines_extrapolation$y, lwd = 2, col = "blue", lty = 1) + graphics::lines(lines_extrapolation$x, lines_extrapolation$y, lwd = dots_extrapolation_lines$lwd, col = dots_extrapolation_lines$col, lty = dots_extrapolation_lines$lty) }else if(plot_type == "ggplot"){ if(plot_CI){ plot <- plot + ggplot2::geom_ribbon( @@ -278,16 +324,17 @@ plot.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", x = lines_extrapolation$x, ymin = lines_extrapolation$y_lCI, ymax = lines_extrapolation$y_uCI), - fill = scales::alpha("blue", 0.40) + fill = dots_extrapolation_lines$color, + alpha = dots_extrapolation_lines$alpha ) } plot <- plot + ggplot2::geom_line( ggplot2::aes( x = lines_extrapolation$x, y = lines_extrapolation$y), - color = "blue", - linewidth = 1, - linetype = 1 + color = dots_extrapolation_lines$color, + linewidth = dots_extrapolation_lines$linewidth, + linetype = dots_extrapolation_lines$linetype ) } } @@ -308,8 +355,18 @@ plot.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", #' @param x A \code{zcurve_RoBMA} object containing the fitted model. #' @param by Numeric value specifying the bin width for the histogram. Defaults to 0.5. #' @param length.out Optional integer specifying the number of bins. If NULL, determined by \code{by}. Defaults to NULL. +#' @param add Logical; if TRUE, adds histogram bars to an existing plot without creating a new canvas. Only applies to base R graphics. Defaults to FALSE. #' @param plot_thresholds Logical; should significance thresholds be displayed on the plot? Defaults to TRUE. -#' @param ... Additional arguments passed to the underlying plotting functions. +#' @param dots_thresholds List of additional graphical parameters for the threshold lines. +#' For base R: \code{col}, \code{lty}, \code{lwd}. +#' For ggplot2: \code{color}, \code{linetype}, \code{linewidth}. +#' @param ... Additional graphical parameters for the histogram and basic plotting arguments. +#' For base R histogram: \code{border}, \code{col}, \code{density}, \code{angle}. +#' For ggplot2 histogram: \code{color}, \code{fill}, \code{alpha}. +#' Basic plotting arguments (both base R and ggplot2): \code{xlab} (x-axis label, default: "Z-Statistic"), +#' \code{ylab} (y-axis label, default: "Density"), \code{main} (plot title, default: ""), +#' \code{ylim} (y-axis limits). For base R only: \code{xaxt} (x-axis type, default: "s"), +#' \code{yaxt} (y-axis type, default: "s"). #' @inheritParams as_zcurve #' @inheritParams plot.RoBMA #' @inheritParams summary.RoBMA @@ -321,7 +378,7 @@ plot.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", #' @seealso [as_zcurve()], [plot.zcurve_RoBMA()], [hist.zcurve_RoBMA()] #' #' @export -hist.zcurve_RoBMA <- function(x, plot_type = "base", from = -6, to = 6, by = 0.5, length.out = NULL, plot_thresholds = TRUE, ...){ +hist.zcurve_RoBMA <- function(x, plot_type = "base", from = -6, to = 6, by = 0.5, length.out = NULL, add = FALSE, plot_thresholds = TRUE, dots_thresholds = NULL, ...){ # most functions are based on the zcurve package BayesTools::check_char(plot_type, "plot_type", allow_values = c("base", "ggplot")) @@ -329,10 +386,22 @@ hist.zcurve_RoBMA <- function(x, plot_type = "base", from = -6, to = 6, by = 0. BayesTools::check_real(to, "to", allow_NULL = TRUE) BayesTools::check_real(by, "by", allow_NULL = TRUE) BayesTools::check_real(length.out, "length.out", allow_NULL = TRUE) + BayesTools::check_bool(add, "add") BayesTools::check_bool(plot_thresholds, "plot_thresholds") # extract the data dots <- list(...) + + # extract special parameters if provided (from plot.zcurve_RoBMA) + dots_hist <- dots[["dots_hist"]] + dots_all <- dots[["dots_all"]] + dots[["dots_hist"]] <- NULL + dots[["dots_all"]] <- NULL + + # merge dots_all if provided (from plot.zcurve_RoBMA) + if(!is.null(dots_all)){ + dots <- c(dots, dots_all[!names(dots_all) %in% names(dots)]) + } z <- x$zcurve$data[["z"]] # specify plotting range @@ -362,41 +431,49 @@ hist.zcurve_RoBMA <- function(x, plot_type = "base", from = -6, to = 6, by = 0. return(df_hist) } - # create the plot otherwise - if(!is.null(dots[["ylim"]])){ - ylim <- range(dots[["ylim"]], max(z_hist$density)) - }else{ - ylim <- c(0, max(z_hist$density)) - } - if(!is.null(dots[["xlab"]])){ - xlab <- dots[["xlab"]] - }else{ - xlab <- "Z-Statistic" + # get histogram-specific graphical parameters + # merge dots_hist into dots (dots_hist takes precedence) + if(!is.null(dots_hist)){ + dots <- c(dots_hist, dots[!names(dots) %in% names(dots_hist)]) } + dots_hist <- .get_dots_hist_zcurve(dots, plot_type = plot_type, max_density = max(z_hist$density)) + # create the plot otherwise if(plot_type == "ggplot"){ out <- ggplot2::ggplot() + ggplot2::geom_col( ggplot2::aes( x = df_hist$x, y = df_hist$density), - fill = NA, - color = "black", + fill = dots_hist$fill, + color = dots_hist$color, + alpha = dots_hist$alpha, width = df_hist$breaks ) + - ggplot2::labs(x = xlab, y = "Density") + ggplot2::labs(x = dots_hist$xlab, y = dots_hist$ylab) + + ggplot2::ggtitle(dots_hist$main) } else { - graphics::plot(z_hist, freq = FALSE, las = 1, density = 0, angle = 0, - border = "black", xlab = xlab, main = "", ylim = ylim) + if(add){ + graphics::rect(xleft = df_hist$x - df_hist$breaks/2, xright = df_hist$x + df_hist$breaks/2, + ybottom = 0, ytop = df_hist$density, + border = dots_hist$border, col = dots_hist$col) + }else{ + graphics::plot(z_hist, freq = FALSE, las = 1, border = dots_hist$border, col = dots_hist$col, + xlab = dots_hist$xlab, ylab = dots_hist$ylab, main = dots_hist$main, + ylim = dots_hist$ylim, xaxt = dots_hist$xaxt, yaxt = dots_hist$yaxt) + } } if(plot_thresholds){ tresholds <- .zcurve_threshold(x[["priors"]]) if(length(tresholds) > 0){ + dots_thresholds <- if(!is.null(dots_thresholds)) dots_thresholds else list() + dots_thresholds <- .get_dots_thresholds_zcurve(dots_thresholds, plot_type = plot_type) + if(plot_type == "base"){ - graphics::abline(v = tresholds, col = "red", lty = 3) + graphics::abline(v = tresholds, col = dots_thresholds$col, lty = dots_thresholds$lty, lwd = dots_thresholds$lwd) }else if(plot_type == "ggplot"){ - out <- out + ggplot2::geom_vline(xintercept = tresholds, color = "red", linetype = "dashed") + out <- out + ggplot2::geom_vline(xintercept = tresholds, color = dots_thresholds$color, linetype = dots_thresholds$linetype, linewidth = dots_thresholds$linewidth) } } } @@ -418,6 +495,11 @@ hist.zcurve_RoBMA <- function(x, plot_type = "base", from = -6, to = 6, by = 0. #' @param by Numeric value specifying the increment for the sequence. #' @param length.out Optional integer specifying the desired length of the output sequence. #' @param col Color of the plotted line. +#' @param ... Additional graphical parameters for the line and CI ribbon. +#' For base R lines: \code{lwd}, \code{col}, \code{lty}. +#' For base R ribbon: \code{alpha} (alpha transparency for the ribbon). +#' For ggplot2 lines: \code{linewidth}, \code{color}, \code{linetype}. +#' For ggplot2 ribbon: \code{alpha}. #' @inheritParams as_zcurve #' @inheritParams plot.RoBMA #' @inheritParams summary.RoBMA @@ -466,22 +548,8 @@ lines.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", return(df_density) } - # create the plot otherwise - if(!is.null(dots[["lwd"]])){ - lwd <- dots[["lwd"]] - }else{ - lwd <- 1 - } - if(!is.null(dots[["lty"]])){ - lty <- dots[["lty"]] - }else{ - lty <- 1 - } - if(!is.null(dots[["alpha"]])){ - alpha <- dots[["alpha"]] - }else{ - alpha <- 0.4 - } + # get line-specific graphical parameters + dots_lines <- .get_dots_lines_zcurve(dots, plot_type = plot_type, col = col) if(plot_type == "ggplot"){ out <- list() @@ -491,25 +559,27 @@ lines.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", x = df_density$x, ymin = df_density$y_lCI, ymax = df_density$y_uCI), - fill = scales::alpha(col, alpha) + fill = dots_lines$color, + alpha = dots_lines$alpha ) } out[[length(out) + 1]] <- ggplot2::geom_line( ggplot2::aes( x = df_density$x, y = df_density$y), - color = col, - linewidth = lwd, - linetype = lty + color = dots_lines$color, + linewidth = dots_lines$linewidth, + linetype = dots_lines$linetype ) }else{ if(plot_CI){ graphics::polygon( c(df_density$x, rev(df_density$x)), c(df_density$y_lCI, rev(df_density$y_uCI)), - border = NA, col = scales::alpha(col, alpha)) + border = NA, + col = scales::alpha(dots_lines$col, dots_lines$alpha)) } - graphics::lines(df_density$x, df_density$y, lwd = lwd, col = col, lty = lty) + graphics::lines(df_density$x, df_density$y, lwd = dots_lines$lwd, col = dots_lines$col, lty = dots_lines$lty) } # return the plots @@ -522,6 +592,94 @@ lines.zcurve_RoBMA <- function(x, conditional = FALSE, plot_type = "base", +.get_dots_hist_zcurve <- function(dots, plot_type = "base", max_density = NULL){ + # extract histogram-specific plotting arguments with defaults + # (dots should already contain merged dots_hist if applicable) + + if(plot_type == "base"){ + # compute default ylim + if(!is.null(dots[["ylim"]]) && !is.null(max_density)){ + ylim <- range(dots[["ylim"]], max_density) + }else if(!is.null(max_density)){ + ylim <- c(0, max_density) + }else{ + ylim <- NULL + } + + # base R histogram arguments + hist_dots <- list( + border = if(!is.null(dots[["border"]])) dots[["border"]] else "gray60", + col = if(!is.null(dots[["col"]])) dots[["col"]] else NA, + xlab = if(!is.null(dots[["xlab"]])) dots[["xlab"]] else "Z-Statistic", + ylab = if(!is.null(dots[["ylab"]])) dots[["ylab"]] else "Density", + main = if(!is.null(dots[["main"]])) dots[["main"]] else "", + ylim = ylim, + xaxt = if(!is.null(dots[["xaxt"]])) dots[["xaxt"]] else "s", + yaxt = if(!is.null(dots[["yaxt"]])) dots[["yaxt"]] else "s" + ) + }else if(plot_type == "ggplot"){ + # ggplot2 geom_col arguments + hist_dots <- list( + color = if(!is.null(dots[["color"]])) dots[["color"]] else if(!is.null(dots[["col"]])) dots[["col"]] else "gray60", + fill = if(!is.null(dots[["fill"]])) dots[["fill"]] else NA, + alpha = if(!is.null(dots[["alpha"]])) dots[["alpha"]] else 1, + xlab = if(!is.null(dots[["xlab"]])) dots[["xlab"]] else "Z-Statistic", + ylab = if(!is.null(dots[["ylab"]])) dots[["ylab"]] else "Density", + main = if(!is.null(dots[["main"]])) dots[["main"]] else "" + ) + } + + return(hist_dots) +} + +.get_dots_lines_zcurve <- function(dots, plot_type = "base", col = "black", alpha = 0.40){ + # extract line-specific plotting arguments with defaults + + if(plot_type == "base"){ + # base R line arguments + line_dots <- list( + lwd = if(!is.null(dots[["lwd"]])) dots[["lwd"]] else 2, + col = if(!is.null(dots[["col"]])) dots[["col"]] else col, + lty = if(!is.null(dots[["lty"]])) dots[["lty"]] else 1, + alpha = if(!is.null(dots[["alpha"]])) dots[["alpha"]] else alpha + ) + }else if(plot_type == "ggplot"){ + # ggplot2 geom_line arguments + line_dots <- list( + linewidth = if(!is.null(dots[["linewidth"]])) dots[["linewidth"]] else if(!is.null(dots[["lwd"]])) dots[["lwd"]] else 1, + color = if(!is.null(dots[["color"]])) dots[["color"]] else if(!is.null(dots[["col"]])) dots[["col"]] else col, + linetype = if(!is.null(dots[["linetype"]])) dots[["linetype"]] else if(!is.null(dots[["lty"]])) dots[["lty"]] else 1, + alpha = if(!is.null(dots[["alpha"]])) dots[["alpha"]] else alpha + ) + } + + return(line_dots) +} + +.get_dots_thresholds_zcurve <- function(dots, plot_type = "base"){ + # extract threshold line-specific plotting arguments with defaults + + if(plot_type == "base"){ + # base R line arguments for abline + threshold_dots <- list( + col = if(!is.null(dots[["col"]])) dots[["col"]] else "red", + lty = if(!is.null(dots[["lty"]])) dots[["lty"]] else 3, + lwd = if(!is.null(dots[["lwd"]])) dots[["lwd"]] else 1 + ) + }else if(plot_type == "ggplot"){ + # ggplot2 geom_vline arguments + threshold_dots <- list( + color = if(!is.null(dots[["color"]])) dots[["color"]] else if(!is.null(dots[["col"]])) dots[["col"]] else "red", + linetype = if(!is.null(dots[["linetype"]])) dots[["linetype"]] else if(!is.null(dots[["lty"]])) dots[["lty"]] else "dashed", + linewidth = if(!is.null(dots[["linewidth"]])) dots[["linewidth"]] else if(!is.null(dots[["lwd"]])) dots[["lwd"]] else 0.5 + ) + } + + return(threshold_dots) +} + + + .zcurve_bins <- function(priors, from, to, by, length.out, type = "hist"){ if(is.null(length.out)){ diff --git a/README.Rmd b/README.Rmd index 5cb09cfc..b8aaf455 100644 --- a/README.Rmd +++ b/README.Rmd @@ -33,7 +33,12 @@ fit <- readRDS(file = "models/README/Bem2011.RDS") # Robust Bayesian Meta-Analysis (RoBMA) -This package estimates an ensemble of meta-analytic models (assuming either the presence or absence of effect, heterogeneity, and publication bias) and uses Bayesian model averaging to combine them. The ensemble uses Bayes factors to test for the presence of absence of the individual components (e.g., effect vs. no effect) and model-averages parameter estimates based on posterior model probabilities. The package includes more complex models such as meta-regression and multilevel meta-analysis. The user can define a wide range prior distributions for the effect size, heterogeneity, publication bias components (including selection, PET, and PEESE style models), and moderators. The package provides convenient functions for summary, visualizations, and fit diagnostics. The package is designed to be user-friendly and provides a wide range of customization options. The package is also integrated into the JASP software [@jasp14] and can be used via the graphical user interface. +This package estimates an ensemble of meta-analytic models (assuming either the presence or absence of effect, heterogeneity, and publication bias) and uses Bayesian model averaging to combine them. +The ensemble uses Bayes factors to test for the presence of absence of the individual components (e.g., effect vs. no effect) and model-averages parameter estimates based on posterior model probabilities. +The package includes more complex models such as meta-regression and multilevel meta-analysis. +The user can define a wide range prior distributions for the effect size, heterogeneity, publication bias components (including selection, PET, and PEESE style models), and moderators. +The package provides convenient functions for summary, visualizations, and fit diagnostics. The package is designed to be user-friendly and provides a wide range of customization options. +The package is also integrated into the JASP software [@jasp14] and can be used via the graphical user interface (see @bartos2025bayesian). See our manuscripts for technical details and examples: @@ -46,11 +51,13 @@ See our manuscripts for technical details and examples: - @bartos2020adjusting (https://doi.org/10.1177/25152459221109259) provides an accessible tutorial on the method including the implementation in the the user-friendly graphical user interface of JASP [@jasp14] -We also prepared multiple vignettes that illustrate functionality of the package: +We also prepared multiple vignettes that illustrate functionality of the package. See the [Guide to RoBMA Vignettes](https://fbartos.github.io/RoBMA/articles/Explanation.html) for an overview or explore them directly: - [Tutorial: Adjusting for publication bias in JASP and R - Selection models, PET-PEESE, and Robust Bayesian meta-analysis](https://fbartos.github.io/RoBMA/articles/Tutorial.html) - [Reproducing Bayesian model-averaged meta-analysis (BMA)](https://fbartos.github.io/RoBMA/articles/ReproducingBMA.html) - [Robust Bayesian model-averaged meta-regression](https://fbartos.github.io/RoBMA/articles/MetaRegression.html) + - [Multilevel Robust Bayesian Meta-Analysis](https://fbartos.github.io/RoBMA/articles/MultilevelRoBMA.html) + - [Multilevel Robust Bayesian Model-Averaged Meta-Regression](https://fbartos.github.io/RoBMA/articles/MultilevelRoBMARegression.html) - [Hierarchical Bayesian model-averaged meta-analysis](https://fbartos.github.io/RoBMA/articles/HierarchicalBMA.html) - [Informed Bayesian model-averaged meta-analysis in medicine](https://fbartos.github.io/RoBMA/articles/MedicineBMA.html) - [Informed Bayesian model-averaged meta-analysis with binary outcomes](https://fbartos.github.io/RoBMA/articles/MedicineBiBMA.html) diff --git a/README.md b/README.md index 630efff5..497a84d7 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ provides convenient functions for summary, visualizations, and fit diagnostics. The package is designed to be user-friendly and provides a wide range of customization options. The package is also integrated into the JASP software (JASP Team, 2020) and can be used via the graphical -user interface. +user interface (see Bartoš & Wagenmakers (2025)). See our manuscripts for technical details and examples: @@ -58,7 +58,9 @@ See our manuscripts for technical details and examples: JASP (JASP Team, 2020) We also prepared multiple vignettes that illustrate functionality of the -package: +package. See the [Guide to RoBMA +Vignettes](https://fbartos.github.io/RoBMA/articles/Explanation.html) +for an overview or explore them directly: - [Tutorial: Adjusting for publication bias in JASP and R - Selection models, PET-PEESE, and Robust Bayesian @@ -67,6 +69,10 @@ package: (BMA)](https://fbartos.github.io/RoBMA/articles/ReproducingBMA.html) - [Robust Bayesian model-averaged meta-regression](https://fbartos.github.io/RoBMA/articles/MetaRegression.html) +- [Multilevel Robust Bayesian + Meta-Analysis](https://fbartos.github.io/RoBMA/articles/MultilevelRoBMA.html) +- [Multilevel Robust Bayesian Model-Averaged + Meta-Regression](https://fbartos.github.io/RoBMA/articles/MultilevelRoBMARegression.html) - [Hierarchical Bayesian model-averaged meta-analysis](https://fbartos.github.io/RoBMA/articles/HierarchicalBMA.html) - [Informed Bayesian model-averaged meta-analysis in @@ -393,8 +399,8 @@ medicine. *Statistics in Medicine*, *40*(30), 6743–6761.
-Bartoš, F., Maier, Maximilian, Quintana, D. S., & Wagenmakers, E.-J. -(2022). Adjusting for publication bias in JASP and R — Selection models, +Bartoš, F., Maier, M., Quintana, D. S., & Wagenmakers, E.-J. (2022). +Adjusting for publication bias in JASP and R — Selection models, PET-PEESE, and robust Bayesian meta-analysis. *Advances in Methods and Practices in Psychological Science*, *5*(3), 1–19. @@ -444,6 +450,13 @@ for publication bias in meta-analysis. In *arXiv*.
+
+ +Bartoš, F., & Wagenmakers, E.-J. (2025). *Meta-analysis with JASP, Part +II: Bayesian approaches*. + +
+
Bem, D. J. (2011). Feeling the future: Experimental evidence for diff --git a/data/Havrankova2025.RData b/data/Havrankova2025.RData new file mode 100644 index 00000000..753ee2e5 Binary files /dev/null and b/data/Havrankova2025.RData differ diff --git a/data/Johnides2025.RData b/data/Johnides2025.RData new file mode 100644 index 00000000..06d31c21 Binary files /dev/null and b/data/Johnides2025.RData differ diff --git a/inst/REFERENCES.bib b/inst/REFERENCES.bib index 3ed759e3..1994f2f6 100644 --- a/inst/REFERENCES.bib +++ b/inst/REFERENCES.bib @@ -70,7 +70,7 @@ @article{bartos2021no @article{bartos2020adjusting, title = {Adjusting for publication bias in {JASP} and {R} --- {S}election models, {PET-PEESE}, and robust {B}ayesian meta-analysis}, - author = {Barto{\v{s}}, Franti{\v{s}}ek and Maier, Maximilian, and Quintana, D.S., and Wagenmakers, Eric-Jan}, + author = {Barto{\v{s}}, Franti{\v{s}}ek and Maier, Maximilian and Quintana, D.S. and Wagenmakers, Eric-Jan}, year = {2022}, journal = {Advances in Methods and Practices in Psychological Science}, doi = {10.1177/25152459221109259}, @@ -285,7 +285,7 @@ @article{wrinch1921on @article{maier2022nudge, title = {No evidence for nudging after adjusting for publication bias}, - author = {Maier, Maximilian and Barto{\v{s}}, Franti{\v{s}}ek and Stanley, TD and Shanks, David R., and Harris J.L., Adam and Wagenmakers, Eric-Jan}, + author = {Maier, Maximilian and Barto{\v{s}}, Franti{\v{s}}ek and Stanley, TD and Shanks, David R. and Harris J.L., Adam and Wagenmakers, Eric-Jan}, year={2022}, journal = {Proceedings of the National Academy of Sciences}, volume = {119}, @@ -575,3 +575,48 @@ @article{weingarten2018does year = {2018}, doi = {10.1037/bul0000122} } + +@article{johnides2025secondary, + title = {Secondary benefits of family member participation in treatments for childhood disorders: {A} multilevel meta-analytic review}, + author = {Johnides, Benjamin D and Borduin, Charles M and Sheerin, Kaitlin M and Kuppens, Sofie}, + journal = {Psychological Bulletin}, + volume = {151}, + number = {1}, + pages = {1--32}, + year = {2025}, + doi = {10.1037/bul0000462} +} + +@unpublished{havrankova2025beauty, + title = {Meta-analysis of field studies on beauty and professional success}, + author = {Havr{\'a}nkov{\'a}, Zuzana and Havr{\'a}nek, Tom{\'a}{\v{s}} and Bortnikova, Kseniya and Barto{\v{s}}, Franti{\v{s}}ek}, + year = {2025}, + note = {Preprint available at https://meta-analysis.cz/beauty/beauty.pdf}, +} + +@article{rover2021weakly, + title = {On weakly informative prior distributions for the heterogeneity parameter in {B}ayesian random-effects meta-analysis}, + author = {R{\"o}ver, Christian and Bender, Ralf and Dias, Sofia and Schmid, Christopher H and Schmidli, Heinz and Sturtz, Sibylle and Weber, Sebastian and Friede, Tim}, + journal = {Research Synthesis Methods}, + volume = {12}, + number = {4}, + pages = {448--474}, + year = {2021}, + doi = {10.1002/jrsm.1475} +} + +@article{mulder2024bayesian, + title = {Bayes {F}actor hypothesis testing in meta-analyses: {P}ractical advantages and methodological considerations}, + author = {Mulder, Joris and van Aert, Robbie CM}, + year = {2025}, + journal = {Research Synthesis Methods}, + doi = {10.1017/rsm.2025.10060} +} + +@unpublished{bartos2025bayesian, + title = {Meta-analysis with {JASP}, {P}art {II}: {B}ayesian approaches}, + author = {Barto{\v{s}}, Franti{\v{s}}ek and Wagenmakers, Eric-Jan}, + year = {2025}, + note = {Preprint available at https://doi.org/10.48550/arXiv.2509.09850}, + doi = {10.48550/arXiv.2509.09850} +} diff --git a/man/Havrankova2025.Rd b/man/Havrankova2025.Rd new file mode 100644 index 00000000..06e9b704 --- /dev/null +++ b/man/Havrankova2025.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/datasets.R +\docType{data} +\name{Havrankova2025} +\alias{Havrankova2025} +\title{1159 effect sizes from a meta-analysis of beauty and professional success +by \insertCite{havrankova2025beauty;textual}{RoBMA}} +\format{ +A data.frame with 5 columns and 1159 observations. +} +\usage{ +Havrankova2025 +} +\value{ +a data.frame. +} +\description{ +The data set contains effect sizes (percent increase in earnings), standard errors, +study identifiers, sample sizes, and the type of customer contact (no, some, or direct). +The meta-analysis examined the relationship between perceived beauty and professional success +\insertCite{havrankova2025beauty}{RoBMA}. +} +\references{ +\insertAllCited{} +} +\keyword{datasets} diff --git a/man/Johnides2025.Rd b/man/Johnides2025.Rd new file mode 100644 index 00000000..08c5a130 --- /dev/null +++ b/man/Johnides2025.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/datasets.R +\docType{data} +\name{Johnides2025} +\alias{Johnides2025} +\title{412 effect sizes from a meta-analysis of secondary benefits of family-based treatments +by \insertCite{johnides2025secondary;textual}{RoBMA}} +\format{ +A data.frame with 3 columns and 412 observations. +} +\usage{ +Johnides2025 +} +\value{ +a data.frame. +} +\description{ +The data set contains Cohen's d effect sizes, standard errors, and study labels +from a meta-analysis investigating the extent to which family-based treatments for children +with mental health, physical health, and developmental disorders provide secondary benefits +to the children's siblings and caregivers \insertCite{johnides2025secondary}{RoBMA}. +} +\references{ +\insertAllCited{} +} +\keyword{datasets} diff --git a/man/figures/README-fig_PETPEESE-1.png b/man/figures/README-fig_PETPEESE-1.png index c1912102..fc8ab9a1 100644 Binary files a/man/figures/README-fig_PETPEESE-1.png and b/man/figures/README-fig_PETPEESE-1.png differ diff --git a/man/figures/README-fig_mu_chain-1.png b/man/figures/README-fig_mu_chain-1.png index bf0d63a7..96211235 100644 Binary files a/man/figures/README-fig_mu_chain-1.png and b/man/figures/README-fig_mu_chain-1.png differ diff --git a/man/hist.zcurve_RoBMA.Rd b/man/hist.zcurve_RoBMA.Rd index b4921ff3..d44cc34b 100644 --- a/man/hist.zcurve_RoBMA.Rd +++ b/man/hist.zcurve_RoBMA.Rd @@ -11,7 +11,9 @@ to = 6, by = 0.5, length.out = NULL, + add = FALSE, plot_thresholds = TRUE, + dots_thresholds = NULL, ... ) } @@ -30,9 +32,21 @@ or ggplot2 \code{"ggplot"} for plotting. Defaults to \item{length.out}{Optional integer specifying the number of bins. If NULL, determined by \code{by}. Defaults to NULL.} +\item{add}{Logical; if TRUE, adds histogram bars to an existing plot without creating a new canvas. Only applies to base R graphics. Defaults to FALSE.} + \item{plot_thresholds}{Logical; should significance thresholds be displayed on the plot? Defaults to TRUE.} -\item{...}{Additional arguments passed to the underlying plotting functions.} +\item{dots_thresholds}{List of additional graphical parameters for the threshold lines. +For base R: \code{col}, \code{lty}, \code{lwd}. +For ggplot2: \code{color}, \code{linetype}, \code{linewidth}.} + +\item{...}{Additional graphical parameters for the histogram and basic plotting arguments. +For base R histogram: \code{border}, \code{col}, \code{density}, \code{angle}. +For ggplot2 histogram: \code{color}, \code{fill}, \code{alpha}. +Basic plotting arguments (both base R and ggplot2): \code{xlab} (x-axis label, default: "Z-Statistic"), +\code{ylab} (y-axis label, default: "Density"), \code{main} (plot title, default: ""), +\code{ylim} (y-axis limits). For base R only: \code{xaxt} (x-axis type, default: "s"), +\code{yaxt} (y-axis type, default: "s").} } \value{ Returns \code{NULL} if \code{plot_type = "base"}, or a \code{ggplot2} object if \code{plot_type = "ggplot2"}. diff --git a/man/lines.zcurve_RoBMA.Rd b/man/lines.zcurve_RoBMA.Rd index 1aba0f71..0cb825ce 100644 --- a/man/lines.zcurve_RoBMA.Rd +++ b/man/lines.zcurve_RoBMA.Rd @@ -53,13 +53,11 @@ that will be used for estimating z-curve estimates.} \item{col}{Color of the plotted line.} -\item{...}{list of additional graphical arguments -to be passed to the plotting function. Supported arguments -are \code{lwd}, \code{lty}, \code{col}, \code{col.fill}, -\code{xlab}, \code{ylab}, \code{main}, \code{xlim}, \code{ylim} -to adjust the line thickness, line type, line color, fill color, -x-label, y-label, title, x-axis range, and y-axis range -respectively.} +\item{...}{Additional graphical parameters for the line and CI ribbon. +For base R lines: \code{lwd}, \code{col}, \code{lty}. +For base R ribbon: \code{alpha} (alpha transparency for the ribbon). +For ggplot2 lines: \code{linewidth}, \code{color}, \code{linetype}. +For ggplot2 ribbon: \code{alpha}.} } \description{ Adds lines to a plot of a fitted zcurve_RoBMA object. This function is typically used to overlay additional information or model fits on an existing plot. diff --git a/man/plot.zcurve_RoBMA.Rd b/man/plot.zcurve_RoBMA.Rd index d185532a..b7663ed3 100644 --- a/man/plot.zcurve_RoBMA.Rd +++ b/man/plot.zcurve_RoBMA.Rd @@ -20,6 +20,9 @@ length.out.hist = NULL, by.lines = 0.05, length.out.lines = NULL, + dots_hist = NULL, + dots_extrapolation = NULL, + dots_thresholds = NULL, ... ) } @@ -61,7 +64,30 @@ Defaults to \code{c(.025, .975)}} \item{length.out.lines}{Number of points for plotting lines. If NULL, determined by by.lines. Defaults to NULL.} -\item{...}{Additional arguments passed to the underlying plotting functions.} +\item{dots_hist}{List of additional graphical parameters for the histogram. +For base R: \code{border}, \code{col}, \code{density}, \code{angle}. +For ggplot2: \code{color}, \code{fill}, \code{alpha}.} + +\item{dots_extrapolation}{List of additional graphical parameters for the extrapolation line/ribbon. +For base R lines: \code{lwd}, \code{col}, \code{lty}. +For base R ribbon: \code{col} (will be alpha-blended), \code{border}. +For ggplot2 lines: \code{linewidth}, \code{color}, \code{linetype}. +For ggplot2 ribbon: \code{fill}, \code{alpha}.} + +\item{dots_thresholds}{List of additional graphical parameters for the threshold lines. +For base R: \code{col}, \code{lty}, \code{lwd}. +For ggplot2: \code{color}, \code{linetype}, \code{linewidth}.} + +\item{...}{Additional graphical arguments for the main fit line and ribbon (passed to lines.zcurve_RoBMA), +as well as basic plotting arguments. +For base R lines: \code{lwd}, \code{col}, \code{lty}. +For base R ribbon: \code{col} (will be alpha-blended), \code{border}. +For ggplot2 lines: \code{linewidth}, \code{color}, \code{linetype}. +For ggplot2 ribbon: \code{fill}, \code{alpha}. +Basic plotting arguments (both base R and ggplot2): \code{xlab} (x-axis label, default: "Z-Statistic"), +\code{ylab} (y-axis label, default: "Density"), \code{main} (plot title, default: ""), +\code{ylim} (y-axis limits). For base R only: \code{xaxt} (x-axis type, default: "s"), +\code{yaxt} (y-axis type, default: "s").} } \value{ Returns \code{NULL} if \code{plot_type = "base"}, or a \code{ggplot2} object if \code{plot_type = "ggplot2"}. diff --git a/models/MultilevelRoBMA/fit_Johnides2025.RDS b/models/MultilevelRoBMA/fit_Johnides2025.RDS new file mode 100644 index 00000000..38496271 Binary files /dev/null and b/models/MultilevelRoBMA/fit_Johnides2025.RDS differ diff --git a/models/MultilevelRoBMA/fit_Johnides2025_single.RDS b/models/MultilevelRoBMA/fit_Johnides2025_single.RDS new file mode 100644 index 00000000..252289c4 Binary files /dev/null and b/models/MultilevelRoBMA/fit_Johnides2025_single.RDS differ diff --git a/models/MultilevelRoBMARegression/zfit_Havrankova2025.RDS b/models/MultilevelRoBMARegression/zfit_Havrankova2025.RDS new file mode 100644 index 00000000..5f1644ed Binary files /dev/null and b/models/MultilevelRoBMARegression/zfit_Havrankova2025.RDS differ diff --git a/renv.lock b/renv.lock deleted file mode 100644 index 89961c76..00000000 --- a/renv.lock +++ /dev/null @@ -1,1457 +0,0 @@ -{ - "R": { - "Version": "4.5.1", - "Repositories": [ - { - "Name": "CRAN", - "URL": "https://cran.rstudio.com" - } - ] - }, - "Packages": { - "BayesTools": { - "Package": "BayesTools", - "Version": "0.2.20", - "Source": "Repository", - "Title": "Tools for Bayesian Analyses", - "Description": "Provides tools for conducting Bayesian analyses and Bayesian model averaging (Kass and Raftery, 1995, , Hoeting et al., 1999, ). The package contains functions for creating a wide range of prior distribution objects, mixing posterior samples from 'JAGS' and 'Stan' models, plotting posterior distributions, and etc... The tools for working with prior distribution span from visualization, generating 'JAGS' and 'bridgesampling' syntax to basic functions such as rng, quantile, and distribution functions.", - "Maintainer": "František Bartoš ", - "Authors@R": "c( person(\"František\", \"Bartoš\", role = c(\"aut\", \"cre\"), email = \"f.bartos96@gmail.com\", comment = c(ORCID = \"0000-0002-0018-5573\")) )", - "URL": "https://fbartos.github.io/BayesTools/", - "BugReports": "https://github.com/FBartos/BayesTools/issues", - "License": "GPL-3", - "Encoding": "UTF-8", - "LazyData": "true", - "RoxygenNote": "7.3.2", - "SystemRequirements": "JAGS >= 4.3.0 (https://mcmc-jags.sourceforge.io/)", - "Depends": [ - "stats" - ], - "Imports": [ - "graphics", - "extraDistr", - "mvtnorm", - "coda", - "bridgesampling", - "parallel", - "ggplot2", - "Rdpack", - "rlang" - ], - "Suggests": [ - "scales", - "testthat", - "vdiffr", - "covr", - "knitr", - "rstan", - "rjags", - "runjags", - "BayesFactor", - "RoBMA", - "rmarkdown" - ], - "RdMacros": "Rdpack", - "VignetteBuilder": "knitr", - "NeedsCompilation": "no", - "Author": "František Bartoš [aut, cre] (ORCID: )", - "Repository": "CRAN" - }, - "Brobdingnag": { - "Package": "Brobdingnag", - "Version": "1.2-9", - "Source": "Repository", - "Type": "Package", - "Title": "Very Large Numbers in R", - "Authors@R": "person(given=c(\"Robin\", \"K. S.\"), family=\"Hankin\", role = c(\"aut\",\"cre\"), email=\"hankin.robin@gmail.com\", comment = c(ORCID = \"0000-0001-5982-0415\"))", - "Maintainer": "Robin K. S. Hankin ", - "Depends": [ - "R (>= 2.13.0)", - "methods", - "Matrix (>= 1.5-0)" - ], - "Description": "Very large numbers in R. Real numbers are held using their natural logarithms, plus a logical flag indicating sign. Functionality for complex numbers is also provided. The package includes a vignette that gives a step-by-step introduction to using S4 methods.", - "Suggests": [ - "cubature", - "testthat" - ], - "License": "GPL", - "Repository": "CRAN", - "URL": "https://github.com/RobinHankin/Brobdingnag", - "NeedsCompilation": "no", - "Author": "Robin K. S. Hankin [aut, cre] ()" - }, - "MASS": { - "Package": "MASS", - "Version": "7.3-65", - "Source": "Repository", - "Priority": "recommended", - "Date": "2025-02-19", - "Revision": "$Rev: 3681 $", - "Depends": [ - "R (>= 4.4.0)", - "grDevices", - "graphics", - "stats", - "utils" - ], - "Imports": [ - "methods" - ], - "Suggests": [ - "lattice", - "nlme", - "nnet", - "survival" - ], - "Authors@R": "c(person(\"Brian\", \"Ripley\", role = c(\"aut\", \"cre\", \"cph\"), email = \"Brian.Ripley@R-project.org\"), person(\"Bill\", \"Venables\", role = c(\"aut\", \"cph\")), person(c(\"Douglas\", \"M.\"), \"Bates\", role = \"ctb\"), person(\"Kurt\", \"Hornik\", role = \"trl\", comment = \"partial port ca 1998\"), person(\"Albrecht\", \"Gebhardt\", role = \"trl\", comment = \"partial port ca 1998\"), person(\"David\", \"Firth\", role = \"ctb\", comment = \"support functions for polr\"))", - "Description": "Functions and datasets to support Venables and Ripley, \"Modern Applied Statistics with S\" (4th edition, 2002).", - "Title": "Support Functions and Datasets for Venables and Ripley's MASS", - "LazyData": "yes", - "ByteCompile": "yes", - "License": "GPL-2 | GPL-3", - "URL": "http://www.stats.ox.ac.uk/pub/MASS4/", - "Contact": "", - "NeedsCompilation": "yes", - "Author": "Brian Ripley [aut, cre, cph], Bill Venables [aut, cph], Douglas M. Bates [ctb], Kurt Hornik [trl] (partial port ca 1998), Albrecht Gebhardt [trl] (partial port ca 1998), David Firth [ctb] (support functions for polr)", - "Maintainer": "Brian Ripley ", - "Repository": "CRAN" - }, - "Matrix": { - "Package": "Matrix", - "Version": "1.7-3", - "Source": "Repository", - "VersionNote": "do also bump src/version.h, inst/include/Matrix/version.h", - "Date": "2025-03-05", - "Priority": "recommended", - "Title": "Sparse and Dense Matrix Classes and Methods", - "Description": "A rich hierarchy of sparse and dense matrix classes, including general, symmetric, triangular, and diagonal matrices with numeric, logical, or pattern entries. Efficient methods for operating on such matrices, often wrapping the 'BLAS', 'LAPACK', and 'SuiteSparse' libraries.", - "License": "GPL (>= 2) | file LICENCE", - "URL": "https://Matrix.R-forge.R-project.org", - "BugReports": "https://R-forge.R-project.org/tracker/?atid=294&group_id=61", - "Contact": "Matrix-authors@R-project.org", - "Authors@R": "c(person(\"Douglas\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"Martin\", \"Maechler\", role = c(\"aut\", \"cre\"), email = \"mmaechler+Matrix@gmail.com\", comment = c(ORCID = \"0000-0002-8685-9910\")), person(\"Mikael\", \"Jagan\", role = \"aut\", comment = c(ORCID = \"0000-0002-3542-2938\")), person(\"Timothy A.\", \"Davis\", role = \"ctb\", comment = c(ORCID = \"0000-0001-7614-6899\", \"SuiteSparse libraries\", \"collaborators listed in dir(system.file(\\\"doc\\\", \\\"SuiteSparse\\\", package=\\\"Matrix\\\"), pattern=\\\"License\\\", full.names=TRUE, recursive=TRUE)\")), person(\"George\", \"Karypis\", role = \"ctb\", comment = c(ORCID = \"0000-0003-2753-1437\", \"METIS library\", \"Copyright: Regents of the University of Minnesota\")), person(\"Jason\", \"Riedy\", role = \"ctb\", comment = c(ORCID = \"0000-0002-4345-4200\", \"GNU Octave's condest() and onenormest()\", \"Copyright: Regents of the University of California\")), person(\"Jens\", \"Oehlschlägel\", role = \"ctb\", comment = \"initial nearPD()\"), person(\"R Core Team\", role = \"ctb\", comment = c(ROR = \"02zz1nj61\", \"base R's matrix implementation\")))", - "Depends": [ - "R (>= 4.4)", - "methods" - ], - "Imports": [ - "grDevices", - "graphics", - "grid", - "lattice", - "stats", - "utils" - ], - "Suggests": [ - "MASS", - "datasets", - "sfsmisc", - "tools" - ], - "Enhances": [ - "SparseM", - "graph" - ], - "LazyData": "no", - "LazyDataNote": "not possible, since we use data/*.R and our S4 classes", - "BuildResaveData": "no", - "Encoding": "UTF-8", - "NeedsCompilation": "yes", - "Author": "Douglas Bates [aut] (), Martin Maechler [aut, cre] (), Mikael Jagan [aut] (), Timothy A. Davis [ctb] (, SuiteSparse libraries, collaborators listed in dir(system.file(\"doc\", \"SuiteSparse\", package=\"Matrix\"), pattern=\"License\", full.names=TRUE, recursive=TRUE)), George Karypis [ctb] (, METIS library, Copyright: Regents of the University of Minnesota), Jason Riedy [ctb] (, GNU Octave's condest() and onenormest(), Copyright: Regents of the University of California), Jens Oehlschlägel [ctb] (initial nearPD()), R Core Team [ctb] (02zz1nj61, base R's matrix implementation)", - "Maintainer": "Martin Maechler ", - "Repository": "CRAN" - }, - "R6": { - "Package": "R6", - "Version": "2.6.1", - "Source": "Repository", - "Title": "Encapsulated Classes with Reference Semantics", - "Authors@R": "c( person(\"Winston\", \"Chang\", , \"winston@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "Creates classes with reference semantics, similar to R's built-in reference classes. Compared to reference classes, R6 classes are simpler and lighter-weight, and they are not built on S4 classes so they do not require the methods package. These classes allow public and private members, and they support inheritance, even when the classes are defined in different packages.", - "License": "MIT + file LICENSE", - "URL": "https://r6.r-lib.org, https://github.com/r-lib/R6", - "BugReports": "https://github.com/r-lib/R6/issues", - "Depends": [ - "R (>= 3.6)" - ], - "Suggests": [ - "lobstr", - "testthat (>= 3.0.0)" - ], - "Config/Needs/website": "tidyverse/tidytemplate, ggplot2, microbenchmark, scales", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2", - "NeedsCompilation": "no", - "Author": "Winston Chang [aut, cre], Posit Software, PBC [cph, fnd]", - "Maintainer": "Winston Chang ", - "Repository": "CRAN" - }, - "RColorBrewer": { - "Package": "RColorBrewer", - "Version": "1.1-3", - "Source": "Repository", - "Date": "2022-04-03", - "Title": "ColorBrewer Palettes", - "Authors@R": "c(person(given = \"Erich\", family = \"Neuwirth\", role = c(\"aut\", \"cre\"), email = \"erich.neuwirth@univie.ac.at\"))", - "Author": "Erich Neuwirth [aut, cre]", - "Maintainer": "Erich Neuwirth ", - "Depends": [ - "R (>= 2.0.0)" - ], - "Description": "Provides color schemes for maps (and other graphics) designed by Cynthia Brewer as described at http://colorbrewer2.org.", - "License": "Apache License 2.0", - "NeedsCompilation": "no", - "Repository": "CRAN" - }, - "Rcpp": { - "Package": "Rcpp", - "Version": "1.0.14", - "Source": "Repository", - "Title": "Seamless R and C++ Integration", - "Date": "2025-01-11", - "Authors@R": "c(person(\"Dirk\", \"Eddelbuettel\", role = c(\"aut\", \"cre\"), email = \"edd@debian.org\", comment = c(ORCID = \"0000-0001-6419-907X\")), person(\"Romain\", \"Francois\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"JJ\", \"Allaire\", role = \"aut\", comment = c(ORCID = \"0000-0003-0174-9868\")), person(\"Kevin\", \"Ushey\", role = \"aut\", comment = c(ORCID = \"0000-0003-2880-7407\")), person(\"Qiang\", \"Kou\", role = \"aut\", comment = c(ORCID = \"0000-0001-6786-5453\")), person(\"Nathan\", \"Russell\", role = \"aut\"), person(\"Iñaki\", \"Ucar\", role = \"aut\", comment = c(ORCID = \"0000-0001-6403-5550\")), person(\"Doug\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"John\", \"Chambers\", role = \"aut\"))", - "Description": "The 'Rcpp' package provides R functions as well as C++ classes which offer a seamless integration of R and C++. Many R data types and objects can be mapped back and forth to C++ equivalents which facilitates both writing of new code as well as easier integration of third-party libraries. Documentation about 'Rcpp' is provided by several vignettes included in this package, via the 'Rcpp Gallery' site at , the paper by Eddelbuettel and Francois (2011, ), the book by Eddelbuettel (2013, ) and the paper by Eddelbuettel and Balamuta (2018, ); see 'citation(\"Rcpp\")' for details.", - "Imports": [ - "methods", - "utils" - ], - "Suggests": [ - "tinytest", - "inline", - "rbenchmark", - "pkgKitten (>= 0.1.2)" - ], - "URL": "https://www.rcpp.org, https://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp", - "License": "GPL (>= 2)", - "BugReports": "https://github.com/RcppCore/Rcpp/issues", - "MailingList": "rcpp-devel@lists.r-forge.r-project.org", - "RoxygenNote": "6.1.1", - "Encoding": "UTF-8", - "NeedsCompilation": "yes", - "Author": "Dirk Eddelbuettel [aut, cre] (), Romain Francois [aut] (), JJ Allaire [aut] (), Kevin Ushey [aut] (), Qiang Kou [aut] (), Nathan Russell [aut], Iñaki Ucar [aut] (), Doug Bates [aut] (), John Chambers [aut]", - "Maintainer": "Dirk Eddelbuettel ", - "Repository": "CRAN" - }, - "Rdpack": { - "Package": "Rdpack", - "Version": "2.6.4", - "Source": "Repository", - "Type": "Package", - "Title": "Update and Manipulate Rd Documentation Objects", - "Authors@R": "c( person(given = c(\"Georgi\", \"N.\"), family = \"Boshnakov\", role = c(\"aut\", \"cre\"), email = \"georgi.boshnakov@manchester.ac.uk\", comment = c(ORCID = \"0000-0003-2839-346X\")), person(given = \"Duncan\", family = \"Murdoch\", role = \"ctb\", email = \"murdoch.duncan@gmail.com\") )", - "Description": "Functions for manipulation of R documentation objects, including functions reprompt() and ereprompt() for updating 'Rd' documentation for functions, methods and classes; 'Rd' macros for citations and import of references from 'bibtex' files for use in 'Rd' files and 'roxygen2' comments; 'Rd' macros for evaluating and inserting snippets of 'R' code and the results of its evaluation or creating graphics on the fly; and many functions for manipulation of references and Rd files.", - "URL": "https://geobosh.github.io/Rdpack/ (doc), https://github.com/GeoBosh/Rdpack (devel)", - "BugReports": "https://github.com/GeoBosh/Rdpack/issues", - "Depends": [ - "R (>= 2.15.0)", - "methods" - ], - "Imports": [ - "tools", - "utils", - "rbibutils (>= 1.3)" - ], - "Suggests": [ - "grDevices", - "testthat", - "rstudioapi", - "rprojroot", - "gbRd" - ], - "License": "GPL (>= 2)", - "LazyLoad": "yes", - "RoxygenNote": "7.1.1", - "NeedsCompilation": "no", - "Author": "Georgi N. Boshnakov [aut, cre] (), Duncan Murdoch [ctb]", - "Maintainer": "Georgi N. Boshnakov ", - "Repository": "CRAN" - }, - "bridgesampling": { - "Package": "bridgesampling", - "Version": "1.1-2", - "Source": "Repository", - "Type": "Package", - "Title": "Bridge Sampling for Marginal Likelihoods and Bayes Factors", - "Authors@R": "c(person(given=\"Quentin F.\", family=\"Gronau\", role=c(\"aut\", \"cre\"), email=\"Quentin.F.Gronau@gmail.com\", comment=c(ORCID=\"0000-0001-5510-6943\")), person(given=\"Henrik\", family=\"Singmann\", role=\"aut\", comment=c(ORCID=\"0000-0002-4842-3657\")), person(given=\"Jonathan J.\", family=\"Forster\", role=\"ctb\"), person(given=\"Eric-Jan\", family=\"Wagenmakers\", role=\"ths\"), person(family=\"The JASP Team\", role=\"ctb\"), person(\"Jiqiang\", \"Guo\", role = \"ctb\"), person(\"Jonah\", \"Gabry\", role = \"ctb\"), person(\"Ben\", \"Goodrich\", role = c(\"ctb\")), person(\"Kees\", \"Mulder\", role = c(\"ctb\")), person(\"Perry\", \"de Valpine\", role = c(\"ctb\")) )", - "Depends": [ - "R (>= 3.0.0)" - ], - "Imports": [ - "mvtnorm", - "Matrix", - "Brobdingnag", - "stringr", - "coda", - "parallel", - "scales", - "utils", - "methods" - ], - "Suggests": [ - "testthat", - "Rcpp", - "RcppEigen", - "R2jags", - "rjags", - "runjags", - "knitr", - "rmarkdown", - "R.rsp", - "BayesFactor", - "rstan", - "rstanarm", - "nimble", - "MCMCpack" - ], - "Description": "Provides functions for estimating marginal likelihoods, Bayes factors, posterior model probabilities, and normalizing constants in general, via different versions of bridge sampling (Meng & Wong, 1996, ). Gronau, Singmann, & Wagenmakers (2020) .", - "License": "GPL (>= 2)", - "LazyData": "true", - "RoxygenNote": "7.1.1", - "VignetteBuilder": "knitr, R.rsp", - "URL": "https://github.com/quentingronau/bridgesampling", - "NeedsCompilation": "no", - "Author": "Quentin F. Gronau [aut, cre] (), Henrik Singmann [aut] (), Jonathan J. Forster [ctb], Eric-Jan Wagenmakers [ths], The JASP Team [ctb], Jiqiang Guo [ctb], Jonah Gabry [ctb], Ben Goodrich [ctb], Kees Mulder [ctb], Perry de Valpine [ctb]", - "Maintainer": "Quentin F. Gronau ", - "Repository": "CRAN" - }, - "cli": { - "Package": "cli", - "Version": "3.6.5", - "Source": "Repository", - "Title": "Helpers for Developing Command Line Interfaces", - "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"gabor@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", role = \"ctb\"), person(\"Kirill\", \"Müller\", role = \"ctb\"), person(\"Salim\", \"Brüggemann\", , \"salim-b@pm.me\", role = \"ctb\", comment = c(ORCID = \"0000-0002-5329-5987\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "A suite of tools to build attractive command line interfaces ('CLIs'), from semantic elements: headings, lists, alerts, paragraphs, etc. Supports custom themes via a 'CSS'-like language. It also contains a number of lower level 'CLI' elements: rules, boxes, trees, and 'Unicode' symbols with 'ASCII' alternatives. It support ANSI colors and text styles as well.", - "License": "MIT + file LICENSE", - "URL": "https://cli.r-lib.org, https://github.com/r-lib/cli", - "BugReports": "https://github.com/r-lib/cli/issues", - "Depends": [ - "R (>= 3.4)" - ], - "Imports": [ - "utils" - ], - "Suggests": [ - "callr", - "covr", - "crayon", - "digest", - "glue (>= 1.6.0)", - "grDevices", - "htmltools", - "htmlwidgets", - "knitr", - "methods", - "processx", - "ps (>= 1.3.4.9000)", - "rlang (>= 1.0.2.9003)", - "rmarkdown", - "rprojroot", - "rstudioapi", - "testthat (>= 3.2.0)", - "tibble", - "whoami", - "withr" - ], - "Config/Needs/website": "r-lib/asciicast, bench, brio, cpp11, decor, desc, fansi, prettyunits, sessioninfo, tidyverse/tidytemplate, usethis, vctrs", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2", - "NeedsCompilation": "yes", - "Author": "Gábor Csárdi [aut, cre], Hadley Wickham [ctb], Kirill Müller [ctb], Salim Brüggemann [ctb] (), Posit Software, PBC [cph, fnd]", - "Maintainer": "Gábor Csárdi ", - "Repository": "CRAN" - }, - "coda": { - "Package": "coda", - "Version": "0.19-4.1", - "Source": "Repository", - "Date": "2020-09-30", - "Title": "Output Analysis and Diagnostics for MCMC", - "Authors@R": "c(person(\"Martyn\", \"Plummer\", role=c(\"aut\",\"cre\",\"trl\"), email=\"martyn.plummer@gmail.com\"), person(\"Nicky\", \"Best\", role=\"aut\"), person(\"Kate\", \"Cowles\", role=\"aut\"), person(\"Karen\", \"Vines\", role=\"aut\"), person(\"Deepayan\", \"Sarkar\", role=\"aut\"), person(\"Douglas\", \"Bates\", role=\"aut\"), person(\"Russell\", \"Almond\", role=\"aut\"), person(\"Arni\", \"Magnusson\", role=\"aut\"))", - "Depends": [ - "R (>= 2.14.0)" - ], - "Imports": [ - "lattice" - ], - "Description": "Provides functions for summarizing and plotting the output from Markov Chain Monte Carlo (MCMC) simulations, as well as diagnostic tests of convergence to the equilibrium distribution of the Markov chain.", - "License": "GPL (>= 2)", - "NeedsCompilation": "no", - "Author": "Martyn Plummer [aut, cre, trl], Nicky Best [aut], Kate Cowles [aut], Karen Vines [aut], Deepayan Sarkar [aut], Douglas Bates [aut], Russell Almond [aut], Arni Magnusson [aut]", - "Maintainer": "Martyn Plummer ", - "Repository": "CRAN" - }, - "extraDistr": { - "Package": "extraDistr", - "Version": "1.10.0", - "Source": "Repository", - "Type": "Package", - "Title": "Additional Univariate and Multivariate Distributions", - "Date": "2023-12-30", - "Author": "Tymoteusz Wolodzko", - "Maintainer": "Tymoteusz Wolodzko ", - "Description": "Density, distribution function, quantile function and random generation for a number of univariate and multivariate distributions. This package implements the following distributions: Bernoulli, beta-binomial, beta-negative binomial, beta prime, Bhattacharjee, Birnbaum-Saunders, bivariate normal, bivariate Poisson, categorical, Dirichlet, Dirichlet-multinomial, discrete gamma, discrete Laplace, discrete normal, discrete uniform, discrete Weibull, Frechet, gamma-Poisson, generalized extreme value, Gompertz, generalized Pareto, Gumbel, half-Cauchy, half-normal, half-t, Huber density, inverse chi-squared, inverse-gamma, Kumaraswamy, Laplace, location-scale t, logarithmic, Lomax, multivariate hypergeometric, multinomial, negative hypergeometric, non-standard beta, normal mixture, Poisson mixture, Pareto, power, reparametrized beta, Rayleigh, shifted Gompertz, Skellam, slash, triangular, truncated binomial, truncated normal, truncated Poisson, Tukey lambda, Wald, zero-inflated binomial, zero-inflated negative binomial, zero-inflated Poisson.", - "License": "GPL-2", - "URL": "https://github.com/twolodzko/extraDistr", - "BugReports": "https://github.com/twolodzko/extraDistr/issues", - "Encoding": "UTF-8", - "Depends": [ - "R (>= 3.1.0)" - ], - "LinkingTo": [ - "Rcpp" - ], - "Imports": [ - "Rcpp" - ], - "Suggests": [ - "testthat", - "LaplacesDemon", - "VGAM", - "evd", - "skellam", - "triangle", - "actuar" - ], - "SystemRequirements": "C++", - "RoxygenNote": "7.2.3", - "NeedsCompilation": "yes", - "Repository": "CRAN" - }, - "farver": { - "Package": "farver", - "Version": "2.1.2", - "Source": "Repository", - "Type": "Package", - "Title": "High Performance Colour Space Manipulation", - "Authors@R": "c( person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Berendea\", \"Nicolae\", role = \"aut\", comment = \"Author of the ColorSpace C++ library\"), person(\"Romain\", \"François\", , \"romain@purrple.cat\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "The encoding of colour can be handled in many different ways, using different colour spaces. As different colour spaces have different uses, efficient conversion between these representations are important. The 'farver' package provides a set of functions that gives access to very fast colour space conversion and comparisons implemented in C++, and offers speed improvements over the 'convertColor' function in the 'grDevices' package.", - "License": "MIT + file LICENSE", - "URL": "https://farver.data-imaginist.com, https://github.com/thomasp85/farver", - "BugReports": "https://github.com/thomasp85/farver/issues", - "Suggests": [ - "covr", - "testthat (>= 3.0.0)" - ], - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.1", - "NeedsCompilation": "yes", - "Author": "Thomas Lin Pedersen [cre, aut] (), Berendea Nicolae [aut] (Author of the ColorSpace C++ library), Romain François [aut] (), Posit, PBC [cph, fnd]", - "Maintainer": "Thomas Lin Pedersen ", - "Repository": "CRAN" - }, - "ggplot2": { - "Package": "ggplot2", - "Version": "3.5.2", - "Source": "Repository", - "Title": "Create Elegant Data Visualisations Using the Grammar of Graphics", - "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Winston\", \"Chang\", role = \"aut\", comment = c(ORCID = \"0000-0002-1576-2126\")), person(\"Lionel\", \"Henry\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Kohske\", \"Takahashi\", role = \"aut\"), person(\"Claus\", \"Wilke\", role = \"aut\", comment = c(ORCID = \"0000-0002-7470-9261\")), person(\"Kara\", \"Woo\", role = \"aut\", comment = c(ORCID = \"0000-0002-5125-4188\")), person(\"Hiroaki\", \"Yutani\", role = \"aut\", comment = c(ORCID = \"0000-0002-3385-7233\")), person(\"Dewey\", \"Dunnington\", role = \"aut\", comment = c(ORCID = \"0000-0002-9415-4582\")), person(\"Teun\", \"van den Brand\", role = \"aut\", comment = c(ORCID = \"0000-0002-9335-7468\")), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "A system for 'declaratively' creating graphics, based on \"The Grammar of Graphics\". You provide the data, tell 'ggplot2' how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.", - "License": "MIT + file LICENSE", - "URL": "https://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2", - "BugReports": "https://github.com/tidyverse/ggplot2/issues", - "Depends": [ - "R (>= 3.5)" - ], - "Imports": [ - "cli", - "glue", - "grDevices", - "grid", - "gtable (>= 0.1.1)", - "isoband", - "lifecycle (> 1.0.1)", - "MASS", - "mgcv", - "rlang (>= 1.1.0)", - "scales (>= 1.3.0)", - "stats", - "tibble", - "vctrs (>= 0.6.0)", - "withr (>= 2.5.0)" - ], - "Suggests": [ - "covr", - "dplyr", - "ggplot2movies", - "hexbin", - "Hmisc", - "knitr", - "mapproj", - "maps", - "multcomp", - "munsell", - "nlme", - "profvis", - "quantreg", - "ragg (>= 1.2.6)", - "RColorBrewer", - "rmarkdown", - "rpart", - "sf (>= 0.7-3)", - "svglite (>= 2.1.2)", - "testthat (>= 3.1.2)", - "vdiffr (>= 1.0.6)", - "xml2" - ], - "Enhances": [ - "sp" - ], - "VignetteBuilder": "knitr", - "Config/Needs/website": "ggtext, tidyr, forcats, tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "LazyData": "true", - "RoxygenNote": "7.3.2", - "Collate": "'ggproto.R' 'ggplot-global.R' 'aaa-.R' 'aes-colour-fill-alpha.R' 'aes-evaluation.R' 'aes-group-order.R' 'aes-linetype-size-shape.R' 'aes-position.R' 'compat-plyr.R' 'utilities.R' 'aes.R' 'utilities-checks.R' 'legend-draw.R' 'geom-.R' 'annotation-custom.R' 'annotation-logticks.R' 'geom-polygon.R' 'geom-map.R' 'annotation-map.R' 'geom-raster.R' 'annotation-raster.R' 'annotation.R' 'autolayer.R' 'autoplot.R' 'axis-secondary.R' 'backports.R' 'bench.R' 'bin.R' 'coord-.R' 'coord-cartesian-.R' 'coord-fixed.R' 'coord-flip.R' 'coord-map.R' 'coord-munch.R' 'coord-polar.R' 'coord-quickmap.R' 'coord-radial.R' 'coord-sf.R' 'coord-transform.R' 'data.R' 'docs_layer.R' 'facet-.R' 'facet-grid-.R' 'facet-null.R' 'facet-wrap.R' 'fortify-lm.R' 'fortify-map.R' 'fortify-multcomp.R' 'fortify-spatial.R' 'fortify.R' 'stat-.R' 'geom-abline.R' 'geom-rect.R' 'geom-bar.R' 'geom-bin2d.R' 'geom-blank.R' 'geom-boxplot.R' 'geom-col.R' 'geom-path.R' 'geom-contour.R' 'geom-count.R' 'geom-crossbar.R' 'geom-segment.R' 'geom-curve.R' 'geom-defaults.R' 'geom-ribbon.R' 'geom-density.R' 'geom-density2d.R' 'geom-dotplot.R' 'geom-errorbar.R' 'geom-errorbarh.R' 'geom-freqpoly.R' 'geom-function.R' 'geom-hex.R' 'geom-histogram.R' 'geom-hline.R' 'geom-jitter.R' 'geom-label.R' 'geom-linerange.R' 'geom-point.R' 'geom-pointrange.R' 'geom-quantile.R' 'geom-rug.R' 'geom-sf.R' 'geom-smooth.R' 'geom-spoke.R' 'geom-text.R' 'geom-tile.R' 'geom-violin.R' 'geom-vline.R' 'ggplot2-package.R' 'grob-absolute.R' 'grob-dotstack.R' 'grob-null.R' 'grouping.R' 'theme-elements.R' 'guide-.R' 'guide-axis.R' 'guide-axis-logticks.R' 'guide-axis-stack.R' 'guide-axis-theta.R' 'guide-legend.R' 'guide-bins.R' 'guide-colorbar.R' 'guide-colorsteps.R' 'guide-custom.R' 'layer.R' 'guide-none.R' 'guide-old.R' 'guides-.R' 'guides-grid.R' 'hexbin.R' 'import-standalone-obj-type.R' 'import-standalone-types-check.R' 'labeller.R' 'labels.R' 'layer-sf.R' 'layout.R' 'limits.R' 'margins.R' 'performance.R' 'plot-build.R' 'plot-construction.R' 'plot-last.R' 'plot.R' 'position-.R' 'position-collide.R' 'position-dodge.R' 'position-dodge2.R' 'position-identity.R' 'position-jitter.R' 'position-jitterdodge.R' 'position-nudge.R' 'position-stack.R' 'quick-plot.R' 'reshape-add-margins.R' 'save.R' 'scale-.R' 'scale-alpha.R' 'scale-binned.R' 'scale-brewer.R' 'scale-colour.R' 'scale-continuous.R' 'scale-date.R' 'scale-discrete-.R' 'scale-expansion.R' 'scale-gradient.R' 'scale-grey.R' 'scale-hue.R' 'scale-identity.R' 'scale-linetype.R' 'scale-linewidth.R' 'scale-manual.R' 'scale-shape.R' 'scale-size.R' 'scale-steps.R' 'scale-type.R' 'scale-view.R' 'scale-viridis.R' 'scales-.R' 'stat-align.R' 'stat-bin.R' 'stat-bin2d.R' 'stat-bindot.R' 'stat-binhex.R' 'stat-boxplot.R' 'stat-contour.R' 'stat-count.R' 'stat-density-2d.R' 'stat-density.R' 'stat-ecdf.R' 'stat-ellipse.R' 'stat-function.R' 'stat-identity.R' 'stat-qq-line.R' 'stat-qq.R' 'stat-quantilemethods.R' 'stat-sf-coordinates.R' 'stat-sf.R' 'stat-smooth-methods.R' 'stat-smooth.R' 'stat-sum.R' 'stat-summary-2d.R' 'stat-summary-bin.R' 'stat-summary-hex.R' 'stat-summary.R' 'stat-unique.R' 'stat-ydensity.R' 'summarise-plot.R' 'summary.R' 'theme.R' 'theme-defaults.R' 'theme-current.R' 'utilities-break.R' 'utilities-grid.R' 'utilities-help.R' 'utilities-matrix.R' 'utilities-patterns.R' 'utilities-resolution.R' 'utilities-tidy-eval.R' 'zxx.R' 'zzz.R'", - "NeedsCompilation": "no", - "Author": "Hadley Wickham [aut] (), Winston Chang [aut] (), Lionel Henry [aut], Thomas Lin Pedersen [aut, cre] (), Kohske Takahashi [aut], Claus Wilke [aut] (), Kara Woo [aut] (), Hiroaki Yutani [aut] (), Dewey Dunnington [aut] (), Teun van den Brand [aut] (), Posit, PBC [cph, fnd]", - "Maintainer": "Thomas Lin Pedersen ", - "Repository": "CRAN" - }, - "glue": { - "Package": "glue", - "Version": "1.8.0", - "Source": "Repository", - "Title": "Interpreted String Literals", - "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Jennifer\", \"Bryan\", , \"jenny@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-6983-2759\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "An implementation of interpreted string literals, inspired by Python's Literal String Interpolation and Docstrings and Julia's Triple-Quoted String Literals .", - "License": "MIT + file LICENSE", - "URL": "https://glue.tidyverse.org/, https://github.com/tidyverse/glue", - "BugReports": "https://github.com/tidyverse/glue/issues", - "Depends": [ - "R (>= 3.6)" - ], - "Imports": [ - "methods" - ], - "Suggests": [ - "crayon", - "DBI (>= 1.2.0)", - "dplyr", - "knitr", - "magrittr", - "rlang", - "rmarkdown", - "RSQLite", - "testthat (>= 3.2.0)", - "vctrs (>= 0.3.0)", - "waldo (>= 0.5.3)", - "withr" - ], - "VignetteBuilder": "knitr", - "ByteCompile": "true", - "Config/Needs/website": "bench, forcats, ggbeeswarm, ggplot2, R.utils, rprintf, tidyr, tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2", - "NeedsCompilation": "yes", - "Author": "Jim Hester [aut] (), Jennifer Bryan [aut, cre] (), Posit Software, PBC [cph, fnd]", - "Maintainer": "Jennifer Bryan ", - "Repository": "CRAN" - }, - "gtable": { - "Package": "gtable", - "Version": "0.3.6", - "Source": "Repository", - "Title": "Arrange 'Grobs' in Tables", - "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "Tools to make it easier to work with \"tables\" of 'grobs'. The 'gtable' package defines a 'gtable' grob class that specifies a grid along with a list of grobs and their placement in the grid. Further the package makes it easy to manipulate and combine 'gtable' objects so that complex compositions can be built up sequentially.", - "License": "MIT + file LICENSE", - "URL": "https://gtable.r-lib.org, https://github.com/r-lib/gtable", - "BugReports": "https://github.com/r-lib/gtable/issues", - "Depends": [ - "R (>= 4.0)" - ], - "Imports": [ - "cli", - "glue", - "grid", - "lifecycle", - "rlang (>= 1.1.0)", - "stats" - ], - "Suggests": [ - "covr", - "ggplot2", - "knitr", - "profvis", - "rmarkdown", - "testthat (>= 3.0.0)" - ], - "VignetteBuilder": "knitr", - "Config/Needs/website": "tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Config/usethis/last-upkeep": "2024-10-25", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2", - "NeedsCompilation": "no", - "Author": "Hadley Wickham [aut], Thomas Lin Pedersen [aut, cre], Posit Software, PBC [cph, fnd]", - "Maintainer": "Thomas Lin Pedersen ", - "Repository": "CRAN" - }, - "isoband": { - "Package": "isoband", - "Version": "0.2.7", - "Source": "Repository", - "Title": "Generate Isolines and Isobands from Regularly Spaced Elevation Grids", - "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Claus O.\", \"Wilke\", , \"wilke@austin.utexas.edu\", role = \"aut\", comment = c(\"Original author\", ORCID = \"0000-0002-7470-9261\")), person(\"Thomas Lin\", \"Pedersen\", , \"thomasp85@gmail.com\", role = \"aut\", comment = c(ORCID = \"0000-0002-5147-4711\")) )", - "Description": "A fast C++ implementation to generate contour lines (isolines) and contour polygons (isobands) from regularly spaced grids containing elevation data.", - "License": "MIT + file LICENSE", - "URL": "https://isoband.r-lib.org", - "BugReports": "https://github.com/r-lib/isoband/issues", - "Imports": [ - "grid", - "utils" - ], - "Suggests": [ - "covr", - "ggplot2", - "knitr", - "magick", - "microbenchmark", - "rmarkdown", - "sf", - "testthat", - "xml2" - ], - "VignetteBuilder": "knitr", - "Config/Needs/website": "tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "RoxygenNote": "7.2.3", - "SystemRequirements": "C++11", - "NeedsCompilation": "yes", - "Author": "Hadley Wickham [aut, cre] (), Claus O. Wilke [aut] (Original author, ), Thomas Lin Pedersen [aut] ()", - "Maintainer": "Hadley Wickham ", - "Repository": "CRAN" - }, - "labeling": { - "Package": "labeling", - "Version": "0.4.3", - "Source": "Repository", - "Type": "Package", - "Title": "Axis Labeling", - "Date": "2023-08-29", - "Author": "Justin Talbot,", - "Maintainer": "Nuno Sempere ", - "Description": "Functions which provide a range of axis labeling algorithms.", - "License": "MIT + file LICENSE | Unlimited", - "Collate": "'labeling.R'", - "NeedsCompilation": "no", - "Imports": [ - "stats", - "graphics" - ], - "Repository": "CRAN" - }, - "lattice": { - "Package": "lattice", - "Version": "0.22-7", - "Source": "Repository", - "Date": "2025-03-31", - "Priority": "recommended", - "Title": "Trellis Graphics for R", - "Authors@R": "c(person(\"Deepayan\", \"Sarkar\", role = c(\"aut\", \"cre\"), email = \"deepayan.sarkar@r-project.org\", comment = c(ORCID = \"0000-0003-4107-1553\")), person(\"Felix\", \"Andrews\", role = \"ctb\"), person(\"Kevin\", \"Wright\", role = \"ctb\", comment = \"documentation\"), person(\"Neil\", \"Klepeis\", role = \"ctb\"), person(\"Johan\", \"Larsson\", role = \"ctb\", comment = \"miscellaneous improvements\"), person(\"Zhijian (Jason)\", \"Wen\", role = \"cph\", comment = \"filled contour code\"), person(\"Paul\", \"Murrell\", role = \"ctb\", email = \"paul@stat.auckland.ac.nz\"), person(\"Stefan\", \"Eng\", role = \"ctb\", comment = \"violin plot improvements\"), person(\"Achim\", \"Zeileis\", role = \"ctb\", comment = \"modern colors\"), person(\"Alexandre\", \"Courtiol\", role = \"ctb\", comment = \"generics for larrows, lpolygon, lrect and lsegments\") )", - "Description": "A powerful and elegant high-level data visualization system inspired by Trellis graphics, with an emphasis on multivariate data. Lattice is sufficient for typical graphics needs, and is also flexible enough to handle most nonstandard requirements. See ?Lattice for an introduction.", - "Depends": [ - "R (>= 4.0.0)" - ], - "Suggests": [ - "KernSmooth", - "MASS", - "latticeExtra", - "colorspace" - ], - "Imports": [ - "grid", - "grDevices", - "graphics", - "stats", - "utils" - ], - "Enhances": [ - "chron", - "zoo" - ], - "LazyLoad": "yes", - "LazyData": "yes", - "License": "GPL (>= 2)", - "URL": "https://lattice.r-forge.r-project.org/", - "BugReports": "https://github.com/deepayan/lattice/issues", - "NeedsCompilation": "yes", - "Author": "Deepayan Sarkar [aut, cre] (), Felix Andrews [ctb], Kevin Wright [ctb] (documentation), Neil Klepeis [ctb], Johan Larsson [ctb] (miscellaneous improvements), Zhijian (Jason) Wen [cph] (filled contour code), Paul Murrell [ctb], Stefan Eng [ctb] (violin plot improvements), Achim Zeileis [ctb] (modern colors), Alexandre Courtiol [ctb] (generics for larrows, lpolygon, lrect and lsegments)", - "Maintainer": "Deepayan Sarkar ", - "Repository": "CRAN" - }, - "lifecycle": { - "Package": "lifecycle", - "Version": "1.0.4", - "Source": "Repository", - "Title": "Manage the Life Cycle of your Package Functions", - "Authors@R": "c( person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "Manage the life cycle of your exported functions with shared conventions, documentation badges, and user-friendly deprecation warnings.", - "License": "MIT + file LICENSE", - "URL": "https://lifecycle.r-lib.org/, https://github.com/r-lib/lifecycle", - "BugReports": "https://github.com/r-lib/lifecycle/issues", - "Depends": [ - "R (>= 3.6)" - ], - "Imports": [ - "cli (>= 3.4.0)", - "glue", - "rlang (>= 1.1.0)" - ], - "Suggests": [ - "covr", - "crayon", - "knitr", - "lintr", - "rmarkdown", - "testthat (>= 3.0.1)", - "tibble", - "tidyverse", - "tools", - "vctrs", - "withr" - ], - "VignetteBuilder": "knitr", - "Config/Needs/website": "tidyverse/tidytemplate, usethis", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "RoxygenNote": "7.2.1", - "NeedsCompilation": "no", - "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut] (), Posit Software, PBC [cph, fnd]", - "Maintainer": "Lionel Henry ", - "Repository": "CRAN" - }, - "magrittr": { - "Package": "magrittr", - "Version": "2.0.3", - "Source": "Repository", - "Type": "Package", - "Title": "A Forward-Pipe Operator for R", - "Authors@R": "c( person(\"Stefan Milton\", \"Bache\", , \"stefan@stefanbache.dk\", role = c(\"aut\", \"cph\"), comment = \"Original author and creator of magrittr\"), person(\"Hadley\", \"Wickham\", , \"hadley@rstudio.com\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@rstudio.com\", role = \"cre\"), person(\"RStudio\", role = c(\"cph\", \"fnd\")) )", - "Description": "Provides a mechanism for chaining commands with a new forward-pipe operator, %>%. This operator will forward a value, or the result of an expression, into the next function call/expression. There is flexible support for the type of right-hand side expressions. For more information, see package vignette. To quote Rene Magritte, \"Ceci n'est pas un pipe.\"", - "License": "MIT + file LICENSE", - "URL": "https://magrittr.tidyverse.org, https://github.com/tidyverse/magrittr", - "BugReports": "https://github.com/tidyverse/magrittr/issues", - "Depends": [ - "R (>= 3.4.0)" - ], - "Suggests": [ - "covr", - "knitr", - "rlang", - "rmarkdown", - "testthat" - ], - "VignetteBuilder": "knitr", - "ByteCompile": "Yes", - "Config/Needs/website": "tidyverse/tidytemplate", - "Encoding": "UTF-8", - "RoxygenNote": "7.1.2", - "NeedsCompilation": "yes", - "Author": "Stefan Milton Bache [aut, cph] (Original author and creator of magrittr), Hadley Wickham [aut], Lionel Henry [cre], RStudio [cph, fnd]", - "Maintainer": "Lionel Henry ", - "Repository": "CRAN" - }, - "mgcv": { - "Package": "mgcv", - "Version": "1.9-3", - "Source": "Repository", - "Authors@R": "person(given = \"Simon\", family = \"Wood\", role = c(\"aut\", \"cre\"), email = \"simon.wood@r-project.org\")", - "Title": "Mixed GAM Computation Vehicle with Automatic Smoothness Estimation", - "Description": "Generalized additive (mixed) models, some of their extensions and other generalized ridge regression with multiple smoothing parameter estimation by (Restricted) Marginal Likelihood, Generalized Cross Validation and similar, or using iterated nested Laplace approximation for fully Bayesian inference. See Wood (2017) for an overview. Includes a gam() function, a wide variety of smoothers, 'JAGS' support and distributions beyond the exponential family.", - "Priority": "recommended", - "Depends": [ - "R (>= 3.6.0)", - "nlme (>= 3.1-64)" - ], - "Imports": [ - "methods", - "stats", - "graphics", - "Matrix", - "splines", - "utils" - ], - "Suggests": [ - "parallel", - "survival", - "MASS" - ], - "LazyLoad": "yes", - "ByteCompile": "yes", - "License": "GPL (>= 2)", - "NeedsCompilation": "yes", - "Author": "Simon Wood [aut, cre]", - "Maintainer": "Simon Wood ", - "Repository": "CRAN" - }, - "mvtnorm": { - "Package": "mvtnorm", - "Version": "1.3-3", - "Source": "Repository", - "Title": "Multivariate Normal and t Distributions", - "Date": "2025-01-09", - "Authors@R": "c(person(\"Alan\", \"Genz\", role = \"aut\"), person(\"Frank\", \"Bretz\", role = \"aut\"), person(\"Tetsuhisa\", \"Miwa\", role = \"aut\"), person(\"Xuefei\", \"Mi\", role = \"aut\"), person(\"Friedrich\", \"Leisch\", role = \"ctb\"), person(\"Fabian\", \"Scheipl\", role = \"ctb\"), person(\"Bjoern\", \"Bornkamp\", role = \"ctb\", comment = c(ORCID = \"0000-0002-6294-8185\")), person(\"Martin\", \"Maechler\", role = \"ctb\", comment = c(ORCID = \"0000-0002-8685-9910\")), person(\"Torsten\", \"Hothorn\", role = c(\"aut\", \"cre\"), email = \"Torsten.Hothorn@R-project.org\", comment = c(ORCID = \"0000-0001-8301-0471\")))", - "Description": "Computes multivariate normal and t probabilities, quantiles, random deviates, and densities. Log-likelihoods for multivariate Gaussian models and Gaussian copulae parameterised by Cholesky factors of covariance or precision matrices are implemented for interval-censored and exact data, or a mix thereof. Score functions for these log-likelihoods are available. A class representing multiple lower triangular matrices and corresponding methods are part of this package.", - "Imports": [ - "stats" - ], - "Depends": [ - "R(>= 3.5.0)" - ], - "Suggests": [ - "qrng", - "numDeriv" - ], - "License": "GPL-2", - "URL": "http://mvtnorm.R-forge.R-project.org", - "NeedsCompilation": "yes", - "Author": "Alan Genz [aut], Frank Bretz [aut], Tetsuhisa Miwa [aut], Xuefei Mi [aut], Friedrich Leisch [ctb], Fabian Scheipl [ctb], Bjoern Bornkamp [ctb] (), Martin Maechler [ctb] (), Torsten Hothorn [aut, cre] ()", - "Maintainer": "Torsten Hothorn ", - "Repository": "CRAN" - }, - "nlme": { - "Package": "nlme", - "Version": "3.1-168", - "Source": "Repository", - "Date": "2025-03-31", - "Priority": "recommended", - "Title": "Linear and Nonlinear Mixed Effects Models", - "Authors@R": "c(person(\"José\", \"Pinheiro\", role = \"aut\", comment = \"S version\"), person(\"Douglas\", \"Bates\", role = \"aut\", comment = \"up to 2007\"), person(\"Saikat\", \"DebRoy\", role = \"ctb\", comment = \"up to 2002\"), person(\"Deepayan\", \"Sarkar\", role = \"ctb\", comment = \"up to 2005\"), person(\"EISPACK authors\", role = \"ctb\", comment = \"src/rs.f\"), person(\"Siem\", \"Heisterkamp\", role = \"ctb\", comment = \"Author fixed sigma\"), person(\"Bert\", \"Van Willigen\",role = \"ctb\", comment = \"Programmer fixed sigma\"), person(\"Johannes\", \"Ranke\", role = \"ctb\", comment = \"varConstProp()\"), person(\"R Core Team\", email = \"R-core@R-project.org\", role = c(\"aut\", \"cre\"), comment = c(ROR = \"02zz1nj61\")))", - "Contact": "see 'MailingList'", - "Description": "Fit and compare Gaussian linear and nonlinear mixed-effects models.", - "Depends": [ - "R (>= 3.6.0)" - ], - "Imports": [ - "graphics", - "stats", - "utils", - "lattice" - ], - "Suggests": [ - "MASS", - "SASmixed" - ], - "LazyData": "yes", - "Encoding": "UTF-8", - "License": "GPL (>= 2)", - "BugReports": "https://bugs.r-project.org", - "MailingList": "R-help@r-project.org", - "URL": "https://svn.r-project.org/R-packages/trunk/nlme/", - "NeedsCompilation": "yes", - "Author": "José Pinheiro [aut] (S version), Douglas Bates [aut] (up to 2007), Saikat DebRoy [ctb] (up to 2002), Deepayan Sarkar [ctb] (up to 2005), EISPACK authors [ctb] (src/rs.f), Siem Heisterkamp [ctb] (Author fixed sigma), Bert Van Willigen [ctb] (Programmer fixed sigma), Johannes Ranke [ctb] (varConstProp()), R Core Team [aut, cre] (02zz1nj61)", - "Maintainer": "R Core Team ", - "Repository": "CRAN" - }, - "pillar": { - "Package": "pillar", - "Version": "1.10.2", - "Source": "Repository", - "Title": "Coloured Formatting for Columns", - "Authors@R": "c(person(given = \"Kirill\", family = \"M\\u00fcller\", role = c(\"aut\", \"cre\"), email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(given = \"Hadley\", family = \"Wickham\", role = \"aut\"), person(given = \"RStudio\", role = \"cph\"))", - "Description": "Provides 'pillar' and 'colonnade' generics designed for formatting columns of data using the full range of colours provided by modern terminals.", - "License": "MIT + file LICENSE", - "URL": "https://pillar.r-lib.org/, https://github.com/r-lib/pillar", - "BugReports": "https://github.com/r-lib/pillar/issues", - "Imports": [ - "cli (>= 2.3.0)", - "glue", - "lifecycle", - "rlang (>= 1.0.2)", - "utf8 (>= 1.1.0)", - "utils", - "vctrs (>= 0.5.0)" - ], - "Suggests": [ - "bit64", - "DBI", - "debugme", - "DiagrammeR", - "dplyr", - "formattable", - "ggplot2", - "knitr", - "lubridate", - "nanotime", - "nycflights13", - "palmerpenguins", - "rmarkdown", - "scales", - "stringi", - "survival", - "testthat (>= 3.1.1)", - "tibble", - "units (>= 0.7.2)", - "vdiffr", - "withr" - ], - "VignetteBuilder": "knitr", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2.9000", - "Config/testthat/edition": "3", - "Config/testthat/parallel": "true", - "Config/testthat/start-first": "format_multi_fuzz, format_multi_fuzz_2, format_multi, ctl_colonnade, ctl_colonnade_1, ctl_colonnade_2", - "Config/autostyle/scope": "line_breaks", - "Config/autostyle/strict": "true", - "Config/gha/extra-packages": "units=?ignore-before-r=4.3.0", - "Config/Needs/website": "tidyverse/tidytemplate", - "NeedsCompilation": "no", - "Author": "Kirill Müller [aut, cre] (), Hadley Wickham [aut], RStudio [cph]", - "Maintainer": "Kirill Müller ", - "Repository": "CRAN" - }, - "pkgconfig": { - "Package": "pkgconfig", - "Version": "2.0.3", - "Source": "Repository", - "Title": "Private Configuration for 'R' Packages", - "Author": "Gábor Csárdi", - "Maintainer": "Gábor Csárdi ", - "Description": "Set configuration options on a per-package basis. Options set by a given package only apply to that package, other packages are unaffected.", - "License": "MIT + file LICENSE", - "LazyData": "true", - "Imports": [ - "utils" - ], - "Suggests": [ - "covr", - "testthat", - "disposables (>= 1.0.3)" - ], - "URL": "https://github.com/r-lib/pkgconfig#readme", - "BugReports": "https://github.com/r-lib/pkgconfig/issues", - "Encoding": "UTF-8", - "NeedsCompilation": "no", - "Repository": "CRAN" - }, - "rbibutils": { - "Package": "rbibutils", - "Version": "2.3", - "Source": "Repository", - "Type": "Package", - "Title": "Read 'Bibtex' Files and Convert Between Bibliography Formats", - "Authors@R": "c( person(given = c(\"Georgi\", \"N.\"), family = \"Boshnakov\", role = c(\"aut\", \"cre\"), \t email = \"georgi.boshnakov@manchester.ac.uk\", comment = \"R port, R code, new C code and modifications to bibutils' C code, conversion to Bibentry (R and C code)\" ), person(given = \"Chris\", family = \"Putman\", role = \"aut\", comment = \"src/*, author of the bibutils libraries, https://sourceforge.net/projects/bibutils/\"), person(given = \"Richard\", family = \"Mathar\", role = \"ctb\", comment = \"src/addsout.c\"), person(given = \"Johannes\", family = \"Wilm\", role = \"ctb\", comment = \"src/biblatexin.c, src/bltypes.c\"), person(\"R Core Team\", role = \"ctb\", comment = \"base R's bibentry and bibstyle implementation\") )", - "Description": "Read and write 'Bibtex' files. Convert between bibliography formats, including 'Bibtex', 'Biblatex', 'PubMed', 'Endnote', and 'Bibentry'. Includes a port of the 'bibutils' utilities by Chris Putnam . Supports all bibliography formats and character encodings implemented in 'bibutils'.", - "License": "GPL-2", - "URL": "https://geobosh.github.io/rbibutils/ (doc), https://github.com/GeoBosh/rbibutils (devel)", - "BugReports": "https://github.com/GeoBosh/rbibutils/issues", - "Depends": [ - "R (>= 2.10)" - ], - "Imports": [ - "utils", - "tools" - ], - "Suggests": [ - "testthat" - ], - "Encoding": "UTF-8", - "NeedsCompilation": "yes", - "Config/Needs/memcheck": "devtools, rcmdcheck", - "Author": "Georgi N. Boshnakov [aut, cre] (R port, R code, new C code and modifications to bibutils' C code, conversion to Bibentry (R and C code)), Chris Putman [aut] (src/*, author of the bibutils libraries, https://sourceforge.net/projects/bibutils/), Richard Mathar [ctb] (src/addsout.c), Johannes Wilm [ctb] (src/biblatexin.c, src/bltypes.c), R Core Team [ctb] (base R's bibentry and bibstyle implementation)", - "Maintainer": "Georgi N. Boshnakov ", - "Repository": "CRAN" - }, - "renv": { - "Package": "renv", - "Version": "1.1.4", - "Source": "Repository", - "Type": "Package", - "Title": "Project Environments", - "Authors@R": "c( person(\"Kevin\", \"Ushey\", role = c(\"aut\", \"cre\"), email = \"kevin@rstudio.com\", comment = c(ORCID = \"0000-0003-2880-7407\")), person(\"Hadley\", \"Wickham\", role = c(\"aut\"), email = \"hadley@rstudio.com\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "A dependency management toolkit for R. Using 'renv', you can create and manage project-local R libraries, save the state of these libraries to a 'lockfile', and later restore your library as required. Together, these tools can help make your projects more isolated, portable, and reproducible.", - "License": "MIT + file LICENSE", - "URL": "https://rstudio.github.io/renv/, https://github.com/rstudio/renv", - "BugReports": "https://github.com/rstudio/renv/issues", - "Imports": [ - "utils" - ], - "Suggests": [ - "BiocManager", - "cli", - "compiler", - "covr", - "cpp11", - "devtools", - "gitcreds", - "jsonlite", - "jsonvalidate", - "knitr", - "miniUI", - "modules", - "packrat", - "pak", - "R6", - "remotes", - "reticulate", - "rmarkdown", - "rstudioapi", - "shiny", - "testthat", - "uuid", - "waldo", - "yaml", - "webfakes" - ], - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2", - "VignetteBuilder": "knitr", - "Config/Needs/website": "tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Config/testthat/parallel": "true", - "Config/testthat/start-first": "bioconductor,python,install,restore,snapshot,retrieve,remotes", - "NeedsCompilation": "no", - "Author": "Kevin Ushey [aut, cre] (), Hadley Wickham [aut] (), Posit Software, PBC [cph, fnd]", - "Maintainer": "Kevin Ushey ", - "Repository": "CRAN" - }, - "rjags": { - "Package": "rjags", - "Version": "4-17", - "Source": "Repository", - "Date": "2025-03-24", - "Title": "Bayesian Graphical Models using MCMC", - "Authors@R": "c(person(\"Martyn\", \"Plummer\", role=c(\"aut\",\"cre\"), email=\"martyn.plummer@gmail.com\"), person(\"Alexey\", \"Stukalov\", role=\"ctb\"), person(\"Matt\", \"Denwood\", role=\"ctb\"))", - "Depends": [ - "R (>= 2.14.0)", - "coda (>= 0.13)" - ], - "SystemRequirements": "JAGS 4.x.y", - "URL": "https://mcmc-jags.sourceforge.io", - "Suggests": [ - "tcltk" - ], - "Description": "Interface to the JAGS MCMC library.", - "License": "GPL (== 2)", - "NeedsCompilation": "yes", - "Author": "Martyn Plummer [aut, cre], Alexey Stukalov [ctb], Matt Denwood [ctb]", - "Maintainer": "Martyn Plummer ", - "Repository": "CRAN" - }, - "rlang": { - "Package": "rlang", - "Version": "1.1.6", - "Source": "Repository", - "Title": "Functions for Base Types and Core R and 'Tidyverse' Features", - "Description": "A toolbox for working with base types, core R features like the condition system, and core 'Tidyverse' features like tidy evaluation.", - "Authors@R": "c( person(\"Lionel\", \"Henry\", ,\"lionel@posit.co\", c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", ,\"hadley@posit.co\", \"aut\"), person(given = \"mikefc\", email = \"mikefc@coolbutuseless.com\", role = \"cph\", comment = \"Hash implementation based on Mike's xxhashlite\"), person(given = \"Yann\", family = \"Collet\", role = \"cph\", comment = \"Author of the embedded xxHash library\"), person(given = \"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", - "License": "MIT + file LICENSE", - "ByteCompile": "true", - "Biarch": "true", - "Depends": [ - "R (>= 3.5.0)" - ], - "Imports": [ - "utils" - ], - "Suggests": [ - "cli (>= 3.1.0)", - "covr", - "crayon", - "desc", - "fs", - "glue", - "knitr", - "magrittr", - "methods", - "pillar", - "pkgload", - "rmarkdown", - "stats", - "testthat (>= 3.2.0)", - "tibble", - "usethis", - "vctrs (>= 0.2.3)", - "withr" - ], - "Enhances": [ - "winch" - ], - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2", - "URL": "https://rlang.r-lib.org, https://github.com/r-lib/rlang", - "BugReports": "https://github.com/r-lib/rlang/issues", - "Config/build/compilation-database": "true", - "Config/testthat/edition": "3", - "Config/Needs/website": "dplyr, tidyverse/tidytemplate", - "NeedsCompilation": "yes", - "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut], mikefc [cph] (Hash implementation based on Mike's xxhashlite), Yann Collet [cph] (Author of the embedded xxHash library), Posit, PBC [cph, fnd]", - "Maintainer": "Lionel Henry ", - "Repository": "CRAN" - }, - "runjags": { - "Package": "runjags", - "Version": "2.2.2-5", - "Source": "Repository", - "Title": "Interface Utilities, Model Templates, Parallel Computing Methods and Additional Distributions for MCMC Models in JAGS", - "Date": "2025-04-09", - "Authors@R": "c(person(\"Matthew\", \"Denwood\", role=c(\"aut\",\"cre\"), email=\"md@sund.ku.dk\"), person(\"Martyn\", \"Plummer\", role=\"cph\", comment=\"Copyright holder of the code in src/distributions/DPar1.*, configure.ac, R/rjags_functions.R, and original copyright holder of some modified code where indicated\"))", - "Description": "User-friendly interface utilities for MCMC models via Just Another Gibbs Sampler (JAGS), facilitating the use of parallel (or distributed) processors for multiple chains, automated control of convergence and sample length diagnostics, and evaluation of the performance of a model using drop-k validation or against simulated data. Template model specifications can be generated using a standard lme4-style formula interface to assist users less familiar with the BUGS syntax. A JAGS extension module provides additional distributions including the Pareto family of distributions, the DuMouchel prior and the half-Cauchy prior.", - "URL": "https://github.com/ku-awdc/runjags", - "BugReports": "https://github.com/ku-awdc/runjags/issues", - "License": "GPL-2", - "Encoding": "UTF-8", - "SystemRequirements": "JAGS >= 4.3.0 (https://mcmc-jags.sourceforge.io/)", - "Depends": [ - "R (>= 2.14.0)" - ], - "Imports": [ - "parallel", - "lattice (>= 0.20-10)", - "coda (>= 0.17-1)", - "stats", - "utils" - ], - "Suggests": [ - "rjags (>= 4-7)", - "modeest", - "testthat (>= 3.0.0)", - "knitr", - "markdown", - "spelling" - ], - "Config/testthat/edition": "3", - "VignetteBuilder": "knitr", - "Language": "en-GB", - "RoxygenNote": "7.3.2", - "NeedsCompilation": "yes", - "Author": "Matthew Denwood [aut, cre], Martyn Plummer [cph] (Copyright holder of the code in src/distributions/DPar1.*, configure.ac, R/rjags_functions.R, and original copyright holder of some modified code where indicated)", - "Maintainer": "Matthew Denwood ", - "Repository": "CRAN" - }, - "scales": { - "Package": "scales", - "Version": "1.4.0", - "Source": "Repository", - "Title": "Scale Functions for Visualization", - "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Dana\", \"Seidel\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", - "Description": "Graphical scales map data to aesthetics, and provide methods for automatically determining breaks and labels for axes and legends.", - "License": "MIT + file LICENSE", - "URL": "https://scales.r-lib.org, https://github.com/r-lib/scales", - "BugReports": "https://github.com/r-lib/scales/issues", - "Depends": [ - "R (>= 4.1)" - ], - "Imports": [ - "cli", - "farver (>= 2.0.3)", - "glue", - "labeling", - "lifecycle", - "R6", - "RColorBrewer", - "rlang (>= 1.1.0)", - "viridisLite" - ], - "Suggests": [ - "bit64", - "covr", - "dichromat", - "ggplot2", - "hms (>= 0.5.0)", - "stringi", - "testthat (>= 3.0.0)" - ], - "Config/Needs/website": "tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Config/usethis/last-upkeep": "2025-04-23", - "Encoding": "UTF-8", - "LazyLoad": "yes", - "RoxygenNote": "7.3.2", - "NeedsCompilation": "no", - "Author": "Hadley Wickham [aut], Thomas Lin Pedersen [cre, aut] (), Dana Seidel [aut], Posit Software, PBC [cph, fnd] (03wc8by49)", - "Maintainer": "Thomas Lin Pedersen ", - "Repository": "CRAN" - }, - "stringi": { - "Package": "stringi", - "Version": "1.8.7", - "Source": "Repository", - "Date": "2025-03-27", - "Title": "Fast and Portable Character String Processing Facilities", - "Description": "A collection of character string/text/natural language processing tools for pattern searching (e.g., with 'Java'-like regular expressions or the 'Unicode' collation algorithm), random string generation, case mapping, string transliteration, concatenation, sorting, padding, wrapping, Unicode normalisation, date-time formatting and parsing, and many more. They are fast, consistent, convenient, and - thanks to 'ICU' (International Components for Unicode) - portable across all locales and platforms. Documentation about 'stringi' is provided via its website at and the paper by Gagolewski (2022, ).", - "URL": "https://stringi.gagolewski.com/, https://github.com/gagolews/stringi, https://icu.unicode.org/", - "BugReports": "https://github.com/gagolews/stringi/issues", - "SystemRequirements": "ICU4C (>= 61, optional)", - "Type": "Package", - "Depends": [ - "R (>= 3.4)" - ], - "Imports": [ - "tools", - "utils", - "stats" - ], - "Biarch": "TRUE", - "License": "file LICENSE", - "Authors@R": "c(person(given = \"Marek\", family = \"Gagolewski\", role = c(\"aut\", \"cre\", \"cph\"), email = \"marek@gagolewski.com\", comment = c(ORCID = \"0000-0003-0637-6028\")), person(given = \"Bartek\", family = \"Tartanus\", role = \"ctb\"), person(\"Unicode, Inc. and others\", role=\"ctb\", comment = \"ICU4C source code, Unicode Character Database\") )", - "RoxygenNote": "7.3.2", - "Encoding": "UTF-8", - "NeedsCompilation": "yes", - "Author": "Marek Gagolewski [aut, cre, cph] (), Bartek Tartanus [ctb], Unicode, Inc. and others [ctb] (ICU4C source code, Unicode Character Database)", - "Maintainer": "Marek Gagolewski ", - "License_is_FOSS": "yes", - "Repository": "CRAN" - }, - "stringr": { - "Package": "stringr", - "Version": "1.5.1", - "Source": "Repository", - "Title": "Simple, Consistent Wrappers for Common String Operations", - "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\", \"cph\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "A consistent, simple and easy to use set of wrappers around the fantastic 'stringi' package. All function and argument names (and positions) are consistent, all functions deal with \"NA\"'s and zero length vectors in the same way, and the output from one function is easy to feed into the input of another.", - "License": "MIT + file LICENSE", - "URL": "https://stringr.tidyverse.org, https://github.com/tidyverse/stringr", - "BugReports": "https://github.com/tidyverse/stringr/issues", - "Depends": [ - "R (>= 3.6)" - ], - "Imports": [ - "cli", - "glue (>= 1.6.1)", - "lifecycle (>= 1.0.3)", - "magrittr", - "rlang (>= 1.0.0)", - "stringi (>= 1.5.3)", - "vctrs (>= 0.4.0)" - ], - "Suggests": [ - "covr", - "dplyr", - "gt", - "htmltools", - "htmlwidgets", - "knitr", - "rmarkdown", - "testthat (>= 3.0.0)", - "tibble" - ], - "VignetteBuilder": "knitr", - "Config/Needs/website": "tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "LazyData": "true", - "RoxygenNote": "7.2.3", - "NeedsCompilation": "no", - "Author": "Hadley Wickham [aut, cre, cph], Posit Software, PBC [cph, fnd]", - "Maintainer": "Hadley Wickham ", - "Repository": "CRAN" - }, - "tibble": { - "Package": "tibble", - "Version": "3.3.0", - "Source": "Repository", - "Title": "Simple Data Frames", - "Authors@R": "c(person(given = \"Kirill\", family = \"M\\u00fcller\", role = c(\"aut\", \"cre\"), email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(given = \"Hadley\", family = \"Wickham\", role = \"aut\", email = \"hadley@rstudio.com\"), person(given = \"Romain\", family = \"Francois\", role = \"ctb\", email = \"romain@r-enthusiasts.com\"), person(given = \"Jennifer\", family = \"Bryan\", role = \"ctb\", email = \"jenny@rstudio.com\"), person(given = \"RStudio\", role = c(\"cph\", \"fnd\")))", - "Description": "Provides a 'tbl_df' class (the 'tibble') with stricter checking and better formatting than the traditional data frame.", - "License": "MIT + file LICENSE", - "URL": "https://tibble.tidyverse.org/, https://github.com/tidyverse/tibble", - "BugReports": "https://github.com/tidyverse/tibble/issues", - "Depends": [ - "R (>= 3.4.0)" - ], - "Imports": [ - "cli", - "lifecycle (>= 1.0.0)", - "magrittr", - "methods", - "pillar (>= 1.8.1)", - "pkgconfig", - "rlang (>= 1.0.2)", - "utils", - "vctrs (>= 0.5.0)" - ], - "Suggests": [ - "bench", - "bit64", - "blob", - "brio", - "callr", - "DiagrammeR", - "dplyr", - "evaluate", - "formattable", - "ggplot2", - "here", - "hms", - "htmltools", - "knitr", - "lubridate", - "nycflights13", - "pkgload", - "purrr", - "rmarkdown", - "stringi", - "testthat (>= 3.0.2)", - "tidyr", - "withr" - ], - "VignetteBuilder": "knitr", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2.9000", - "Config/testthat/edition": "3", - "Config/testthat/parallel": "true", - "Config/testthat/start-first": "vignette-formats, as_tibble, add, invariants", - "Config/autostyle/scope": "line_breaks", - "Config/autostyle/strict": "true", - "Config/autostyle/rmd": "false", - "Config/Needs/website": "tidyverse/tidytemplate", - "NeedsCompilation": "yes", - "Author": "Kirill Müller [aut, cre] (ORCID: ), Hadley Wickham [aut], Romain Francois [ctb], Jennifer Bryan [ctb], RStudio [cph, fnd]", - "Maintainer": "Kirill Müller ", - "Repository": "CRAN" - }, - "utf8": { - "Package": "utf8", - "Version": "1.2.6", - "Source": "Repository", - "Title": "Unicode Text Processing", - "Authors@R": "c(person(given = c(\"Patrick\", \"O.\"), family = \"Perry\", role = c(\"aut\", \"cph\")), person(given = \"Kirill\", family = \"M\\u00fcller\", role = \"cre\", email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(given = \"Unicode, Inc.\", role = c(\"cph\", \"dtc\"), comment = \"Unicode Character Database\"))", - "Description": "Process and print 'UTF-8' encoded international text (Unicode). Input, validate, normalize, encode, format, and display.", - "License": "Apache License (== 2.0) | file LICENSE", - "URL": "https://krlmlr.github.io/utf8/, https://github.com/krlmlr/utf8", - "BugReports": "https://github.com/krlmlr/utf8/issues", - "Depends": [ - "R (>= 2.10)" - ], - "Suggests": [ - "cli", - "covr", - "knitr", - "rlang", - "rmarkdown", - "testthat (>= 3.0.0)", - "withr" - ], - "VignetteBuilder": "knitr, rmarkdown", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2.9000", - "NeedsCompilation": "yes", - "Author": "Patrick O. Perry [aut, cph], Kirill Müller [cre] (ORCID: ), Unicode, Inc. [cph, dtc] (Unicode Character Database)", - "Maintainer": "Kirill Müller ", - "Repository": "CRAN" - }, - "vctrs": { - "Package": "vctrs", - "Version": "0.6.5", - "Source": "Repository", - "Title": "Vector Helpers", - "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = \"aut\"), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = c(\"aut\", \"cre\")), person(\"data.table team\", role = \"cph\", comment = \"Radix sort based on data.table's forder() and their contribution to R's order()\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "Defines new notions of prototype and size that are used to provide tools for consistent and well-founded type-coercion and size-recycling, and are in turn connected to ideas of type- and size-stability useful for analysing function interfaces.", - "License": "MIT + file LICENSE", - "URL": "https://vctrs.r-lib.org/, https://github.com/r-lib/vctrs", - "BugReports": "https://github.com/r-lib/vctrs/issues", - "Depends": [ - "R (>= 3.5.0)" - ], - "Imports": [ - "cli (>= 3.4.0)", - "glue", - "lifecycle (>= 1.0.3)", - "rlang (>= 1.1.0)" - ], - "Suggests": [ - "bit64", - "covr", - "crayon", - "dplyr (>= 0.8.5)", - "generics", - "knitr", - "pillar (>= 1.4.4)", - "pkgdown (>= 2.0.1)", - "rmarkdown", - "testthat (>= 3.0.0)", - "tibble (>= 3.1.3)", - "waldo (>= 0.2.0)", - "withr", - "xml2", - "zeallot" - ], - "VignetteBuilder": "knitr", - "Config/Needs/website": "tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "Language": "en-GB", - "RoxygenNote": "7.2.3", - "NeedsCompilation": "yes", - "Author": "Hadley Wickham [aut], Lionel Henry [aut], Davis Vaughan [aut, cre], data.table team [cph] (Radix sort based on data.table's forder() and their contribution to R's order()), Posit Software, PBC [cph, fnd]", - "Maintainer": "Davis Vaughan ", - "Repository": "CRAN" - }, - "viridisLite": { - "Package": "viridisLite", - "Version": "0.4.2", - "Source": "Repository", - "Type": "Package", - "Title": "Colorblind-Friendly Color Maps (Lite Version)", - "Date": "2023-05-02", - "Authors@R": "c( person(\"Simon\", \"Garnier\", email = \"garnier@njit.edu\", role = c(\"aut\", \"cre\")), person(\"Noam\", \"Ross\", email = \"noam.ross@gmail.com\", role = c(\"ctb\", \"cph\")), person(\"Bob\", \"Rudis\", email = \"bob@rud.is\", role = c(\"ctb\", \"cph\")), person(\"Marco\", \"Sciaini\", email = \"sciaini.marco@gmail.com\", role = c(\"ctb\", \"cph\")), person(\"Antônio Pedro\", \"Camargo\", role = c(\"ctb\", \"cph\")), person(\"Cédric\", \"Scherer\", email = \"scherer@izw-berlin.de\", role = c(\"ctb\", \"cph\")) )", - "Maintainer": "Simon Garnier ", - "Description": "Color maps designed to improve graph readability for readers with common forms of color blindness and/or color vision deficiency. The color maps are also perceptually-uniform, both in regular form and also when converted to black-and-white for printing. This is the 'lite' version of the 'viridis' package that also contains 'ggplot2' bindings for discrete and continuous color and fill scales and can be found at .", - "License": "MIT + file LICENSE", - "Encoding": "UTF-8", - "Depends": [ - "R (>= 2.10)" - ], - "Suggests": [ - "hexbin (>= 1.27.0)", - "ggplot2 (>= 1.0.1)", - "testthat", - "covr" - ], - "URL": "https://sjmgarnier.github.io/viridisLite/, https://github.com/sjmgarnier/viridisLite/", - "BugReports": "https://github.com/sjmgarnier/viridisLite/issues/", - "RoxygenNote": "7.2.3", - "NeedsCompilation": "no", - "Author": "Simon Garnier [aut, cre], Noam Ross [ctb, cph], Bob Rudis [ctb, cph], Marco Sciaini [ctb, cph], Antônio Pedro Camargo [ctb, cph], Cédric Scherer [ctb, cph]", - "Repository": "CRAN" - }, - "withr": { - "Package": "withr", - "Version": "3.0.2", - "Source": "Repository", - "Title": "Run Code 'With' Temporarily Modified Global State", - "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Kirill\", \"Müller\", , \"krlmlr+r@mailbox.org\", role = \"aut\"), person(\"Kevin\", \"Ushey\", , \"kevinushey@gmail.com\", role = \"aut\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Winston\", \"Chang\", role = \"aut\"), person(\"Jennifer\", \"Bryan\", role = \"ctb\"), person(\"Richard\", \"Cotton\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "A set of functions to run code 'with' safely and temporarily modified global state. Many of these functions were originally a part of the 'devtools' package, this provides a simple package with limited dependencies to provide access to these functions.", - "License": "MIT + file LICENSE", - "URL": "https://withr.r-lib.org, https://github.com/r-lib/withr#readme", - "BugReports": "https://github.com/r-lib/withr/issues", - "Depends": [ - "R (>= 3.6.0)" - ], - "Imports": [ - "graphics", - "grDevices" - ], - "Suggests": [ - "callr", - "DBI", - "knitr", - "methods", - "rlang", - "rmarkdown (>= 2.12)", - "RSQLite", - "testthat (>= 3.0.0)" - ], - "VignetteBuilder": "knitr", - "Config/Needs/website": "tidyverse/tidytemplate", - "Config/testthat/edition": "3", - "Encoding": "UTF-8", - "RoxygenNote": "7.3.2", - "Collate": "'aaa.R' 'collate.R' 'connection.R' 'db.R' 'defer-exit.R' 'standalone-defer.R' 'defer.R' 'devices.R' 'local_.R' 'with_.R' 'dir.R' 'env.R' 'file.R' 'language.R' 'libpaths.R' 'locale.R' 'makevars.R' 'namespace.R' 'options.R' 'par.R' 'path.R' 'rng.R' 'seed.R' 'wrap.R' 'sink.R' 'tempfile.R' 'timezone.R' 'torture.R' 'utils.R' 'with.R'", - "NeedsCompilation": "no", - "Author": "Jim Hester [aut], Lionel Henry [aut, cre], Kirill Müller [aut], Kevin Ushey [aut], Hadley Wickham [aut], Winston Chang [aut], Jennifer Bryan [ctb], Richard Cotton [ctb], Posit Software, PBC [cph, fnd]", - "Maintainer": "Lionel Henry ", - "Repository": "CRAN" - } - } -} diff --git a/renv/.gitignore b/renv/.gitignore deleted file mode 100644 index 0ec0cbba..00000000 --- a/renv/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -library/ -local/ -cellar/ -lock/ -python/ -sandbox/ -staging/ diff --git a/renv/activate.R b/renv/activate.R deleted file mode 100644 index 90b251ca..00000000 --- a/renv/activate.R +++ /dev/null @@ -1,1334 +0,0 @@ - -local({ - - # the requested version of renv - version <- "1.1.4" - attr(version, "sha") <- NULL - - # the project directory - project <- Sys.getenv("RENV_PROJECT") - if (!nzchar(project)) - project <- getwd() - - # use start-up diagnostics if enabled - diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") - if (diagnostics) { - start <- Sys.time() - profile <- tempfile("renv-startup-", fileext = ".Rprof") - utils::Rprof(profile) - on.exit({ - utils::Rprof(NULL) - elapsed <- signif(difftime(Sys.time(), start, units = "auto"), digits = 2L) - writeLines(sprintf("- renv took %s to run the autoloader.", format(elapsed))) - writeLines(sprintf("- Profile: %s", profile)) - print(utils::summaryRprof(profile)) - }, add = TRUE) - } - - # figure out whether the autoloader is enabled - enabled <- local({ - - # first, check config option - override <- getOption("renv.config.autoloader.enabled") - if (!is.null(override)) - return(override) - - # if we're being run in a context where R_LIBS is already set, - # don't load -- presumably we're being run as a sub-process and - # the parent process has already set up library paths for us - rcmd <- Sys.getenv("R_CMD", unset = NA) - rlibs <- Sys.getenv("R_LIBS", unset = NA) - if (!is.na(rlibs) && !is.na(rcmd)) - return(FALSE) - - # next, check environment variables - # prefer using the configuration one in the future - envvars <- c( - "RENV_CONFIG_AUTOLOADER_ENABLED", - "RENV_AUTOLOADER_ENABLED", - "RENV_ACTIVATE_PROJECT" - ) - - for (envvar in envvars) { - envval <- Sys.getenv(envvar, unset = NA) - if (!is.na(envval)) - return(tolower(envval) %in% c("true", "t", "1")) - } - - # enable by default - TRUE - - }) - - # bail if we're not enabled - if (!enabled) { - - # if we're not enabled, we might still need to manually load - # the user profile here - profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile") - if (file.exists(profile)) { - cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE") - if (tolower(cfg) %in% c("true", "t", "1")) - sys.source(profile, envir = globalenv()) - } - - return(FALSE) - - } - - # avoid recursion - if (identical(getOption("renv.autoloader.running"), TRUE)) { - warning("ignoring recursive attempt to run renv autoloader") - return(invisible(TRUE)) - } - - # signal that we're loading renv during R startup - options(renv.autoloader.running = TRUE) - on.exit(options(renv.autoloader.running = NULL), add = TRUE) - - # signal that we've consented to use renv - options(renv.consent = TRUE) - - # load the 'utils' package eagerly -- this ensures that renv shims, which - # mask 'utils' packages, will come first on the search path - library(utils, lib.loc = .Library) - - # unload renv if it's already been loaded - if ("renv" %in% loadedNamespaces()) - unloadNamespace("renv") - - # load bootstrap tools - ansify <- function(text) { - if (renv_ansify_enabled()) - renv_ansify_enhanced(text) - else - renv_ansify_default(text) - } - - renv_ansify_enabled <- function() { - - override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA) - if (!is.na(override)) - return(as.logical(override)) - - pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA) - if (identical(pane, "build")) - return(FALSE) - - testthat <- Sys.getenv("TESTTHAT", unset = "false") - if (tolower(testthat) %in% "true") - return(FALSE) - - iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false") - if (tolower(iderun) %in% "false") - return(FALSE) - - TRUE - - } - - renv_ansify_default <- function(text) { - text - } - - renv_ansify_enhanced <- function(text) { - - # R help links - pattern <- "`\\?(renv::(?:[^`])+)`" - replacement <- "`\033]8;;x-r-help:\\1\a?\\1\033]8;;\a`" - text <- gsub(pattern, replacement, text, perl = TRUE) - - # runnable code - pattern <- "`(renv::(?:[^`])+)`" - replacement <- "`\033]8;;x-r-run:\\1\a\\1\033]8;;\a`" - text <- gsub(pattern, replacement, text, perl = TRUE) - - # return ansified text - text - - } - - renv_ansify_init <- function() { - - envir <- renv_envir_self() - if (renv_ansify_enabled()) - assign("ansify", renv_ansify_enhanced, envir = envir) - else - assign("ansify", renv_ansify_default, envir = envir) - - } - - `%||%` <- function(x, y) { - if (is.null(x)) y else x - } - - catf <- function(fmt, ..., appendLF = TRUE) { - - quiet <- getOption("renv.bootstrap.quiet", default = FALSE) - if (quiet) - return(invisible()) - - msg <- sprintf(fmt, ...) - cat(msg, file = stdout(), sep = if (appendLF) "\n" else "") - - invisible(msg) - - } - - header <- function(label, - ..., - prefix = "#", - suffix = "-", - n = min(getOption("width"), 78)) - { - label <- sprintf(label, ...) - n <- max(n - nchar(label) - nchar(prefix) - 2L, 8L) - if (n <= 0) - return(paste(prefix, label)) - - tail <- paste(rep.int(suffix, n), collapse = "") - paste0(prefix, " ", label, " ", tail) - - } - - heredoc <- function(text, leave = 0) { - - # remove leading, trailing whitespace - trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text) - - # split into lines - lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]] - - # compute common indent - indent <- regexpr("[^[:space:]]", lines) - common <- min(setdiff(indent, -1L)) - leave - text <- paste(substring(lines, common), collapse = "\n") - - # substitute in ANSI links for executable renv code - ansify(text) - - } - - bootstrap <- function(version, library) { - - friendly <- renv_bootstrap_version_friendly(version) - section <- header(sprintf("Bootstrapping renv %s", friendly)) - catf(section) - - # attempt to download renv - catf("- Downloading renv ... ", appendLF = FALSE) - withCallingHandlers( - tarball <- renv_bootstrap_download(version), - error = function(err) { - catf("FAILED") - stop("failed to download:\n", conditionMessage(err)) - } - ) - catf("OK") - on.exit(unlink(tarball), add = TRUE) - - # now attempt to install - catf("- Installing renv ... ", appendLF = FALSE) - withCallingHandlers( - status <- renv_bootstrap_install(version, tarball, library), - error = function(err) { - catf("FAILED") - stop("failed to install:\n", conditionMessage(err)) - } - ) - catf("OK") - - # add empty line to break up bootstrapping from normal output - catf("") - - return(invisible()) - } - - renv_bootstrap_tests_running <- function() { - getOption("renv.tests.running", default = FALSE) - } - - renv_bootstrap_repos <- function() { - - # get CRAN repository - cran <- getOption("renv.repos.cran", "https://cloud.r-project.org") - - # check for repos override - repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) - if (!is.na(repos)) { - - # check for RSPM; if set, use a fallback repository for renv - rspm <- Sys.getenv("RSPM", unset = NA) - if (identical(rspm, repos)) - repos <- c(RSPM = rspm, CRAN = cran) - - return(repos) - - } - - # check for lockfile repositories - repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity) - if (!inherits(repos, "error") && length(repos)) - return(repos) - - # retrieve current repos - repos <- getOption("repos") - - # ensure @CRAN@ entries are resolved - repos[repos == "@CRAN@"] <- cran - - # add in renv.bootstrap.repos if set - default <- c(FALLBACK = "https://cloud.r-project.org") - extra <- getOption("renv.bootstrap.repos", default = default) - repos <- c(repos, extra) - - # remove duplicates that might've snuck in - dupes <- duplicated(repos) | duplicated(names(repos)) - repos[!dupes] - - } - - renv_bootstrap_repos_lockfile <- function() { - - lockpath <- Sys.getenv("RENV_PATHS_LOCKFILE", unset = "renv.lock") - if (!file.exists(lockpath)) - return(NULL) - - lockfile <- tryCatch(renv_json_read(lockpath), error = identity) - if (inherits(lockfile, "error")) { - warning(lockfile) - return(NULL) - } - - repos <- lockfile$R$Repositories - if (length(repos) == 0) - return(NULL) - - keys <- vapply(repos, `[[`, "Name", FUN.VALUE = character(1)) - vals <- vapply(repos, `[[`, "URL", FUN.VALUE = character(1)) - names(vals) <- keys - - return(vals) - - } - - renv_bootstrap_download <- function(version) { - - sha <- attr(version, "sha", exact = TRUE) - - methods <- if (!is.null(sha)) { - - # attempting to bootstrap a development version of renv - c( - function() renv_bootstrap_download_tarball(sha), - function() renv_bootstrap_download_github(sha) - ) - - } else { - - # attempting to bootstrap a release version of renv - c( - function() renv_bootstrap_download_tarball(version), - function() renv_bootstrap_download_cran_latest(version), - function() renv_bootstrap_download_cran_archive(version) - ) - - } - - for (method in methods) { - path <- tryCatch(method(), error = identity) - if (is.character(path) && file.exists(path)) - return(path) - } - - stop("All download methods failed") - - } - - renv_bootstrap_download_impl <- function(url, destfile) { - - mode <- "wb" - - # https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17715 - fixup <- - Sys.info()[["sysname"]] == "Windows" && - substring(url, 1L, 5L) == "file:" - - if (fixup) - mode <- "w+b" - - args <- list( - url = url, - destfile = destfile, - mode = mode, - quiet = TRUE - ) - - if ("headers" %in% names(formals(utils::download.file))) { - headers <- renv_bootstrap_download_custom_headers(url) - if (length(headers) && is.character(headers)) - args$headers <- headers - } - - do.call(utils::download.file, args) - - } - - renv_bootstrap_download_custom_headers <- function(url) { - - headers <- getOption("renv.download.headers") - if (is.null(headers)) - return(character()) - - if (!is.function(headers)) - stopf("'renv.download.headers' is not a function") - - headers <- headers(url) - if (length(headers) == 0L) - return(character()) - - if (is.list(headers)) - headers <- unlist(headers, recursive = FALSE, use.names = TRUE) - - ok <- - is.character(headers) && - is.character(names(headers)) && - all(nzchar(names(headers))) - - if (!ok) - stop("invocation of 'renv.download.headers' did not return a named character vector") - - headers - - } - - renv_bootstrap_download_cran_latest <- function(version) { - - spec <- renv_bootstrap_download_cran_latest_find(version) - type <- spec$type - repos <- spec$repos - - baseurl <- utils::contrib.url(repos = repos, type = type) - ext <- if (identical(type, "source")) - ".tar.gz" - else if (Sys.info()[["sysname"]] == "Windows") - ".zip" - else - ".tgz" - name <- sprintf("renv_%s%s", version, ext) - url <- paste(baseurl, name, sep = "/") - - destfile <- file.path(tempdir(), name) - status <- tryCatch( - renv_bootstrap_download_impl(url, destfile), - condition = identity - ) - - if (inherits(status, "condition")) - return(FALSE) - - # report success and return - destfile - - } - - renv_bootstrap_download_cran_latest_find <- function(version) { - - # check whether binaries are supported on this system - binary <- - getOption("renv.bootstrap.binary", default = TRUE) && - !identical(.Platform$pkgType, "source") && - !identical(getOption("pkgType"), "source") && - Sys.info()[["sysname"]] %in% c("Darwin", "Windows") - - types <- c(if (binary) "binary", "source") - - # iterate over types + repositories - for (type in types) { - for (repos in renv_bootstrap_repos()) { - - # build arguments for utils::available.packages() call - args <- list(type = type, repos = repos) - - # add custom headers if available -- note that - # utils::available.packages() will pass this to download.file() - if ("headers" %in% names(formals(utils::download.file))) { - headers <- renv_bootstrap_download_custom_headers(repos) - if (length(headers) && is.character(headers)) - args$headers <- headers - } - - # retrieve package database - db <- tryCatch( - as.data.frame( - do.call(utils::available.packages, args), - stringsAsFactors = FALSE - ), - error = identity - ) - - if (inherits(db, "error")) - next - - # check for compatible entry - entry <- db[db$Package %in% "renv" & db$Version %in% version, ] - if (nrow(entry) == 0) - next - - # found it; return spec to caller - spec <- list(entry = entry, type = type, repos = repos) - return(spec) - - } - } - - # if we got here, we failed to find renv - fmt <- "renv %s is not available from your declared package repositories" - stop(sprintf(fmt, version)) - - } - - renv_bootstrap_download_cran_archive <- function(version) { - - name <- sprintf("renv_%s.tar.gz", version) - repos <- renv_bootstrap_repos() - urls <- file.path(repos, "src/contrib/Archive/renv", name) - destfile <- file.path(tempdir(), name) - - for (url in urls) { - - status <- tryCatch( - renv_bootstrap_download_impl(url, destfile), - condition = identity - ) - - if (identical(status, 0L)) - return(destfile) - - } - - return(FALSE) - - } - - renv_bootstrap_download_tarball <- function(version) { - - # if the user has provided the path to a tarball via - # an environment variable, then use it - tarball <- Sys.getenv("RENV_BOOTSTRAP_TARBALL", unset = NA) - if (is.na(tarball)) - return() - - # allow directories - if (dir.exists(tarball)) { - name <- sprintf("renv_%s.tar.gz", version) - tarball <- file.path(tarball, name) - } - - # bail if it doesn't exist - if (!file.exists(tarball)) { - - # let the user know we weren't able to honour their request - fmt <- "- RENV_BOOTSTRAP_TARBALL is set (%s) but does not exist." - msg <- sprintf(fmt, tarball) - warning(msg) - - # bail - return() - - } - - catf("- Using local tarball '%s'.", tarball) - tarball - - } - - renv_bootstrap_github_token <- function() { - for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) { - envval <- Sys.getenv(envvar, unset = NA) - if (!is.na(envval)) - return(envval) - } - } - - renv_bootstrap_download_github <- function(version) { - - enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") - if (!identical(enabled, "TRUE")) - return(FALSE) - - # prepare download options - token <- renv_bootstrap_github_token() - if (is.null(token)) - token <- "" - - if (nzchar(Sys.which("curl")) && nzchar(token)) { - fmt <- "--location --fail --header \"Authorization: token %s\"" - extra <- sprintf(fmt, token) - saved <- options("download.file.method", "download.file.extra") - options(download.file.method = "curl", download.file.extra = extra) - on.exit(do.call(base::options, saved), add = TRUE) - } else if (nzchar(Sys.which("wget")) && nzchar(token)) { - fmt <- "--header=\"Authorization: token %s\"" - extra <- sprintf(fmt, token) - saved <- options("download.file.method", "download.file.extra") - options(download.file.method = "wget", download.file.extra = extra) - on.exit(do.call(base::options, saved), add = TRUE) - } - - url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version) - name <- sprintf("renv_%s.tar.gz", version) - destfile <- file.path(tempdir(), name) - - status <- tryCatch( - renv_bootstrap_download_impl(url, destfile), - condition = identity - ) - - if (!identical(status, 0L)) - return(FALSE) - - renv_bootstrap_download_augment(destfile) - - return(destfile) - - } - - # Add Sha to DESCRIPTION. This is stop gap until #890, after which we - # can use renv::install() to fully capture metadata. - renv_bootstrap_download_augment <- function(destfile) { - sha <- renv_bootstrap_git_extract_sha1_tar(destfile) - if (is.null(sha)) { - return() - } - - # Untar - tempdir <- tempfile("renv-github-") - on.exit(unlink(tempdir, recursive = TRUE), add = TRUE) - untar(destfile, exdir = tempdir) - pkgdir <- dir(tempdir, full.names = TRUE)[[1]] - - # Modify description - desc_path <- file.path(pkgdir, "DESCRIPTION") - desc_lines <- readLines(desc_path) - remotes_fields <- c( - "RemoteType: github", - "RemoteHost: api.github.com", - "RemoteRepo: renv", - "RemoteUsername: rstudio", - "RemotePkgRef: rstudio/renv", - paste("RemoteRef: ", sha), - paste("RemoteSha: ", sha) - ) - writeLines(c(desc_lines[desc_lines != ""], remotes_fields), con = desc_path) - - # Re-tar - local({ - old <- setwd(tempdir) - on.exit(setwd(old), add = TRUE) - - tar(destfile, compression = "gzip") - }) - invisible() - } - - # Extract the commit hash from a git archive. Git archives include the SHA1 - # hash as the comment field of the tarball pax extended header - # (see https://www.kernel.org/pub/software/scm/git/docs/git-archive.html) - # For GitHub archives this should be the first header after the default one - # (512 byte) header. - renv_bootstrap_git_extract_sha1_tar <- function(bundle) { - - # open the bundle for reading - # We use gzcon for everything because (from ?gzcon) - # > Reading from a connection which does not supply a 'gzip' magic - # > header is equivalent to reading from the original connection - conn <- gzcon(file(bundle, open = "rb", raw = TRUE)) - on.exit(close(conn)) - - # The default pax header is 512 bytes long and the first pax extended header - # with the comment should be 51 bytes long - # `52 comment=` (11 chars) + 40 byte SHA1 hash - len <- 0x200 + 0x33 - res <- rawToChar(readBin(conn, "raw", n = len)[0x201:len]) - - if (grepl("^52 comment=", res)) { - sub("52 comment=", "", res) - } else { - NULL - } - } - - renv_bootstrap_install <- function(version, tarball, library) { - - # attempt to install it into project library - dir.create(library, showWarnings = FALSE, recursive = TRUE) - output <- renv_bootstrap_install_impl(library, tarball) - - # check for successful install - status <- attr(output, "status") - if (is.null(status) || identical(status, 0L)) - return(status) - - # an error occurred; report it - header <- "installation of renv failed" - lines <- paste(rep.int("=", nchar(header)), collapse = "") - text <- paste(c(header, lines, output), collapse = "\n") - stop(text) - - } - - renv_bootstrap_install_impl <- function(library, tarball) { - - # invoke using system2 so we can capture and report output - bin <- R.home("bin") - exe <- if (Sys.info()[["sysname"]] == "Windows") "R.exe" else "R" - R <- file.path(bin, exe) - - args <- c( - "--vanilla", "CMD", "INSTALL", "--no-multiarch", - "-l", shQuote(path.expand(library)), - shQuote(path.expand(tarball)) - ) - - system2(R, args, stdout = TRUE, stderr = TRUE) - - } - - renv_bootstrap_platform_prefix_default <- function() { - - # read version component - version <- Sys.getenv("RENV_PATHS_VERSION", unset = "R-%v") - - # expand placeholders - placeholders <- list( - list("%v", format(getRversion()[1, 1:2])), - list("%V", format(getRversion()[1, 1:3])) - ) - - for (placeholder in placeholders) - version <- gsub(placeholder[[1L]], placeholder[[2L]], version, fixed = TRUE) - - # include SVN revision for development versions of R - # (to avoid sharing platform-specific artefacts with released versions of R) - devel <- - identical(R.version[["status"]], "Under development (unstable)") || - identical(R.version[["nickname"]], "Unsuffered Consequences") - - if (devel) - version <- paste(version, R.version[["svn rev"]], sep = "-r") - - version - - } - - renv_bootstrap_platform_prefix <- function() { - - # construct version prefix - version <- renv_bootstrap_platform_prefix_default() - - # build list of path components - components <- c(version, R.version$platform) - - # include prefix if provided by user - prefix <- renv_bootstrap_platform_prefix_impl() - if (!is.na(prefix) && nzchar(prefix)) - components <- c(prefix, components) - - # build prefix - paste(components, collapse = "/") - - } - - renv_bootstrap_platform_prefix_impl <- function() { - - # if an explicit prefix has been supplied, use it - prefix <- Sys.getenv("RENV_PATHS_PREFIX", unset = NA) - if (!is.na(prefix)) - return(prefix) - - # if the user has requested an automatic prefix, generate it - auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) - if (is.na(auto) && getRversion() >= "4.4.0") - auto <- "TRUE" - - if (auto %in% c("TRUE", "True", "true", "1")) - return(renv_bootstrap_platform_prefix_auto()) - - # empty string on failure - "" - - } - - renv_bootstrap_platform_prefix_auto <- function() { - - prefix <- tryCatch(renv_bootstrap_platform_os(), error = identity) - if (inherits(prefix, "error") || prefix %in% "unknown") { - - msg <- paste( - "failed to infer current operating system", - "please file a bug report at https://github.com/rstudio/renv/issues", - sep = "; " - ) - - warning(msg) - - } - - prefix - - } - - renv_bootstrap_platform_os <- function() { - - sysinfo <- Sys.info() - sysname <- sysinfo[["sysname"]] - - # handle Windows + macOS up front - if (sysname == "Windows") - return("windows") - else if (sysname == "Darwin") - return("macos") - - # check for os-release files - for (file in c("/etc/os-release", "/usr/lib/os-release")) - if (file.exists(file)) - return(renv_bootstrap_platform_os_via_os_release(file, sysinfo)) - - # check for redhat-release files - if (file.exists("/etc/redhat-release")) - return(renv_bootstrap_platform_os_via_redhat_release()) - - "unknown" - - } - - renv_bootstrap_platform_os_via_os_release <- function(file, sysinfo) { - - # read /etc/os-release - release <- utils::read.table( - file = file, - sep = "=", - quote = c("\"", "'"), - col.names = c("Key", "Value"), - comment.char = "#", - stringsAsFactors = FALSE - ) - - vars <- as.list(release$Value) - names(vars) <- release$Key - - # get os name - os <- tolower(sysinfo[["sysname"]]) - - # read id - id <- "unknown" - for (field in c("ID", "ID_LIKE")) { - if (field %in% names(vars) && nzchar(vars[[field]])) { - id <- vars[[field]] - break - } - } - - # read version - version <- "unknown" - for (field in c("UBUNTU_CODENAME", "VERSION_CODENAME", "VERSION_ID", "BUILD_ID")) { - if (field %in% names(vars) && nzchar(vars[[field]])) { - version <- vars[[field]] - break - } - } - - # join together - paste(c(os, id, version), collapse = "-") - - } - - renv_bootstrap_platform_os_via_redhat_release <- function() { - - # read /etc/redhat-release - contents <- readLines("/etc/redhat-release", warn = FALSE) - - # infer id - id <- if (grepl("centos", contents, ignore.case = TRUE)) - "centos" - else if (grepl("redhat", contents, ignore.case = TRUE)) - "redhat" - else - "unknown" - - # try to find a version component (very hacky) - version <- "unknown" - - parts <- strsplit(contents, "[[:space:]]")[[1L]] - for (part in parts) { - - nv <- tryCatch(numeric_version(part), error = identity) - if (inherits(nv, "error")) - next - - version <- nv[1, 1] - break - - } - - paste(c("linux", id, version), collapse = "-") - - } - - renv_bootstrap_library_root_name <- function(project) { - - # use project name as-is if requested - asis <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT_ASIS", unset = "FALSE") - if (asis) - return(basename(project)) - - # otherwise, disambiguate based on project's path - id <- substring(renv_bootstrap_hash_text(project), 1L, 8L) - paste(basename(project), id, sep = "-") - - } - - renv_bootstrap_library_root <- function(project) { - - prefix <- renv_bootstrap_profile_prefix() - - path <- Sys.getenv("RENV_PATHS_LIBRARY", unset = NA) - if (!is.na(path)) - return(paste(c(path, prefix), collapse = "/")) - - path <- renv_bootstrap_library_root_impl(project) - if (!is.null(path)) { - name <- renv_bootstrap_library_root_name(project) - return(paste(c(path, prefix, name), collapse = "/")) - } - - renv_bootstrap_paths_renv("library", project = project) - - } - - renv_bootstrap_library_root_impl <- function(project) { - - root <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT", unset = NA) - if (!is.na(root)) - return(root) - - type <- renv_bootstrap_project_type(project) - if (identical(type, "package")) { - userdir <- renv_bootstrap_user_dir() - return(file.path(userdir, "library")) - } - - } - - renv_bootstrap_validate_version <- function(version, description = NULL) { - - # resolve description file - # - # avoid passing lib.loc to `packageDescription()` below, since R will - # use the loaded version of the package by default anyhow. note that - # this function should only be called after 'renv' is loaded - # https://github.com/rstudio/renv/issues/1625 - description <- description %||% packageDescription("renv") - - # check whether requested version 'version' matches loaded version of renv - sha <- attr(version, "sha", exact = TRUE) - valid <- if (!is.null(sha)) - renv_bootstrap_validate_version_dev(sha, description) - else - renv_bootstrap_validate_version_release(version, description) - - if (valid) - return(TRUE) - - # the loaded version of renv doesn't match the requested version; - # give the user instructions on how to proceed - dev <- identical(description[["RemoteType"]], "github") - remote <- if (dev) - paste("rstudio/renv", description[["RemoteSha"]], sep = "@") - else - paste("renv", description[["Version"]], sep = "@") - - # display both loaded version + sha if available - friendly <- renv_bootstrap_version_friendly( - version = description[["Version"]], - sha = if (dev) description[["RemoteSha"]] - ) - - fmt <- heredoc(" - renv %1$s was loaded from project library, but this project is configured to use renv %2$s. - - Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile. - - Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library. - ") - catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) - - FALSE - - } - - renv_bootstrap_validate_version_dev <- function(version, description) { - - expected <- description[["RemoteSha"]] - if (!is.character(expected)) - return(FALSE) - - pattern <- sprintf("^\\Q%s\\E", version) - grepl(pattern, expected, perl = TRUE) - - } - - renv_bootstrap_validate_version_release <- function(version, description) { - expected <- description[["Version"]] - is.character(expected) && identical(expected, version) - } - - renv_bootstrap_hash_text <- function(text) { - - hashfile <- tempfile("renv-hash-") - on.exit(unlink(hashfile), add = TRUE) - - writeLines(text, con = hashfile) - tools::md5sum(hashfile) - - } - - renv_bootstrap_load <- function(project, libpath, version) { - - # try to load renv from the project library - if (!requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) - return(FALSE) - - # warn if the version of renv loaded does not match - renv_bootstrap_validate_version(version) - - # execute renv load hooks, if any - hooks <- getHook("renv::autoload") - for (hook in hooks) - if (is.function(hook)) - tryCatch(hook(), error = warnify) - - # load the project - renv::load(project) - - TRUE - - } - - renv_bootstrap_profile_load <- function(project) { - - # if RENV_PROFILE is already set, just use that - profile <- Sys.getenv("RENV_PROFILE", unset = NA) - if (!is.na(profile) && nzchar(profile)) - return(profile) - - # check for a profile file (nothing to do if it doesn't exist) - path <- renv_bootstrap_paths_renv("profile", profile = FALSE, project = project) - if (!file.exists(path)) - return(NULL) - - # read the profile, and set it if it exists - contents <- readLines(path, warn = FALSE) - if (length(contents) == 0L) - return(NULL) - - # set RENV_PROFILE - profile <- contents[[1L]] - if (!profile %in% c("", "default")) - Sys.setenv(RENV_PROFILE = profile) - - profile - - } - - renv_bootstrap_profile_prefix <- function() { - profile <- renv_bootstrap_profile_get() - if (!is.null(profile)) - return(file.path("profiles", profile, "renv")) - } - - renv_bootstrap_profile_get <- function() { - profile <- Sys.getenv("RENV_PROFILE", unset = "") - renv_bootstrap_profile_normalize(profile) - } - - renv_bootstrap_profile_set <- function(profile) { - profile <- renv_bootstrap_profile_normalize(profile) - if (is.null(profile)) - Sys.unsetenv("RENV_PROFILE") - else - Sys.setenv(RENV_PROFILE = profile) - } - - renv_bootstrap_profile_normalize <- function(profile) { - - if (is.null(profile) || profile %in% c("", "default")) - return(NULL) - - profile - - } - - renv_bootstrap_path_absolute <- function(path) { - - substr(path, 1L, 1L) %in% c("~", "/", "\\") || ( - substr(path, 1L, 1L) %in% c(letters, LETTERS) && - substr(path, 2L, 3L) %in% c(":/", ":\\") - ) - - } - - renv_bootstrap_paths_renv <- function(..., profile = TRUE, project = NULL) { - renv <- Sys.getenv("RENV_PATHS_RENV", unset = "renv") - root <- if (renv_bootstrap_path_absolute(renv)) NULL else project - prefix <- if (profile) renv_bootstrap_profile_prefix() - components <- c(root, renv, prefix, ...) - paste(components, collapse = "/") - } - - renv_bootstrap_project_type <- function(path) { - - descpath <- file.path(path, "DESCRIPTION") - if (!file.exists(descpath)) - return("unknown") - - desc <- tryCatch( - read.dcf(descpath, all = TRUE), - error = identity - ) - - if (inherits(desc, "error")) - return("unknown") - - type <- desc$Type - if (!is.null(type)) - return(tolower(type)) - - package <- desc$Package - if (!is.null(package)) - return("package") - - "unknown" - - } - - renv_bootstrap_user_dir <- function() { - dir <- renv_bootstrap_user_dir_impl() - path.expand(chartr("\\", "/", dir)) - } - - renv_bootstrap_user_dir_impl <- function() { - - # use local override if set - override <- getOption("renv.userdir.override") - if (!is.null(override)) - return(override) - - # use R_user_dir if available - tools <- asNamespace("tools") - if (is.function(tools$R_user_dir)) - return(tools$R_user_dir("renv", "cache")) - - # try using our own backfill for older versions of R - envvars <- c("R_USER_CACHE_DIR", "XDG_CACHE_HOME") - for (envvar in envvars) { - root <- Sys.getenv(envvar, unset = NA) - if (!is.na(root)) - return(file.path(root, "R/renv")) - } - - # use platform-specific default fallbacks - if (Sys.info()[["sysname"]] == "Windows") - file.path(Sys.getenv("LOCALAPPDATA"), "R/cache/R/renv") - else if (Sys.info()[["sysname"]] == "Darwin") - "~/Library/Caches/org.R-project.R/R/renv" - else - "~/.cache/R/renv" - - } - - renv_bootstrap_version_friendly <- function(version, shafmt = NULL, sha = NULL) { - sha <- sha %||% attr(version, "sha", exact = TRUE) - parts <- c(version, sprintf(shafmt %||% " [sha: %s]", substring(sha, 1L, 7L))) - paste(parts, collapse = "") - } - - renv_bootstrap_exec <- function(project, libpath, version) { - if (!renv_bootstrap_load(project, libpath, version)) - renv_bootstrap_run(project, libpath, version) - } - - renv_bootstrap_run <- function(project, libpath, version) { - - # perform bootstrap - bootstrap(version, libpath) - - # exit early if we're just testing bootstrap - if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) - return(TRUE) - - # try again to load - if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { - return(renv::load(project = project)) - } - - # failed to download or load renv; warn the user - msg <- c( - "Failed to find an renv installation: the project will not be loaded.", - "Use `renv::activate()` to re-initialize the project." - ) - - warning(paste(msg, collapse = "\n"), call. = FALSE) - - } - - renv_json_read <- function(file = NULL, text = NULL) { - - jlerr <- NULL - - # if jsonlite is loaded, use that instead - if ("jsonlite" %in% loadedNamespaces()) { - - json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity) - if (!inherits(json, "error")) - return(json) - - jlerr <- json - - } - - # otherwise, fall back to the default JSON reader - json <- tryCatch(renv_json_read_default(file, text), error = identity) - if (!inherits(json, "error")) - return(json) - - # report an error - if (!is.null(jlerr)) - stop(jlerr) - else - stop(json) - - } - - renv_json_read_jsonlite <- function(file = NULL, text = NULL) { - text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") - jsonlite::fromJSON(txt = text, simplifyVector = FALSE) - } - - renv_json_read_patterns <- function() { - - list( - - # objects - list("{", "\t\n\tobject(\t\n\t", TRUE), - list("}", "\t\n\t)\t\n\t", TRUE), - - # arrays - list("[", "\t\n\tarray(\t\n\t", TRUE), - list("]", "\n\t\n)\n\t\n", TRUE), - - # maps - list(":", "\t\n\t=\t\n\t", TRUE), - - # newlines - list("\\u000a", "\n", FALSE) - - ) - - } - - renv_json_read_envir <- function() { - - envir <- new.env(parent = emptyenv()) - - envir[["+"]] <- `+` - envir[["-"]] <- `-` - - envir[["object"]] <- function(...) { - result <- list(...) - names(result) <- as.character(names(result)) - result - } - - envir[["array"]] <- list - - envir[["true"]] <- TRUE - envir[["false"]] <- FALSE - envir[["null"]] <- NULL - - envir - - } - - renv_json_read_remap <- function(object, patterns) { - - # repair names if necessary - if (!is.null(names(object))) { - - nms <- names(object) - for (pattern in patterns) - nms <- gsub(pattern[[2L]], pattern[[1L]], nms, fixed = TRUE) - names(object) <- nms - - } - - # repair strings if necessary - if (is.character(object)) { - for (pattern in patterns) - object <- gsub(pattern[[2L]], pattern[[1L]], object, fixed = TRUE) - } - - # recurse for other objects - if (is.recursive(object)) - for (i in seq_along(object)) - object[i] <- list(renv_json_read_remap(object[[i]], patterns)) - - # return remapped object - object - - } - - renv_json_read_default <- function(file = NULL, text = NULL) { - - # read json text - text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") - - # convert into something the R parser will understand - patterns <- renv_json_read_patterns() - transformed <- text - for (pattern in patterns) - transformed <- gsub(pattern[[1L]], pattern[[2L]], transformed, fixed = TRUE) - - # parse it - rfile <- tempfile("renv-json-", fileext = ".R") - on.exit(unlink(rfile), add = TRUE) - writeLines(transformed, con = rfile) - json <- parse(rfile, keep.source = FALSE, srcfile = NULL)[[1L]] - - # evaluate in safe environment - result <- eval(json, envir = renv_json_read_envir()) - - # fix up strings if necessary -- do so only with reversible patterns - patterns <- Filter(function(pattern) pattern[[3L]], patterns) - renv_json_read_remap(result, patterns) - - } - - - # load the renv profile, if any - renv_bootstrap_profile_load(project) - - # construct path to library root - root <- renv_bootstrap_library_root(project) - - # construct library prefix for platform - prefix <- renv_bootstrap_platform_prefix() - - # construct full libpath - libpath <- file.path(root, prefix) - - # run bootstrap code - renv_bootstrap_exec(project, libpath, version) - - invisible() - -}) diff --git a/renv/settings.json b/renv/settings.json deleted file mode 100644 index 5d7bc2fe..00000000 --- a/renv/settings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "bioconductor.version": null, - "external.libraries": [], - "ignored.packages": [], - "package.dependency.fields": [ - "Imports", - "Depends", - "LinkingTo" - ], - "ppm.enabled": null, - "ppm.ignored.urls": [], - "r.version": null, - "snapshot.type": "explicit", - "use.cache": true, - "vcs.ignore.cellar": true, - "vcs.ignore.library": true, - "vcs.ignore.local": true, - "vcs.manage.ignores": true, - "r.rterm.windows": "C:\\Users\\fbart\\.local\\bin\\radian.exe", - "r.rterm.option": ["--no-save", "--no-restore"], - "r.alwaysUseActiveTerminal": false, - "r.bracketedPaste": true, - "r.sessionWatcher": true -} diff --git a/tests/results/summary.models/11.txt b/tests/results/summary.models/11.txt index e5ec597f..86ccd1c5 100644 --- a/tests/results/summary.models/11.txt +++ b/tests/results/summary.models/11.txt @@ -6,13 +6,14 @@ " min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" "" "Robust Bayesian meta-analysis" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"mu 0.164 0.261 -0.079 0.000 0.773 0.00678 0.026 1484 1.002" -"tau 0.094 0.181 0.000 0.000 0.573 0.00289 0.016 3941 1.000" -"PET 0.392 0.528 0.000 0.000 1.646 0.01113 0.021 2256 1.002" -"omega[0,0.05] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.05,0.95] 0.884 0.238 0.173 1.000 1.000 0.00361 0.015 4358 1.000" -"omega[0.95,1] 1.000 0.000 1.000 1.000 1.000 0.00000 0.000 0 1.013" -"The estimates are summarized on the none scale (priors were specified on the none scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" +"Publication bias adjustment summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.333 0.270 0.738" +"Weight functions 0.333 0.253 0.677" +"PET-PEESE 0.333 0.477 1.827" +"" +"Publication bias adjustment models summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.333 0.270 0.738" +"Weight function[two-sided: .1] 0.333 0.253 0.677" +"PET 0.333 0.477 1.827" diff --git a/tests/results/summary.models/15.txt b/tests/results/summary.models/15.txt index 3b005f80..5065ed1f 100644 --- a/tests/results/summary.models/15.txt +++ b/tests/results/summary.models/15.txt @@ -11,14 +11,14 @@ " min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" "" "Robust Bayesian meta-regression" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"intercept -0.007 0.034 -0.097 -0.004 0.047 0.00180 0.052 387 1.002" -"mod_con 0.924 0.023 0.877 0.924 0.970 0.00041 0.018 3267 1.001" -"tau 0.000 0.000 0.000 0.000 0.000 0.00000 NA 0 NA" -"PET 0.079 0.271 0.000 0.000 1.028 0.01908 0.070 220 1.012" -"omega[0,0.025] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.025,0.975] 0.798 0.311 0.077 1.000 1.000 0.00528 0.017 3478 1.001" -"omega[0.975,1] 1.000 0.000 1.000 1.000 1.000 0.00000 0.000 0 1.000" -"The estimates are summarized on the Cohen's d scale (priors were specified on the Cohen's d scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" +"Publication bias adjustment summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.501 1.002" +"Weight functions 0.250 0.372 1.774" +"PET-PEESE 0.250 0.128 0.440" +"" +"Publication bias adjustment models summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.501 1.002" +"Weight function[two-sided: .05] 0.250 0.372 1.774" +"PET 0.250 0.128 0.440" diff --git a/tests/results/summary.models/17.txt b/tests/results/summary.models/17.txt deleted file mode 100644 index 11fba1ec..00000000 --- a/tests/results/summary.models/17.txt +++ /dev/null @@ -1,33 +0,0 @@ -"Call:" -"BiBMA.reg(formula = ~mod_cat, data = df_reg, rescale_priors = 2, " -" algorithm = \"ss\", chains = 2, sample = 1500, burnin = 750, " -" adapt = 750, parallel = TRUE, autofit = FALSE, seed = 1)" -"" -"Bayesian model-averaged meta-analysis (binomial-normal model)" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"intercept 0.647 0.271 0.000 0.669 1.127 0.00981 0.036 775 1.002" -"mod_cat [dif: A] -0.585 0.241 -1.008 -0.600 0.000 0.00731 0.030 1088 1.000" -"mod_cat [dif: B] 0.585 0.241 0.000 0.600 1.008 0.00731 0.030 1088 1.000" -"tau 0.088 0.202 0.000 0.000 0.670 0.00765 0.038 722 1.003" -"pi[1] 0.282 0.070 0.156 0.278 0.430 0.00170 0.024 1717 1.003" -"pi[2] 0.283 0.069 0.158 0.281 0.428 0.00166 0.024 1713 1.000" -"pi[3] 0.259 0.067 0.136 0.256 0.395 0.00156 0.023 1892 1.000" -"pi[4] 0.239 0.064 0.130 0.236 0.376 0.00143 0.023 1969 1.002" -"pi[5] 0.284 0.069 0.161 0.281 0.433 0.00154 0.022 2064 1.000" -"pi[6] 0.449 0.080 0.295 0.447 0.609 0.00179 0.022 2000 1.000" -"pi[7] 0.396 0.076 0.254 0.394 0.558 0.00172 0.023 1964 1.001" -"pi[8] 0.397 0.079 0.257 0.393 0.559 0.00190 0.024 1731 1.004" -"pi[9] 0.419 0.079 0.266 0.418 0.578 0.00174 0.022 2064 1.003" -"pi[10] 0.421 0.078 0.272 0.419 0.580 0.00174 0.022 1986 1.000" -"gamma[1] -0.047 1.007 -1.959 -0.068 1.949 0.02392 0.024 1792 1.000" -"gamma[2] 0.035 0.977 -1.881 0.053 1.968 0.02304 0.024 1798 1.001" -"gamma[3] -0.061 1.024 -2.127 -0.044 1.922 0.02492 0.024 1689 1.000" -"gamma[4] 0.014 0.977 -1.935 0.011 1.882 0.02406 0.025 1663 1.000" -"gamma[5] 0.031 0.988 -1.942 0.039 1.932 0.02274 0.023 1888 1.003" -"gamma[6] 0.028 0.994 -1.927 0.013 2.015 0.02295 0.023 1874 1.006" -"gamma[7] 0.004 1.016 -2.006 0.012 2.001 0.02418 0.024 1768 1.000" -"gamma[8] -0.029 1.011 -2.065 -0.030 1.878 0.02414 0.024 1754 1.001" -"gamma[9] 0.101 1.030 -1.929 0.120 2.016 0.02795 0.027 1355 1.004" -"gamma[10] 0.066 0.965 -1.876 0.092 1.914 0.02256 0.023 1830 1.002" -"The estimates are summarized on the log(OR) scale (priors were specified on the log(OR) scale)." diff --git a/tests/results/summary.models/18.txt b/tests/results/summary.models/18.txt index bf62b7fc..ca97cd1a 100644 --- a/tests/results/summary.models/18.txt +++ b/tests/results/summary.models/18.txt @@ -5,20 +5,20 @@ " min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" "" "Robust Bayesian meta-analysis" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"mu 0.177 0.261 -0.097 0.000 0.760 0.01589 0.061 270 NA" -"tau 0.128 0.207 0.000 0.000 0.692 0.00996 0.048 433 NA" -"PET 0.112 0.319 0.000 0.000 1.133 0.01426 0.045 500 NA" -"PEESE 0.098 0.460 0.000 0.000 1.530 0.02058 0.045 500 NA" -"omega[0,0.025] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.025,0.05] 0.929 0.174 0.348 1.000 1.000 0.00944 0.054 340 NA" -"omega[0.05,0.5] 0.829 0.288 0.129 1.000 1.000 0.01423 0.049 409 NA" -"omega[0.5,0.95] 0.775 0.356 0.033 1.000 1.000 0.01525 0.043 545 NA" -"omega[0.95,0.975] 0.786 0.348 0.033 1.000 1.000 0.01495 0.043 540 NA" -"omega[0.975,1] 0.817 0.339 0.033 1.000 1.000 0.01514 0.045 500 NA" -"rho 0.530 0.285 0.031 0.551 0.972 0.01179 0.041 582 NA" -"gamma[1] 0.014 0.965 -1.755 0.047 1.943 0.04950 0.051 380 NA" -"gamma[2] 0.128 0.955 -1.866 0.143 1.927 0.04271 0.045 500 NA" -"The estimates are summarized on the Cohen's d scale (priors were specified on the Cohen's d scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" +"Publication bias adjustment summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.462 0.859" +"Weight functions 0.250 0.324 1.438" +"PET-PEESE 0.250 0.214 0.817" +"" +"Publication bias adjustment models summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.462 0.859" +"Weight function[two-sided: .05] 0.042 0.038 0.909" +"Weight function[two-sided: .1, .05] 0.042 0.034 0.810" +"Weight function[one-sided: .05] 0.042 0.038 0.909" +"Weight function[one-sided: .05, .025] 0.042 0.042 1.008" +"Weight function[one-sided: .5, .05] 0.042 0.064 1.573" +"Weight function[one-sided: .5, .05, .025] 0.042 0.108 2.785" +"PET 0.125 0.156 1.294" +"PEESE 0.125 0.058 0.431" diff --git a/tests/results/summary.models/2.txt b/tests/results/summary.models/2.txt index 58e2e217..804d02c6 100644 --- a/tests/results/summary.models/2.txt +++ b/tests/results/summary.models/2.txt @@ -5,14 +5,13 @@ " min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" "" "Robust Bayesian meta-analysis" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"mu 0.241 0.281 0.000 0.128 0.838 0.00666 0.024 1783 1.000" -"tau 0.102 0.189 0.000 0.000 0.607 0.00305 0.016 3818 1.000" -"omega[0,0.025] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.025,0.05] 0.791 0.280 0.131 0.994 1.000 0.00490 0.018 3292 1.000" -"omega[0.05,0.95] 0.726 0.327 0.088 0.986 1.000 0.00565 0.017 3364 1.000" -"omega[0.95,0.975] 0.791 0.280 0.131 0.994 1.000 0.00490 0.018 3292 1.000" -"omega[0.975,1] 1.000 0.000 1.000 1.000 1.000 0.00000 0.000 0 1.010" -"The estimates are summarized on the Cohen's d scale (priors were specified on the Cohen's d scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" +"Publication bias adjustment summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.495 0.980" +"Weight functions 0.500 0.505 1.020" +"" +"Publication bias adjustment models summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.495 0.980" +"Weight function[two-sided: .05] 0.250 0.278 1.155" +"Weight function[two-sided: .1, .05] 0.250 0.227 0.881" diff --git a/tests/results/summary.models/4.txt b/tests/results/summary.models/4.txt index 6cd5747d..f5f2c1d8 100644 --- a/tests/results/summary.models/4.txt +++ b/tests/results/summary.models/4.txt @@ -5,17 +5,20 @@ " min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" "" "Robust Bayesian meta-analysis" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"mu 0.180 0.283 -0.103 0.000 0.815 0.00754 0.027 1405 1.000" -"tau 0.117 0.203 0.000 0.000 0.681 0.00381 0.019 2868 1.000" -"PET 0.119 0.390 0.000 0.000 1.370 0.00882 0.023 2451 1.040" -"PEESE 0.092 0.481 0.000 0.000 1.692 0.00748 0.016 4175 1.005" -"omega[0,0.025] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.025,0.05] 0.917 0.193 0.278 1.000 1.000 0.00289 0.015 4461 1.000" -"omega[0.05,0.5] 0.808 0.298 0.107 1.000 1.000 0.00501 0.017 3549 1.000" -"omega[0.5,0.95] 0.742 0.371 0.024 1.000 1.000 0.00651 0.018 3257 1.000" -"omega[0.95,0.975] 0.754 0.363 0.024 1.000 1.000 0.00654 0.018 3130 1.000" -"omega[0.975,1] 0.791 0.355 0.024 1.000 1.000 0.00625 0.018 3270 1.000" -"The estimates are summarized on the Cohen's d scale (priors were specified on the Cohen's d scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" +"Publication bias adjustment summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.447 0.808" +"Weight functions 0.250 0.364 1.718" +"PET-PEESE 0.250 0.189 0.699" +"" +"Publication bias adjustment models summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.447 0.808" +"Weight function[two-sided: .05] 0.042 0.046 1.099" +"Weight function[two-sided: .1, .05] 0.042 0.038 0.899" +"Weight function[one-sided: .05] 0.042 0.043 1.033" +"Weight function[one-sided: .05, .025] 0.042 0.046 1.099" +"Weight function[one-sided: .5, .05] 0.042 0.087 2.203" +"Weight function[one-sided: .5, .05, .025] 0.042 0.105 2.698" +"PET 0.125 0.137 1.115" +"PEESE 0.125 0.052 0.381" diff --git a/tests/results/summary.models/5.txt b/tests/results/summary.models/5.txt index 4fc3f1e5..e0854ffc 100644 --- a/tests/results/summary.models/5.txt +++ b/tests/results/summary.models/5.txt @@ -5,17 +5,20 @@ " min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" "" "Robust Bayesian meta-analysis" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"mu 0.195 0.272 -0.046 0.000 0.788 0.00681 0.025 1603 1.002" -"tau 0.103 0.182 0.000 0.000 0.603 0.00322 0.018 3296 1.000" -"PET 0.129 0.382 0.000 0.000 1.431 0.00693 0.018 3048 1.000" -"PEESE 0.114 0.550 0.000 0.000 2.132 0.00919 0.017 3817 1.037" -"omega[0,0.025] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.025,0.05] 0.913 0.197 0.275 1.000 1.000 0.00303 0.015 4267 1.000" -"omega[0.05,0.5] 0.802 0.302 0.098 1.000 1.000 0.00505 0.017 3564 1.000" -"omega[0.5,0.95] 0.736 0.371 0.027 1.000 1.000 0.00664 0.018 3119 1.000" -"omega[0.95,0.975] 0.747 0.364 0.027 1.000 1.000 0.00657 0.018 3063 1.000" -"omega[0.975,1] 0.787 0.355 0.027 1.000 1.000 0.00617 0.017 3316 1.000" -"The estimates are summarized on the Cohen's d scale (priors were specified on the Cohen's d scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" +"Publication bias adjustment summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.424 0.736" +"Weight functions 0.250 0.378 1.820" +"PET-PEESE 0.250 0.199 0.743" +"" +"Publication bias adjustment models summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.424 0.736" +"Weight function[two-sided: .05] 0.042 0.050 1.221" +"Weight function[two-sided: .1, .05] 0.042 0.038 0.913" +"Weight function[one-sided: .05] 0.042 0.049 1.185" +"Weight function[one-sided: .05, .025] 0.042 0.050 1.205" +"Weight function[one-sided: .5, .05] 0.042 0.084 2.115" +"Weight function[one-sided: .5, .05, .025] 0.042 0.106 2.727" +"PET 0.125 0.143 1.164" +"PEESE 0.125 0.056 0.415" diff --git a/tests/results/summary.models/6.txt b/tests/results/summary.models/6.txt index fa7f2cdb..5891c634 100644 --- a/tests/results/summary.models/6.txt +++ b/tests/results/summary.models/6.txt @@ -5,17 +5,20 @@ " min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" "" "Robust Bayesian meta-analysis" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"mu -0.188 0.282 -0.825 0.000 0.108 0.00660 0.023 1832 1.000" -"tau 0.118 0.202 0.000 0.000 0.660 0.00328 0.016 3794 1.008" -"PET 0.116 0.359 0.000 0.000 1.340 0.00655 0.018 3023 1.000" -"PEESE 0.104 0.512 0.000 0.000 1.923 0.00815 0.016 3941 1.004" -"omega[0,0.025] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.025,0.05] 0.919 0.186 0.327 1.000 1.000 0.00328 0.018 3268 1.000" -"omega[0.05,0.5] 0.816 0.290 0.129 1.000 1.000 0.00491 0.017 3501 1.001" -"omega[0.5,0.95] 0.755 0.364 0.023 1.000 1.000 0.00641 0.018 3223 1.000" -"omega[0.95,0.975] 0.765 0.357 0.023 1.000 1.000 0.00629 0.018 3225 1.000" -"omega[0.975,1] 0.797 0.351 0.023 1.000 1.000 0.00610 0.017 3324 1.000" -"The estimates are summarized on the Cohen's d scale (priors were specified on the Cohen's d scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" +"Publication bias adjustment summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.454 0.830" +"Weight functions 0.250 0.353 1.637" +"PET-PEESE 0.250 0.193 0.719" +"" +"Publication bias adjustment models summary:" +" Prior prob. Post. prob. Inclusion BF" +"None 0.500 0.454 0.830" +"Weight function[two-sided: .05] 0.042 0.043 1.033" +"Weight function[two-sided: .1, .05] 0.042 0.035 0.834" +"Weight function[one-sided: .05] 0.042 0.040 0.953" +"Weight function[one-sided: .05, .025] 0.042 0.050 1.221" +"Weight function[one-sided: .5, .05] 0.042 0.081 2.038" +"Weight function[one-sided: .5, .05, .025] 0.042 0.103 2.652" +"PET 0.125 0.138 1.124" +"PEESE 0.125 0.055 0.407" diff --git a/tests/results/summary.models/7.txt b/tests/results/summary.models/7.txt index ff2b7bda..17afc966 100644 --- a/tests/results/summary.models/7.txt +++ b/tests/results/summary.models/7.txt @@ -8,12 +8,12 @@ " min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" "" "Robust Bayesian meta-analysis" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"mu 0.276 0.330 -0.450 0.296 0.888 0.00841 0.026 1546 1.000" -"tau 0.219 0.208 0.041 0.153 0.785 0.00474 0.023 1930 1.000" -"PET 0.367 0.512 0.000 0.085 1.750 0.01299 0.025 1558 1.000" -"omega[0,0.1] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.1,1] 0.828 0.249 0.207 1.000 1.000 0.00418 0.017 3554 1.000" -"The estimates are summarized on the Cohen's d scale (priors were specified on the Cohen's d scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" +"Publication bias adjustment summary:" +" Prior prob. Post. prob. Inclusion BF" +"Weight functions 0.500 0.450 0.817" +"PET-PEESE 0.500 0.550 1.224" +"" +"Publication bias adjustment models summary:" +" Prior prob. Post. prob. Inclusion BF" +"Weight function[one-sided: .1] 0.500 0.450 0.817" +"PET 0.500 0.550 1.224" diff --git a/tests/results/summary.models/9.txt b/tests/results/summary.models/9.txt deleted file mode 100644 index ebf6f22f..00000000 --- a/tests/results/summary.models/9.txt +++ /dev/null @@ -1,20 +0,0 @@ -"Call:" -"RoBMA(d = d, se = d_se, priors_effect = NULL, priors_heterogeneity = NULL, " -" priors_bias = NULL, priors_effect_null = prior(\"normal\", " -" list(0, 1)), priors_heterogeneity_null = prior(\"invgamma\", " -" list(1, 0.15)), priors_bias_null = list(prior_weightfunction(\"one-sided\", " -" list(c(0.1), c(1, 1))), prior_PET(\"normal\", list(0, 1))), " -" algorithm = \"ss\", chains = 2, sample = 2500, burnin = 1000, " -" adapt = 500, parallel = TRUE, autofit = FALSE, convergence_checks = set_convergence_checks(max_Rhat = 2, " -" min_ESS = 10, max_error = 1, max_SD_error = 1), seed = 1)" -"" -"Robust Bayesian meta-analysis" -"Model-averaged estimates:" -" Mean SD lCI Median uCI error(MCMC) error(MCMC)/SD ESS R-hat" -"mu 0.276 0.330 -0.450 0.296 0.888 0.00841 0.026 1546 1.000" -"tau 0.219 0.208 0.041 0.153 0.785 0.00474 0.023 1930 1.000" -"PET 0.367 0.512 0.000 0.085 1.750 0.01299 0.025 1558 1.000" -"omega[0,0.1] 1.000 0.000 1.000 1.000 1.000 NA NA NA NA" -"omega[0.1,1] 0.828 0.249 0.207 1.000 1.000 0.00418 0.017 3554 1.000" -"The estimates are summarized on the Cohen's d scale (priors were specified on the Cohen's d scale)." -"(Estimated publication weights omega correspond to one-sided p-values.)" diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-1.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-1.svg index eb837550..571de9ac 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-1.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-1.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_1 +ggplot_forest1_1 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-10.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-10.svg index 597e37c5..b1b6b728 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-10.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-10.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_10 +ggplot_forest1_10 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-11.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-11.svg index 82811c90..e667dc56 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-11.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-11.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,19 +68,19 @@ 0.20 [-0.81, 1.22] 0.41 [-0.48, 1.29] 0.63 [ 0.06, 1.20] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 μ -ggplot_forest1_11 +ggplot_forest1_11 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-12.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-12.svg index 5605ab6e..ab68ef46 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-12.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-12.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_12 +ggplot_forest1_12 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-13.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-13.svg index fde05013..ba88117f 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-13.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-13.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_13 +ggplot_forest1_13 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-14.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-14.svg index a0ee7e34..4809f413 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-14.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-14.svg @@ -18,118 +18,118 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + @@ -166,23 +166,23 @@ 1.00 [ 0.80, 1.21] 1.00 [ 0.80, 1.21] 1.00 [ 0.80, 1.21] - - - + + + - - - --1.5 --1 --0.5 + + + +-1.5 +-1 +-0.5 0 -0.5 -1 -1.5 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_14 +ggplot_forest1_14 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-15.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-15.svg index 42c20761..7a7613da 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-15.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-15.svg @@ -18,115 +18,115 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + @@ -162,19 +162,19 @@ 1.12 [ 0.91, 1.33] 1.34 [ 1.13, 1.56] 1.57 [ 1.35, 1.79] - - + + - - --2 --1 + + +-2 +-1 0 -1 -2 +1 +2 Cohen's d -ggplot_forest1_15 +ggplot_forest1_15 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-16.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-16.svg index d68eff4a..39f87c39 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-16.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-16.svg @@ -18,62 +18,62 @@ - + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -88,23 +88,23 @@ -0.81 [-2.64, 1.02] -0.64 [-2.23, 0.95] -0.54 [-1.99, 0.92] - - - - - - - - --5 --4 --3 --2 --1 -0 -1 -2 + + + + + + + + +-5 +-4 +-3 +-2 +-1 +0 +1 +2 logOR -ggplot_forest1_16 +ggplot_forest1_16 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-2.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-2.svg index b776fb5f..41058e30 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-2.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-2.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_2 +ggplot_forest1_2 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-3.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-3.svg index db4a19be..551b438f 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-3.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-3.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_3 +ggplot_forest1_3 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-4.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-4.svg index 6c804527..03082e14 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-4.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-4.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_4 +ggplot_forest1_4 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-5.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-5.svg index c6e859da..53567366 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-5.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-5.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_5 +ggplot_forest1_5 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-6.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-6.svg index a28c622c..cbeb43cf 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-6.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-6.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ -0.20 [-1.43, 0.96] -0.41 [-1.46, 0.55] -0.63 [-1.26, -0.05] - - - - - - --1.5 --1 --0.5 -0 -0.5 -1 + + + + + + +-1.5 +-1 +-0.5 +0 +0.5 +1 Cohen's d -ggplot_forest1_6 +ggplot_forest1_6 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-7.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-7.svg index 8720fbf6..e08ee0af 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-7.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-7.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_7 +ggplot_forest1_7 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-8.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-8.svg index 4460e341..b36f7a96 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-8.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-8.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_8 +ggplot_forest1_8 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest1-9.svg b/tests/testthat/_snaps/06-plots/ggplot-forest1-9.svg index 8af8de15..750615f7 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest1-9.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest1-9.svg @@ -18,46 +18,46 @@ - + - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest1_9 +ggplot_forest1_9 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-1.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-1.svg index 416b04d3..5b2e7cc7 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-1.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-1.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_1 +ggplot_forest2_1 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-10.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-10.svg index 66ad5cba..8c2aefe9 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-10.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-10.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_10 +ggplot_forest2_10 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-11.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-11.svg index da150a82..d15f3bbb 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-11.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-11.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,19 +68,19 @@ 0.20 [-0.81, 1.22] 0.41 [-0.48, 1.29] 0.63 [ 0.06, 1.20] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 μ -ggplot_forest2_11 +ggplot_forest2_11 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-12.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-12.svg index e28d6d9e..acb2ef05 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-12.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-12.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_12 +ggplot_forest2_12 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-13.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-13.svg index cf73ce8f..f075f3f4 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-13.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-13.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_13 +ggplot_forest2_13 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-14.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-14.svg index 61bebda2..312237a7 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-14.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-14.svg @@ -21,116 +21,116 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + @@ -166,23 +166,23 @@ 1.00 [ 0.80, 1.21] 1.00 [ 0.80, 1.21] 1.00 [ 0.80, 1.21] - - - + + + - - - --1.5 --1 --0.5 + + + +-1.5 +-1 +-0.5 0 -0.5 -1 -1.5 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_14 +ggplot_forest2_14 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-15.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-15.svg index 0eab9f3a..0e69739e 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-15.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-15.svg @@ -21,112 +21,112 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + @@ -162,19 +162,19 @@ 1.12 [ 0.91, 1.33] 1.34 [ 1.13, 1.56] 1.57 [ 1.35, 1.79] - - + + - - --2 --1 + + +-2 +-1 0 -1 -2 +1 +2 Cohen's d -ggplot_forest2_15 +ggplot_forest2_15 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-16.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-16.svg index aff8359a..e5c11d99 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-16.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-16.svg @@ -21,59 +21,59 @@ - - + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -88,23 +88,23 @@ -0.81 [-2.64, 1.02] -0.64 [-2.23, 0.95] -0.54 [-1.99, 0.92] - - - - - - - - --5 --4 --3 --2 --1 -0 -1 -2 + + + + + + + + +-5 +-4 +-3 +-2 +-1 +0 +1 +2 logOR -ggplot_forest2_16 +ggplot_forest2_16 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-2.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-2.svg index 55dd7a53..4b7a0bb1 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-2.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-2.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_2 +ggplot_forest2_2 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-3.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-3.svg index b573adfc..a58d0d0e 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-3.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-3.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_3 +ggplot_forest2_3 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-4.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-4.svg index 3dbecb35..d663243e 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-4.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-4.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_4 +ggplot_forest2_4 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-5.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-5.svg index 2c792a0f..d581d577 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-5.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-5.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_5 +ggplot_forest2_5 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-6.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-6.svg index 7bc00bad..0426d2c0 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-6.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-6.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ -0.20 [-1.43, 0.96] -0.41 [-1.46, 0.55] -0.63 [-1.26, -0.05] - - - - - - --1.5 --1 --0.5 -0 -0.5 -1 + + + + + + +-1.5 +-1 +-0.5 +0 +0.5 +1 Cohen's d -ggplot_forest2_6 +ggplot_forest2_6 diff --git a/tests/testthat/_snaps/06-plots/ggplot-forest2-7.svg b/tests/testthat/_snaps/06-plots/ggplot-forest2-7.svg index 7436e725..8fba4b54 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-forest2-7.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-forest2-7.svg @@ -21,43 +21,43 @@ - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Conditional @@ -68,21 +68,21 @@ 0.20 [-0.96, 1.43] 0.41 [-0.55, 1.46] 0.63 [ 0.05, 1.26] - - - - - - --1 --0.5 -0 -0.5 -1 -1.5 + + + + + + +-1 +-0.5 +0 +0.5 +1 +1.5 Cohen's d -ggplot_forest2_7 +ggplot_forest2_7 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models1-1.svg b/tests/testthat/_snaps/06-plots/ggplot-models1-1.svg index f23a7050..bb87b947 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models1-1.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models1-1.svg @@ -18,173 +18,173 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -203,7 +203,7 @@ - + @@ -317,19 +317,19 @@ BF = 0.95 [0.01 -> 0.01] BF = 1.05 [0.01 -> 0.01] BF = 0.58 [0.12 -> 0.08] - - + + - - --1 --0.5 + + +-1 +-0.5 0 -0.5 -1 +0.5 +1 Cohen's d -ggplot_models1_1 +ggplot_models1_1 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models1-10.svg b/tests/testthat/_snaps/06-plots/ggplot-models1-10.svg index 446991a9..843e41a3 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models1-10.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models1-10.svg @@ -18,41 +18,41 @@ - + - - + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -60,25 +60,25 @@ 0.32 [-0.27, 0.84] 0.32 [-0.27, 0.83] BF = Inf [1.00 -> 1.00] - - - - - - - - --0.4 --0.2 -0 -0.2 -0.4 -0.6 -0.8 -1 + + + + + + + + +-0.4 +-0.2 +0 +0.2 +0.4 +0.6 +0.8 +1 Cohen's d -ggplot_models1_10 +ggplot_models1_10 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models1-12.svg b/tests/testthat/_snaps/06-plots/ggplot-models1-12.svg index 0a282237..cfa9c1f1 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models1-12.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models1-12.svg @@ -18,40 +18,40 @@ - + - - + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + Model-Averaged @@ -62,21 +62,21 @@ 0.00 [0.00, 0.00] BF = 6.40 [0.67 -> 0.93] BF = 0.16 [0.33 -> 0.07] - - - - - - -0 -0.2 -0.4 -0.6 -0.8 -1 + + + + + + +0 +0.2 +0.4 +0.6 +0.8 +1 Cohen's d -ggplot_models1_12 +ggplot_models1_12 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models1-13.svg b/tests/testthat/_snaps/06-plots/ggplot-models1-13.svg index 1acf0d77..39dab974 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models1-13.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models1-13.svg @@ -18,173 +18,173 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -203,7 +203,7 @@ - + @@ -317,19 +317,19 @@ BF = 0.94 [0.01 -> 0.01] BF = 1.01 [0.01 -> 0.01] BF = 0.58 [0.12 -> 0.08] - - + + - - --1 --0.5 + + +-1 +-0.5 0 -0.5 -1 +0.5 +1 Cohen's d -ggplot_models1_13 +ggplot_models1_13 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models1-14.svg b/tests/testthat/_snaps/06-plots/ggplot-models1-14.svg index 4e1b9668..ac32e02a 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models1-14.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models1-14.svg @@ -18,100 +18,100 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + @@ -169,23 +169,23 @@ BF = 0.00 [0.06 -> 0.00] BF = 0.00 [0.06 -> 0.00] BF = 0.00 [0.06 -> 0.00] - - - + + + - - - --0.6 --0.4 --0.2 + + + +-0.6 +-0.4 +-0.2 0 -0.2 -0.4 -0.6 +0.2 +0.4 +0.6 Cohen's d -ggplot_models1_14 +ggplot_models1_14 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models1-16.svg b/tests/testthat/_snaps/06-plots/ggplot-models1-16.svg index de884fe6..fa6e9a75 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models1-16.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models1-16.svg @@ -18,47 +18,47 @@ - + - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + Model-Averaged @@ -75,17 +75,17 @@ BF = 1.90 [0.25 -> 0.39] BF = 0.52 [0.25 -> 0.15] BF = 0.74 [0.25 -> 0.20] - - + + - - --1.5 --1 + + +-1.5 +-1 -0.5 -0 -0.5 +0 +0.5 logOR -ggplot_models1_16 +ggplot_models1_16 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models1-3.svg b/tests/testthat/_snaps/06-plots/ggplot-models1-3.svg index 9ee4daa3..e159c2c4 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models1-3.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models1-3.svg @@ -18,82 +18,82 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -135,19 +135,19 @@ BF = 0.69 [0.06 -> 0.04] BF = 2.08 [0.06 -> 0.12] BF = 0.71 [0.12 -> 0.09] - - + + - - --1 --0.5 + + +-1 +-0.5 0 -0.5 -1 +0.5 +1 Cohen's d -ggplot_models1_3 +ggplot_models1_3 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models1-8.svg b/tests/testthat/_snaps/06-plots/ggplot-models1-8.svg index 29936a67..889cb2ba 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models1-8.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models1-8.svg @@ -18,26 +18,26 @@ - + - - + + - - - - - + + + + + - - - - - - - + + + + + + + Model-Averaged @@ -45,13 +45,13 @@ 0.00 [0.00, 0.00] 0.00 [0.00, 0.00] BF = Inf [1.00 -> 1.00] - - --1 -0 + + +-1 +0 Cohen's d -ggplot_models1_8 +ggplot_models1_8 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models2-1.svg b/tests/testthat/_snaps/06-plots/ggplot-models2-1.svg index d30fc143..59fa7758 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models2-1.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models2-1.svg @@ -18,138 +18,138 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -209,19 +209,19 @@ BF = 0.96 [0.01 -> 0.01] BF = 1.27 [0.01 -> 0.01] BF = 1.45 [0.12 -> 0.17] - - + + - - --1 --0.5 + + +-1 +-0.5 0 -0.5 -1 +0.5 +1 Cohen's d -ggplot_models2_1 +ggplot_models2_1 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models2-10.svg b/tests/testthat/_snaps/06-plots/ggplot-models2-10.svg index 8cbabda5..beb2d649 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models2-10.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models2-10.svg @@ -18,41 +18,41 @@ - + - - + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + Model-Averaged @@ -60,25 +60,25 @@ 0.32 [-0.27, 0.84] 0.32 [-0.27, 0.83] BF = Inf [1.00 -> 1.00] - - - - - - - - --0.4 --0.2 -0 -0.2 -0.4 -0.6 -0.8 -1 + + + + + + + + +-0.4 +-0.2 +0 +0.2 +0.4 +0.6 +0.8 +1 Cohen's d -ggplot_models2_10 +ggplot_models2_10 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models2-12.svg b/tests/testthat/_snaps/06-plots/ggplot-models2-12.svg index ab1be8ce..4f42f54f 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models2-12.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models2-12.svg @@ -18,37 +18,37 @@ - + - - + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Model-Averaged @@ -56,21 +56,21 @@ 0.49 [0.10, 0.91] 0.49 [0.10, 0.90] BF = 6.40 [0.67 -> 0.93] - - - - - - -0 -0.2 -0.4 -0.6 -0.8 -1 + + + + + + +0 +0.2 +0.4 +0.6 +0.8 +1 Cohen's d -ggplot_models2_12 +ggplot_models2_12 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models2-13.svg b/tests/testthat/_snaps/06-plots/ggplot-models2-13.svg index 70d7fa87..67add787 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models2-13.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models2-13.svg @@ -18,138 +18,138 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -209,19 +209,19 @@ BF = 0.95 [0.01 -> 0.01] BF = 1.28 [0.01 -> 0.01] BF = 1.42 [0.12 -> 0.17] - - + + - - --1 --0.5 + + +-1 +-0.5 0 -0.5 -1 +0.5 +1 Cohen's d -ggplot_models2_13 +ggplot_models2_13 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models2-14.svg b/tests/testthat/_snaps/06-plots/ggplot-models2-14.svg index 59bf1084..5cd0788d 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models2-14.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models2-14.svg @@ -18,80 +18,80 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + @@ -121,23 +121,23 @@ BF = 0.18 [0.06 -> 0.01] BF = 0.00 [0.06 -> 0.00] BF = 0.00 [0.06 -> 0.00] - - - + + + - - - --0.6 --0.4 --0.2 + + + +-0.6 +-0.4 +-0.2 0 -0.2 -0.4 -0.6 +0.2 +0.4 +0.6 Cohen's d -ggplot_models2_14 +ggplot_models2_14 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models2-16.svg b/tests/testthat/_snaps/06-plots/ggplot-models2-16.svg index c5ae1482..e2f4ce56 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models2-16.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models2-16.svg @@ -18,41 +18,41 @@ - + - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + Model-Averaged @@ -63,17 +63,17 @@ -0.57 [-1.28, 0.09] BF = 1.09 [0.25 -> 0.27] BF = 1.90 [0.25 -> 0.39] - - + + - - --1.5 --1 + + +-1.5 +-1 -0.5 -0 -0.5 +0 +0.5 logOR -ggplot_models2_16 +ggplot_models2_16 diff --git a/tests/testthat/_snaps/06-plots/ggplot-models2-3.svg b/tests/testthat/_snaps/06-plots/ggplot-models2-3.svg index 1a49116d..2a504c0a 100644 --- a/tests/testthat/_snaps/06-plots/ggplot-models2-3.svg +++ b/tests/testthat/_snaps/06-plots/ggplot-models2-3.svg @@ -18,64 +18,64 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -99,19 +99,19 @@ BF = 0.35 [0.06 -> 0.02] BF = 0.95 [0.06 -> 0.06] BF = 1.81 [0.12 -> 0.21] - - + + - - --1 --0.5 + + +-1 +-0.5 0 -0.5 -1 +0.5 +1 Cohen's d -ggplot_models2_3 +ggplot_models2_3 diff --git a/tests/testthat/_snaps/11-zcurve/plot-zcurve-1.svg b/tests/testthat/_snaps/11-zcurve/plot-zcurve-1.svg index 6011f73a..0dc1add1 100644 --- a/tests/testthat/_snaps/11-zcurve/plot-zcurve-1.svg +++ b/tests/testthat/_snaps/11-zcurve/plot-zcurve-1.svg @@ -57,30 +57,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/testthat/_snaps/11-zcurve/plot-zcurve-2.svg b/tests/testthat/_snaps/11-zcurve/plot-zcurve-2.svg index 3581a294..a7e19df2 100644 --- a/tests/testthat/_snaps/11-zcurve/plot-zcurve-2.svg +++ b/tests/testthat/_snaps/11-zcurve/plot-zcurve-2.svg @@ -57,18 +57,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/tests/testthat/_snaps/11-zcurve/plot-zcurve-3.svg b/tests/testthat/_snaps/11-zcurve/plot-zcurve-3.svg index c8ee3755..f407685b 100644 --- a/tests/testthat/_snaps/11-zcurve/plot-zcurve-3.svg +++ b/tests/testthat/_snaps/11-zcurve/plot-zcurve-3.svg @@ -53,18 +53,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/tests/testthat/_snaps/11-zcurve/plot-zcurve-4.svg b/tests/testthat/_snaps/11-zcurve/plot-zcurve-4.svg index 0f866a4b..61ede93a 100644 --- a/tests/testthat/_snaps/11-zcurve/plot-zcurve-4.svg +++ b/tests/testthat/_snaps/11-zcurve/plot-zcurve-4.svg @@ -53,30 +53,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/testthat/_snaps/11-zcurve/plot-zcurve-5.svg b/tests/testthat/_snaps/11-zcurve/plot-zcurve-5.svg index f9242805..5da2bd25 100644 --- a/tests/testthat/_snaps/11-zcurve/plot-zcurve-5.svg +++ b/tests/testthat/_snaps/11-zcurve/plot-zcurve-5.svg @@ -57,30 +57,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/testthat/_snaps/11-zcurve/plot-zcurve-6.svg b/tests/testthat/_snaps/11-zcurve/plot-zcurve-6.svg index 07bb04d6..654131d6 100644 --- a/tests/testthat/_snaps/11-zcurve/plot-zcurve-6.svg +++ b/tests/testthat/_snaps/11-zcurve/plot-zcurve-6.svg @@ -27,30 +27,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -85,6 +85,5 @@ 6 Z-Statistic Density -plot_zcurve_6 diff --git a/tests/testthat/_snaps/11-zcurve/plot-zcurve-7.svg b/tests/testthat/_snaps/11-zcurve/plot-zcurve-7.svg index 10d26add..715b2ad9 100644 --- a/tests/testthat/_snaps/11-zcurve/plot-zcurve-7.svg +++ b/tests/testthat/_snaps/11-zcurve/plot-zcurve-7.svg @@ -57,30 +57,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/testthat/_snaps/11-zcurve/plot-zcurve-8.svg b/tests/testthat/_snaps/11-zcurve/plot-zcurve-8.svg index d8837844..a625f0cb 100644 --- a/tests/testthat/_snaps/11-zcurve/plot-zcurve-8.svg +++ b/tests/testthat/_snaps/11-zcurve/plot-zcurve-8.svg @@ -57,24 +57,24 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + diff --git a/tests/testthat/test-05-methods.R b/tests/testthat/test-05-methods.R index 3163c4eb..34d4ab59 100644 --- a/tests/testthat/test-05-methods.R +++ b/tests/testthat/test-05-methods.R @@ -283,9 +283,11 @@ test_that("Models summary functions work", { # testing consistency across all model specifications for(i in 1:length(saved_files)){ - expect_equal( - capture_output_lines(summary(fits[[i]], type = "models"), print = TRUE, width = 150), - read.table(file = file.path("../results/summary.models", paste0(i, ".txt")), header = FALSE, blank.lines.skip = FALSE)[,1]) + if(!i %in% c(8, 9, 17)){ + expect_equal( + capture_output_lines(summary(fits[[i]], type = "models"), print = TRUE, width = 150), + read.table(file = file.path("../results/summary.models", paste0(i, ".txt")), header = FALSE, blank.lines.skip = FALSE)[,1]) + } } # test short names @@ -342,7 +344,11 @@ test_that("Diagnostics summary functions work", { test_that("Individual summary functions work", { # testing consistency across all model specifications + # only works for non-spike and slab models for(i in 1:length(saved_files)){ + if(fits[[i]]$add_info$algorithm == "ss") + next + expect_equal( capture_output_lines(summary(fits[[i]], type = "individual"), print = TRUE, width = 150), read.table(file = file.path("../results/summary.individual", paste0(i, ".txt")), header = FALSE, blank.lines.skip = FALSE)[,1]) @@ -887,7 +893,9 @@ if(FALSE){ # generate summary.models files for(i in seq_along(fits)){ - write.table(capture_output_lines(summary(fits[[i]], type = "models"), print = TRUE, width = 150), file = file.path("tests/results/summary.models", paste0(i, ".txt")), row.names = FALSE, col.names = FALSE) + if(!i %in% c(8, 9, 17)){ + write.table(capture_output_lines(summary(fits[[i]], type = "models"), print = TRUE, width = 150), file = file.path("tests/results/summary.models", paste0(i, ".txt")), row.names = FALSE, col.names = FALSE) + } } # generate summary.diagnostics files diff --git a/vignettes/Explanation.Rmd b/vignettes/Explanation.Rmd new file mode 100644 index 00000000..11c487ed --- /dev/null +++ b/vignettes/Explanation.Rmd @@ -0,0 +1,51 @@ +--- +title: "Guide to RoBMA Vignettes" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{ Guide to RoBMA Vignettes} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +The `RoBMA` package provides a comprehensive set of vignettes to help users navigate different aspects of Robust Bayesian Meta-Analysis. This guide outlines the available vignettes and their specific focus to help you find the relevant information for your analysis. + +## Introductory Vignettes + +### [Tutorial: Adjusting for Publication Bias in JASP and R](Tutorial.html) +This is the main introduction to the RoBMA framework. It covers the basics of adjusting for publication bias using selection models, PET-PEESE, and Robust Bayesian Meta-Analysis. It is the recommended starting point for new users. + +### [Reproducing Bayesian Model-Averaged Meta-Analysis](ReproducingBMA.html) +This vignette demonstrates how to perform a classic Bayesian model-averaged meta-analysis. It focuses on reproducing standard BMA results and understanding the core components of the method. + +## Advanced Modeling Features + +### [Robust Bayesian Model-Averaged Meta-Regression](MetaRegression.html) +Learn how to incorporate moderators into your meta-analysis using `RoBMA.reg()`. This vignette explains how to fit meta-regression models to account for heterogeneity explained by study-level covariates. + +### [Multilevel Robust Bayesian Meta-Analysis](MultilevelRoBMA.html) +This vignette demonstrates how to perform multilevel meta-analysis to account for dependent effect sizes (e.g., multiple estimates from the same study). It uses the spike-and-slab algorithm (`algorithm = "ss"`) to efficiently estimate models with within-study and between-study heterogeneity while adjusting for publication bias. + +### [Multilevel Robust Bayesian Model-Averaged Meta-Regression](MultilevelRoBMARegression.html) +This vignette demonstrates how to perform multilevel meta-regression. In addition, it illustrates how to rescale default prior distributions to work with non-standardized effect sizes. + +### [Z-Curve Publication Bias Diagnostics](ZCurveDiagnostics.html) +This vignette details the use of meta-analytic z-curves for diagnosing publication bias. It explains how to interpret z-curve plots and statistics provided by the package. + +## Specialized Applications + +### [Informed Bayesian Model-Averaged Meta-Analysis in Medicine](MedicineBMA.html) +This vignette focuses on applying RoBMA in medical contexts. It discusses the use of informed priors tailored for medical research questions and continuous outcomes. + +### [Informed Bayesian Model-Averaged Meta-Analysis with Binary Outcomes](MedicineBiBMA.html) +Similar to the Medicine BMA vignette, but specifically for binary outcomes. It covers the `BiBMA` models (Binomial-Normal) and appropriate prior settings for medical meta-analysis with binary data. + +## Customization and Performance + +### [Fitting Custom Meta-Analytic Ensembles](CustomEnsembles.html) +For advanced users who need to go beyond the default model ensembles. This vignette demonstrates how to customize the ensemble of models, including specifying custom priors and model combinations. + +### [Fast Robust Bayesian Meta-Analysis via Spike and Slab Algorithm](FastRoBMA.html) +For computationally intensive problems or quick approximations, the "spike-and-slab" algorithm (`algorithm = "ss"`) can be used. This vignette explains how to use this faster alternative to the default bridge sampling approach. + +### [Hierarchical Bayesian Model-Averaged Meta-Analysis](HierarchicalBMA.html) +This vignette introduces multilevel models. It shows how to handle dependencies in the data (e.g., multiple effect sizes from the same study) using the `study_ids` argument to specify a hierarchical structure. Note that this vignette relies on multivariate parameterization that is relevant only for the bridge sampling algorithm. However, it is still helpful for describing the parameterization. diff --git a/vignettes/MultilevelRoBMA.Rmd b/vignettes/MultilevelRoBMA.Rmd new file mode 100644 index 00000000..2cd604bd --- /dev/null +++ b/vignettes/MultilevelRoBMA.Rmd @@ -0,0 +1,208 @@ +--- +title: "Multilevel Robust Bayesian Meta-Analysis" +author: "František Bartoš" +date: "2025" +output: + rmarkdown::html_vignette: + self_contained: yes +bibliography: ../inst/REFERENCES.bib +csl: ../inst/apa.csl +vignette: > + %\VignetteIndexEntry{Multilevel Robust Bayesian Meta-Analysis} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup, include = FALSE} +is_check <- ("CheckExEnv" %in% search()) || + any(c("_R_CHECK_TIMINGS_", "_R_CHECK_LICENSE_") %in% names(Sys.getenv())) || + !file.exists("../models/MultilevelRoBMA/fit_Johnides2025.RDS") +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + eval = !is_check, + dev = "png") +if(.Platform$OS.type == "windows"){ + knitr::opts_chunk$set(dev.args = list(type = "cairo")) +} +``` + +```{r include = FALSE} +library(RoBMA) +fit <- readRDS(file = "../models/MultilevelRoBMA/fit_Johnides2025.RDS") +fit_simple <- readRDS(file = "../models/MultilevelRoBMA/fit_Johnides2025_single.RDS") +``` + +```{r include = FALSE, eval = FALSE} +# R package version updating +library(RoBMA) +data("Johnides2025", package = "RoBMA") + +fit <- RoBMA( + d = Johnides2025$d, + se = Johnides2025$se, + study_ids = Johnides2025$study, + algorithm = "ss", + adapt = 5000, + burnin = 5000, + sample = 10000, + parallel = TRUE, + seed = 1, + autofit = FALSE +) +saveRDS(fit, file = "../models/MultilevelRoBMA/fit_Johnides2025.RDS", compress = "xz") + +fit_simple <- RoBMA( + d = Johnides2025$d, + se = Johnides2025$se, + algorithm = "ss", + adapt = 5000, + burnin = 5000, + sample = 10000, + parallel = TRUE, + seed = 1, + autofit = FALSE +) +saveRDS(fit_simple, file = "../models/MultilevelRoBMA/fit_Johnides2025_single.RDS", compress = "xz") +``` + +**This vignette accompanies the manuscript [Robust Bayesian Multilevel Meta-Analysis: Adjusting for Publication Bias in the Presence of Dependent Effect Sizes](https://doi.org/10.31234/osf.io/9tgp2_v1) preprinted at *PsyArXiv* [@bartos2025robust].** + +This vignette reproduces the first example from the manuscript. For multilevel meta-regression with moderators see [Multilevel Robust Bayesian Model-Averaged Meta-Regression](MultilevelRoBMARegression.html). + +Multilevel Robust Bayesian Meta-Analysis (RoBMA) extends the standard RoBMA framework to datasets containing multiple effect sizes from the same studies. We demonstrate the method using data from @johnides2025secondary, who meta-analyzed 412 effect sizes from 128 studies investigating secondary benefits of family-based treatments for childhood disorders. + +### When to Use Multilevel RoBMA + +Multilevel RoBMA is appropriate for dataset that contain multiple effect sizes from the same studies. The multilevel approach explicitly models the clustering structure through the `study_ids` argument, which: + + - accounts for dependencies among effect sizes from the same study, + - partitions heterogeneity into within-study and between-study components, + - while simultaneously adjusting for publication bias at the study level (corresponding to selective reporting). + +### Loading the Data + +We load the package and examine the dataset structure. +```{r} +library(RoBMA) +data("Johnides2025", package = "RoBMA") +``` + +The dataset contains effect sizes (`d`), standard errors (`se`), and study identifiers (`study`). + +```{r} +head(Johnides2025) +``` + +Multiple rows share the same study name, indicating that these effect sizes come from the same study. +For example, the first five effect sizes are from "Price et al. (2012)" and might be more similar to each other than to effect sizes from other studies. + +### Fitting the Multilevel Model + +The `study_ids` argument specifies which effect sizes belong together. We use `algorithm = "ss"` (spike-and-slab), which is faster for complex models and neccessary for estimating multilevel selection models. +The `"ss"` algorithm estimates the models and parameters simultaneously, therefore we increase MCMC adaptation, iteration, and sampling to obtain more reliable estimates +(we disable automatic convergence checking with `autofit = FALSE` to speed up the fitting process here). + +```{r, eval = FALSE} +fit <- RoBMA( + d = Johnides2025$d, + se = Johnides2025$se, + study_ids = Johnides2025$study, + algorithm = "ss", + adapt = 5000, + burnin = 5000, + sample = 10000, + parallel = TRUE, + seed = 1, + autofit = FALSE +) +``` + +*Note: This model takes 10-15 minutes with parallel processing enabled. Without parallel processing, expect over an hour.* + +### Interpreting the Results + +The `summary()` output contains two main sections. + +```{r} +summary(fit) +``` + +#### Components Summary + +This table shows Bayes factors testing the presence of effect, heterogeneity, and publication bias. Each row displays the prior probability, posterior probability after observing the data, and the inclusion Bayes factor comparing models with versus without that component. + +In our example, the inclusion BF for the effect is 0.927, indicating weak evidence against an effect. The inclusion BF for heterogeneity and publication bias are reported as `Inf`, i.e., beyond the numerical precision of the `ss` algorithm (> 10⁶), indicating extreme evidence for both components. + +We also notice warning about effective sample size (ESS) below the set target. The difference is however not substantial and we can safely ignore it. + +#### Model-Averaged Estimates + +This section provides meta-analytic estimates averaged across all models, weighted by their posterior probabilities. The average effect size is `mu`, overall heterogeneity is `tau`, and the heterogeneity allocation parameter `rho`. +The heterogeneity allocation parameter `rho` indicates the proportion of heterogeneity within versus between studies: `rho = 0` means all heterogeneity is between studies, `rho = 1` means all is within studies, and `rho = 0.5` means equal split. +The remaining parameters summarize the weight function and PET/PEESE regression for publication bias. + +In our example, we find small effect size (*d* = 0.050, 95% CI [0.000, 0.173]), substantial heterogeneity (τ = 0.40, 95% CI [0.348, 0.458]), and nearly balanced heterogeneity allocation (ρ = 0.461, 95% CI [0.306, 0.603]). The large heterogeneity combined with the small pooled effect suggests substantial variation in true effects. This distribution of true effect sizes can be obtain by the `summary_heterogeneity()` function: + +```{r} +summary_heterogeneity(fit) +``` + +The wide prediction interval (*d* = -0.752 to 0.845) quantifies the degree of this heterogeneity: some studies may show benefits while others show harm. + +### Model Types Summary + +To understand which publication bias mechanisms the data support, we examine the posterior distribution across model types: + +```{r} +summary(fit, type = "models") +``` + +Most (all) posterior probability is allocated to selection models (weight functions). The publication bias adjustment therefore reflects selective reporting rather than small study effects (PET/PEESE regression), specifically, one-sided selection operating on marginally significant $p$-values and direction of the effect. + +### Visualizing the Weight Function + +The weight function shows how publication probability varies across *p*-value ranges: + +```{r, fig.width = 6, fig.height = 4} +plot(fit, parameter = "weightfunction", rescale_x = TRUE) +``` + +The plot displays one-sided *p*-value cutoffs (x-axis) against relative publication probability (y-axis), averaged across weight function specifications. A flat line at 1.0 indicates no publication bias; values below 1.0 indicate suppression. + +In our example, we notice a small drop in the relative publication probability at cutoff corresponding to p = 0.05 (one-sided, i.e., 0.10 two-sided: selection on marginally significant $p$-values) and a much sharper drop corresponding to the direction of the effect (p = 0.50). + + +### Comparison with Single-Level RoBMA + +To understand the importance of accounting for nested structure, we compare our results with a standard single-level RoBMA that ignores dependencies among effect sizes from the same study. + +```{r, eval = FALSE} +fit_simple <- RoBMA( + d = Johnides2025$d, + se = Johnides2025$se, + algorithm = "ss", + adapt = 5000, + burnin = 5000, + sample = 10000, + parallel = TRUE, + seed = 1, + autofit = FALSE +) +``` + +```{r} +summary(fit_simple) +``` + +The single-level model differs by: + + - omitting `study_ids`: it treats all effect sizes as independent, + - estimating only one heterogeneity parameter: it cannot distinguish within-study from between-study variation, + - potentially biased inference: ignoring dependencies can lead to overconfident conclusions. + +For the Johnides et al. data, the single-level RoBMA finds strong evidence for the absence of an effect, while the multilevel model provides only weak evidence against it. +Properly accounting for data structure leads to more conservative and appropriate inferences. + + +### References diff --git a/vignettes/MultilevelRoBMARegression.Rmd b/vignettes/MultilevelRoBMARegression.Rmd new file mode 100644 index 00000000..2f3dd4a3 --- /dev/null +++ b/vignettes/MultilevelRoBMARegression.Rmd @@ -0,0 +1,161 @@ +--- +title: "Multilevel Robust Bayesian Model-Averaged Meta-Regression" +author: "František Bartoš" +date: "2025" +output: + rmarkdown::html_vignette: + self_contained: yes +bibliography: ../inst/REFERENCES.bib +csl: ../inst/apa.csl +vignette: > + %\VignetteIndexEntry{Multilevel Robust Bayesian Model-Averaged Meta-Regression} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup, include = FALSE} +is_check <- ("CheckExEnv" %in% search()) || + any(c("_R_CHECK_TIMINGS_", "_R_CHECK_LICENSE_") %in% names(Sys.getenv())) || + !file.exists("../models/MultilevelRoBMARegression/zfit_Havrankova2025.RDS") +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + eval = !is_check, + dev = "png") +if(.Platform$OS.type == "windows"){ + knitr::opts_chunk$set(dev.args = list(type = "cairo")) +} +``` + +```{r include = FALSE} +library(RoBMA) +zfit_reg <- readRDS(file = "../models/MultilevelRoBMARegression/zfit_Havrankova2025.RDS") +fit_reg <- zfit_reg +class(fit_reg) <- class(fit_reg)[!class(fit_reg) %in% "zcurve_RoBMA"] +``` + +```{r include = FALSE, eval = FALSE} +# R package version updating +library(RoBMA) +data("Havrankova2025", package = "RoBMA") + +# Prior scaling +fit_fe <- metafor::rma(yi = y, sei = se, data = Havrankova2025, method = "FE") +unti_scale <- fit_fe$se * sqrt(sum(Havrankova2025$N)) +prior_scale <- unti_scale * 0.5 + +df_reg <- data.frame( + y = Havrankova2025$y, + se = Havrankova2025$se, + facing_customer = Havrankova2025$facing_customer, + study_id = Havrankova2025$study_id +) + +fit_reg <- RoBMA.reg( + ~ facing_customer, + study_ids = df_reg$study_id, + data = df_reg, + rescale_priors = prior_scale, + prior_scale = "none", transformation = "none", + algorithm = "ss", sample = 20000, burnin = 10000, adapt = 10000, + thin = 5, parallel = TRUE, autofit = FALSE, seed = 1) +) + +zfit_reg <- as_zcurve(fit_reg) +saveRDS(zfit_reg, file = "../models/MultilevelRoBMARegression/zfit_Havrankova2025.RDS", compress = "xz") +``` + +**This vignette accompanies the manuscript [Robust Bayesian Multilevel Meta-Analysis: Adjusting for Publication Bias in the Presence of Dependent Effect Sizes](https://doi.org/10.31234/osf.io/9tgp2_v1) preprinted at *PsyArXiv* [@bartos2025robust].** + +This vignette reproduces the second example from the manuscript, re-analyzing data from @havrankova2025beauty on the relationship between beauty and professional success (1,159 effect sizes from 67 studies). +We investigate whether the effect depends on the type of customer contact ("no", "some", or "direct"). +For the first example describing a publication bias-adjusted multilevel meta-analysis see [Multilevel Robust Bayesian Meta-Analysis](MultilevelRoBMA.html). + +### Rescaling Priors for Non-Standardized Effect Sizes + +The effect sizes in this dataset are not standardized (percent increase in earnings with one-standard deviation increase in beauty). +Therefore, we must rescale the default prior distributions to avoid specifying overly narrow or wide priors. +Overly narrow priors would make it difficult to find evidence for the effect (as both models would predict effects very close to zero--their predictions would overlap substantially), +while overly wide priors would bias the results towards the null hypothesis (as alternative models would predict unrealistically large effects--their predictions would never be supported by the data). + +We rescale the priors by matching the default prior scale to the unit information scale of the data [@rover2021weakly; @mulder2024bayesian]. +The unit information scale can be approximated by the standard error of a fixed-effect model multiplied by the square root of the total sample size. +Since the default prior for standardized mean differences has a standard deviation of one (corresponding to half the unit information), we multiply the unit information scale by 0.5. + +```{r} +library(RoBMA) +data("Havrankova2025", package = "RoBMA") + +fit_fe <- metafor::rma(yi = y, sei = se, data = Havrankova2025, method = "FE") +unti_scale <- fit_fe$se * sqrt(sum(Havrankova2025$N)) +prior_scale <- unti_scale * 0.5 +``` + +The resulting `prior_scale`, in our example approximately 26, can be used in the `rescale_priors` argument in the fitting functions of the `RoBMA` package, + +```{r, eval = FALSE} +df_reg <- data.frame( + y = Havrankova2025$y, + se = Havrankova2025$se, + facing_customer = Havrankova2025$facing_customer, + study_id = Havrankova2025$study_id +) + +fit_reg <- RoBMA.reg( + ~ facing_customer, + study_ids = df_reg$study_id, + data = df_reg, + rescale_priors = prior_scale, + prior_scale = "none", transformation = "none", + algorithm = "ss", sample = 20000, burnin = 10000, adapt = 10000, + thin = 5, parallel = TRUE, autofit = FALSE, seed = 1) +) +``` + +where we first specify the input `data.frame` (with `y` and `se` denoting the effect size and standard error inputs) and `prior_scale = "none"` and `transformation = "none"` arguments disable prior distributions for standardized effect sizes. +We also notably increase the number of adaptation, burn-in, and sampling iterations to ensure convergence of the more complex model (and use the `algorithm = "ss"` options since the bridge-sampling algorithm is unfeasible for multilevel models). + +*Note that the meta-regression model can take more than an hour to run with parallel processing enabled.* + +### Interpreting the Results + +The `summary` and `marginal_summary` functions provide the overall model estimates and the estimated marginal means. + +```{r} +summary(fit_reg) +``` + +Using the rescaled prior distributions, the multilevel RoBMA meta-regression finds extreme evidence for the presence of the average effect, moderation by the degree of consumer contact, between-study heterogeneity, and publication bias (all BFs > 10^6). +The model-averaged average effect estimate of mu = 3.0, 95% CI [1.9, 4.2], is accompanied by considerable overall heterogeneity tau = 4.5, 95% CI [3.9, 5.3], +and within-cluster allocation close to 1, rho = 0.82, 95% CI [0.75, 0.88], indicating a high degree of similarity of estimates from the same study. + +The summary function also warns us about a large R-hat. Inspection of the parameter-specific MCMC diagnostics via `summary(fit_reg, type = "diagnostics")` shows that while some R-hats are inflated, most parameters were sampled to an acceptable level. The main source of issue seems to be the moderator coefficients `facing_customer`. We visually assess the chains `diagnostics_trace(fit_reg, "facing_customer")` but do not notice substantial issues. + +The average effect is moderated by the degree of consumer contact, to examine the effect at each level of the moderator we can use the `marginal_summary()` function. + +```{r} +marginal_summary(fit_reg) +``` + +The estimated marginal means at each level of the moderator reveals moderate evidence for the absence of the effect for no consumer contact jobs mu = 0.9, 95% CI [-0.5, 2.5], BF10 = 0.11, +and extreme evidence for jobs with some consumer contact mu = 4.1, 95% CI [2.6, 5.5], BF10 > 10^6 and jobs with direct consumer contact mu = 4.1, 95% CI [2.7, 5.5], BF10 > 10^6. + +### Visual Fit Assessment + +We can visualize evalate the model fit using the meta-analytic z-curve plot [@bartos2025zcurve] (also see [Z-Curve Publication Bias Diagnostics](ZCurveDiagnostics.html) vignette for more details). +The z-curve plot shows the distribution of the observed $z$-statistics (computed as the effect size / standard error), with dotted red horizontal lines highlighting the typical steps on which publication bias operates +($z = \pm 1.65$ and $z = \pm 1.96$ corresponding to statistically significant and marginally significant $p$-values, and $z = 0$ corresponding to the selection of the direction of the effect). + +```{r, eval = FALSE} +zfit_reg <- as_zcurve(fit_reg) +``` +```{r, fig.width = 6, fig.height = 4} +par(mar = c(4,4,0,0)) +plot(zfit_reg, by.hist = 0.25, plot_extrapolation = FALSE, from = -4, to = 8) +``` + +We can notice clear discontinuities corresponding to the selection on the direction of the effect and marginal significance. +The posterior predictive density from the multilevel RoBMA meta-regression indicates that the RoBMA meta-regression model approximates the observed data reasonably well, +capturing the discontinuities and the proportion of statistically significant results. This reassures us that the model provides a good fit to the data while adjusting for publication bias. + +### References diff --git a/vignettes/ZCurveDiagnostics.Rmd b/vignettes/ZCurveDiagnostics.Rmd index c405b278..3688a368 100644 --- a/vignettes/ZCurveDiagnostics.Rmd +++ b/vignettes/ZCurveDiagnostics.Rmd @@ -393,8 +393,6 @@ legend("topright", col = c("black", "blue"), lty = 2, lwd = 2) ``` - lty = 2, lwd = 2) -``` #### Results