Skip to content

equil2

1.1.0Package record

Calculate Urinary Saturation with the EQUIL2 Algorithm

0packages depend
2.5Kdownloads / year
92.8%test coverage
13/13flavors OK

Overview

About

Saturation of ionic substances in urine is calculated based on sodium, potassium, calcium, magnesium, ammonia, chloride, phosphate, sulfate, oxalate, citrate, ph, and urate. This program is intended for research use, only. The code within is translated from EQUIL2 Visual Basic code based on Werness, et al (1985) "EQUIL2: a BASIC computer program for the calculation of urinary saturation" doi:10.1016/s0022-5347(17)47703-2 to R. The Visual Basic code was kindly provided by Dr. John Lieske of the Mayo Clinic.

Changes in 1.1.0
  • The CITATION file now uses bibentry()
  • New function equil2_v1() ports the original Mayo Clinic class-based VBA module (clsEquil2, attached to issue 2). V1 takes mmol/L inputs, models CO2 / bicarbonate / carbonate chemistry, TRIS buffer, struvite in the Mg / NH4 mass balance, and (when chloride is omitted) auto-fills chloride from electroneutrality. V1 outputs activity products and relative saturation ratios for Calcium Oxalate, Brushite, Struvite, and Uric Acid. For Hydroxyapatite, Sodium Urate, and Ammonium Urate supersaturations (which V1 does not compute) keep using equil2(). Pyrophosphate input is accepted but disabled inside the algorithm, matching the V1 source. The V1 source code is shipped in the new vignette vignette("original-source-v1"). The R port has been verified against the original VBA module by running clsEquil2.bas in LibreOffice Basic with Option VBASupport 1; on the LabCorp inputs the two agree to better than 10 ppm.
Show all changes in 1.1.0Hide the rest of the changes in 1.1.0
  • New units in add_units(): g_carbondioxide, g_pyrophosphate, g_tris (and corresponding mol / mmol variants) for use with equil2_v1() inputs.
  • Bug fix (#2): corrected the phosphate and sulfate mass-mole conversion factors in equil2() so that the mg_phosphate/dL and mg_sulfate/dL units now consume actual phosphate (PO4(3-), 94.97 g/mol) and sulfate (SO4(2-), 96.07 g/mol) masses, matching the unit definitions in add_units(). The original V5 BASIC source uses atomic-weight factors for inorganic P (30.97) and S (32.06), so calling code that supplied unit-aware inputs such as set_units(32, "mmol_phosphate/L") saw approximately 3x over-estimates. The R port has been cross-validated against the V5 BASIC source itself (with the same fix applied) run in LibreOffice Basic; the two agree on ionic strength to ~2 ppb and on the six supersaturation / Gibbs-energy outputs to better than 1 ppm on the LabCorp inputs. Thanks Lea Lerose for the report and diagnosis. See vignette("original-source") for further discussion and a brief V1-vs-V5 comparison.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 1.7 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-17
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 1.1.0
READMEYes · 130 wordsVignettesYes · 2 · dynamicNEWSYes · 100% structured · mentions 1.1.0Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
3
Examples that run
100%2 run in a plain check
Exported functions with examples
100%
Documented parameters
13%
Return-value docs
100%
Help pages citing references
67%

Downloads

2.5K
CRAN downloads in the past year
Rank #18,141 · ~7/day · ~208/mo
Daily download trend is not available in this view yet.
23830 days
71390 days
2.5K1 year
Compare downloads with other packages →
Also on70 r2u2 autocran

Repository

0Stars
1Forks
0Open issues
0Open PRs
2Releases
40Commits
1Commit identities
40 commits · Last activity 2026-06-11
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
57
Median days to close, 50 most recently updated closed PRs
0

Forks over time

2025-04-27 · 12026-07-07 · 1
PracticesBeta

7 development-tooling and community-health practices detected across 3 families in the upstream repository

Checks run against github.com/billdenney/equil2 on 2026-10-22.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-06-11 · The repository has a site deploy workflow

pkgdown site last built 2026-06-11

Coverage (1)
Coverage reporting (Codecov)
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-06-09
    Named in .Rbuildignore: .claude
    Pull request it wrote: opened by a project member
    Commits: at least 5 crediting it in the message
Models named in its commits
  • Claude Opus 4.75 commits · Jun 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
6 external dependencies (excludes base and recommended)

Installing equil2 adds 2 packages (2 with compiled code, 2.2 MB of source tarballs). Heaviest: Rcpp 1.8 MB, units 361 KB.

Depends (0)
none
Imports (1)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (2)
Author, Maintainer since 1.0.0 (2022), Copyright holder
Copyright holder
Releases (2)

Pick two releases to compare their code metrics.

  • 1.1.0Latest
    record
    2026-06-11 · current release · diff ↗ ·
    added 1 export
    equil2_v1
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 1.0.0
    record
    2022-12-20
  • R
    R 4.2.0 released · 2022-04-22

Package metadata

First published
2022-12-20
Total releases
2 / 4 yrs
License
MIT + file LICENSE OSI
Download size
83 KB

Cite

Cite this package

Run in R for the authors' entry:

citation("equil2")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1016/s0022-5347(17)47703-2.

Cite the 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 equil2 version 1.1.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy