R Observatory
Search

Infrastructure for Mediation Model Fitting and Extraction

Record of 0.3.2Compare with 0.2.1LicencesSBOM

install.packages("medfit")
CRAN 30-day downloads, method
199−41% down on the 30 days before, the worse direction
Test coverage, method
90%of lines run by tests

Provides S7-based infrastructure for fitting mediation models, extracting path coefficients, and performing bootstrap inference. Designed as a foundation package for the mediation analysis ecosystem, supporting 'probmed', 'RMediation', and 'medrobust' packages.

Full description

Provides S7-based infrastructure for fitting mediation models, extracting path coefficients, and performing bootstrap inference. Designed as a foundation package for the mediation analysis ecosystem, supporting 'probmed', 'RMediation', and 'medrobust' packages. Implements unified interfaces for model fitting across different engines (currently generalized linear models, with future support for mixed models and Bayesian methods), standardized extraction of mediation paths from various model types, and robust bootstrap inference methods. Mediation methods are described in MacKinnon, Lockwood and Williams (2004) <doi:10.1207/s15327906mbr3901_4>, Preacher and Hayes (2008) <doi:10.3758/brm.40.3.879>, Tofighi and MacKinnon (2011) <doi:10.3758/s13428-011-0076-x>, and VanderWeele (2014) <doi:10.1097/EDE.0000000000000121>.

Maintainer
Davood Tofighi
Licence
GPL (>= 3)
Latest release
23 Jul 2026
First release
18 Jun 2026 (first seen)

Compare with another package

More details
Releases
2
Needs compilation
No
Needs R
>= 4.1.0
Config/Needs/website
knitr, rmarkdown, quarto
Config/roxygen2/version
8.0.0
Config/testthat/edition
3
Date
2026-07-20
Language
en-US
Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' preferred citation:

citation("medfit")

The package provides a citation file that builds its entry when R runs it. Run citation() to see it.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for medfit version 0.3.2 [Data set]. HJJB, LLC. Data release v2026-10-26. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-26, which the citation names so these numbers can be found later.

All 13 check platforms pass.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    0.3.2
    Time taken
    83 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    0.3.2
    Time taken
    60 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    0.3.2
    Time taken
    104 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    0.3.2
    Time taken
    54 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    0.3.2
    Time taken
    105 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    0.3.2
    Time taken
    31 s
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    0.3.2
    Time taken
    114 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    0.3.2
    Time taken
    124 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    0.3.2
    Time taken
    80 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    0.3.2
    Time taken
    79 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    0.3.2
    Time taken
    29 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    0.3.2
    Time taken
    115 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    0.3.2
    Time taken
    102 s
  • 13 OK

Over time

No change since 5 Aug 2026

As a list (5)
ChangedWorst statusOKNotesWarningsErrors
5 Aug 2026OK13000
1 Aug 2026Note12100
29 Jul 2026OK13000
11 Jul 2026Note12100
19 Jun 2026OK7000

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
207−43.9% down on the 30 days before, the worse directionIt is the sum of 3 channels: CRAN, r2u and autoCRAN.

CRAN rank

22,830 of 26,529

CRAN

199 downloads in the last 30 days

Rank
22,830 of 26,529
Change
−41% down on the 30 days before, the worse direction

It is in the total. Take it out

r2u

3 downloads in the last 30 days

Rank
11,992 of 30,526
Change
−76.9% down on the 30 days before, the worse direction

It is in the total. Take it out

autoCRAN

5 downloads in the last 30 days

Rank
10,269 of 29,130
Change
−73.7% down on the 30 days before, the worse direction

It is in the total. Take it out

Over time

Compare downloads

Needs
6
Dependent packages
0
Suggested by
1
Needs (6)
Installing it adds
4 packages, 502 KB of source
Of those, need compilation
3
Optional extras (4)
Functions
94
Public exports
16
Lines of R code
6,760
Median complexity
2
Functions (94)
Size and composition

Lines by kind (16,296)

