Package 'mediationverse'

Title: Ecosystem for Mediation Analysis in R
Description: A meta-package that loads the core packages in the mediation analysis ecosystem: 'medfit' (infrastructure), 'probmed' (probabilistic effect sizes), 'RMediation' (confidence intervals), and 'medrobust' (sensitivity analysis). This package simplifies installation and provides a unified entry point for mediation analysis in R. Inspired by the 'tidyverse' and 'easystats' ecosystems.
Authors: Davood Tofighi [aut, cre] (ORCID: <https://orcid.org/0000-0001-8523-7776>)
Maintainer: Davood Tofighi <[email protected]>
License: GPL (>= 3)
Version: 0.0.0.9000
Built: 2026-06-12 11:45:51 UTC
Source: https://github.com/Data-Wise/mediationverse

Help Index


Show mediationverse Conflicts

Description

Identifies functions that are exported by multiple mediationverse packages, which could lead to masking issues.

Usage

mediationverse_conflicts(only_loaded = TRUE)

Arguments

only_loaded

Logical. Only check currently loaded packages? Default is TRUE.

Details

When multiple packages export a function with the same name, R uses the version from the package that was loaded last. This function helps identify such conflicts so you can use explicit namespacing (e.g., medfit::extract_mediation()) when needed.

Value

A data frame with columns:

  • function_name: Name of the conflicting function

  • packages: Character vector of packages exporting this function

  • winner: The package whose version will be used (last loaded)

Examples

## Not run: 
# Show conflicts among loaded mediationverse packages
mediationverse_conflicts()

## End(Not run)

List mediationverse Packages

Description

Lists all core packages in the mediationverse ecosystem along with their installation status and versions.

Usage

mediationverse_packages(include_self = TRUE)

Arguments

include_self

Logical. Include mediationverse itself in the list? Default is TRUE.

Value

A data frame with columns:

  • package: Package name

  • installed: Logical, whether package is installed

  • version: Package version (NA if not installed)

  • attached: Logical, whether package is currently attached

Examples

mediationverse_packages()

Update mediationverse Packages

Description

Updates all mediationverse packages to their latest versions from GitHub or CRAN.

Usage

mediationverse_update(packages = NULL, ...)

Arguments

packages

Character vector of package names to update. Default is all core packages.

...

Additional arguments passed to the installation function.

Details

This function uses pak::pak() if available (recommended), otherwise falls back to remotes::install_github() for GitHub packages and utils::install.packages() for CRAN packages.

Package sources:

  • mediationverse: GitHub (data-wise/mediationverse)

  • medfit: GitHub (data-wise/medfit)

  • probmed: GitHub (data-wise/probmed)

  • RMediation: CRAN

  • medrobust: GitHub (data-wise/medrobust)

  • medsim: GitHub (data-wise/medsim)

Value

Invisibly returns a character vector of updated package names.

Examples

## Not run: 
# Update all packages
mediationverse_update()

# Update specific packages
mediationverse_update(c("medfit", "probmed"))

## End(Not run)