KindLinesShare
R code6,76041%
Tests7,16544%
Documentation2,37115%

Lines by language

LanguageLinesShare
R13,92586%
Rd2,33314%
Markdown380.2%

Languages are counted from file extensions.

Files
82
R functions
94
Object systems
S3: 6 methods, S7: 5 classes
Complexity
Median
2
Mean
4.38
Highest
32
Median lines per function
15
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
94
Calls
44
Unconnected
56
Groups
6
Growth (2 releases)
Total lines by release
12,355 on 18 Jun 202616,296 on 23 Jul 2026
Release changes

The tests ran and coverage was measured.

Lines run by tests
89.6%
Expressions run by tests
88.8%
Test cases
285
Exports named in tests
100%
Coverage by file (11)
Coverage run
Lines counted
2,411
Lines the tests ran
2,161
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
testthat
Test cases
285
Lines of tests
7,165
Test lines per line of code
1.06
Exports documented
100%
Arguments documented
96.2%
Return value documented
100%
Help pages with examples
43.2%
Examples run in checks
68.8%
Other documentation
README
No
Release notes file
No
Help pages
37
Lines of documentation
2,371

Data-Wise / medfit on github.com

Stars
2+100% up on 30 days ago, the better direction
Forks
1
Open issues
3
Last commit
26 Oct 2026
Activity
Commits
799
Open pull requests
1
Tagged releases
16
Latest tagged release
v0.14.1, 26 Oct 2026
In development
Default branch at 0.14.0, ahead of CRAN 0.3.2 (checked 2026-10-25)
Issues closed in
2 days (median)
Pull requests closed in
0 days (median)
Pull requests merged
98%
Created
2 Dec 2025
Licence file reads as
–
Development practices (11)
KindFound
Continuous integrationGitHub Actions, R CMD check workflow
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Docs sourcepkgdown
GitHub Pages site last deployed 2026-10-25
The repository has a site deploy workflow
pkgdown site last built 2026-10-25
CoverageCoverage reporting (Codecov)
Reproducibility and dev environmentdata-raw/
CRAN release processcran-comments.md
Automation and maintenanceDependabot
Lint, format, editorlintr, Lint workflow

Method, repository practices

Across Data-Wise

Claude Code7 commits by it and at least 634 crediting itClaude CodeFirst seen 2 Dec 20257 commits by itat least 634 crediting it
Claude Opus 5.5Claude Opus 5.519 Oct 2026At least 1 commit
Claude Opus 4.81MClaude Opus 4.81M context window31 May 2026At least 19 commits
Claude Sonnet 4.5Claude Sonnet 4.515 Dec 2025 to 20 Dec 2025At least 23 commits
Claude Opus 4.5Claude Opus 4.514 Dec 2025 to 17 Dec 2025At least 14 commits
CodexCodexFirst seen 14 Oct 2026

Tools

ToolFirst seenFoundCommits by itCommits crediting it
Claude Code2 Dec 2025Seen in the repository.claude.claude/agents.claude/skillsCLAUDE.mdNamed in .Rbuildignore.claudeCLAUDE.mdNamed in .gitignore.claudePull request it wrote: opened by a project member7634 at least
Codex14 Oct 2026Named in .Rbuildignore.codex
  • Seen in the repository
  • Named in .Rbuildignore
  • Named in .gitignore
  • Pull request

Shared conventions

AGENTS.md

Models

ModelContext windowCommitsFirst commitLast commitCredit lines of
Claude Opus 5.51 at least19 Oct 202619 Oct 2026Claude Code
Claude Opus 4.81M19 at least31 May 202631 May 2026Claude Code
Claude Sonnet 4.523 at least15 Dec 202520 Dec 2025Claude Code
Claude Opus 4.514 at least14 Dec 202517 Dec 2025Claude Code

Across Data-Wise

R releases
  • On CRAN
  • Release
VersionReleasedR
0.3.2 current23 Jul 20264.6.1
0.2.118 Jun 2026 first seen4.6.0