Manifest-Based Dependency Conflict Detection for Sandboxed and Desktop R Sessions
Overview
Lightweight, offline-first checking of R package dependencies against the currently installed environment, without requiring a full project lockfile. Verifies a declared manifest of package versions, including version constraints declared by transitive dependencies, reports session-level snapshot differences (including stale versions still loaded in a running session), detects packages shadowed by another library, and offers single-package version rollback. Designed for hosted notebooks (e.g. Kaggle, Colab, Binder) where 'renv'-style lockfile ownership is impractical, and equally usable on a normal desktop.
Bug fixes
dep_diff()now detects upgrades and downgrades of packages that are loaded in the running session. Version 0.1.0 compared the *loaded* version, which does not change until R restarts, so the headlinedep_snapshot()->install.packages()->dep_diff()workflow reported "no changes" for exactly the packages it was meant to protect. Comparison is now on the on-disk version, and a loaded package whose running version no longer matches disk is flagged (session_stale).dep_check()is now genuinely offline by default. It previously calledtools::package_dependencies()without a local database, which queried CRAN; with no internet the transitive tree came back empty and the check reported success. Dependencies are now resolved from installed metadata.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
- Malformed lines in a text manifest containing
{}no longer break the error message. - Fixed a stray merge-conflict fragment in the vignette.
New features
dep_check()verifies the version constraints that packages declare on each other (Imports: cli (>= 3.4.0)), not just that transitive dependencies are installed, so real conflicts are caught. New columnsloadedandreason; new status"restart";stop_on_problemfor scripts and CI;check_cran = TRUEnow addscran_latestandoutdatedand fails gracefully offline.- Manifests accept operators:
">= 1.2","== 1.2.3","< 2.0","!= 1.0". A bare version still means "at least", so existing manifests keep working. - Manifests can be human-readable text files (any extension other than
.rds), convenient for version control. dep_manifest_freeze()pins the packages you are using now.dep_snapshot()records every installed package by default (scope = "all"), can be saved withpath, anddep_diff()accepts a snapshot, a file path, or nothing (the latest snapshot). Saved snapshots survive the session restart that hosted notebooks require after installs.dep_env()detects Kaggle, Colab, Binder, RStudio and plain desktop sessions and reports writable libraries. Restart advice in messages is tailored to the platform.dep_libraries()finds packages shadowed by a different version in another library.dep_healthcheck()now reports the environment and shadowed packages.dep_fix()gainslib,dry_runandmethod = "archive", a base-R backend that needs neitherpaknorremotes. It verifies the result and warns if a restart is needed or if an earlier library hides the new copy.
Breaking changes
- The
depguard_snapshotstructure changed (packagesnow has columnsdisk_version,library,loaded_version); snapshots saved by 0.1.0 cannot be diffed. dep_check()results have two extra columns and the classdepguard_check(still a data frame); therequiredcolumn shows the operator form (e.g.">= 1.1.4").sessioninfois no longer imported.dep_check()prints the summary of problems; printing the result shows only problem rows (print(x, all = TRUE)for everything).
From NEWS.md in the release
Install
Health
- OK13 OKNow
- OK5 OK2026-09-24
Documentation
- Help pages
- 11 (1 internal)includes a package overview page
- Examples that run
- 88%7 run in a plain check · 1 never run
- Exported functions with examples
- 80%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
Stars over time
Releases over time
Commits over time
5 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/sunraycodes/depguard on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.2.0Latest
- 0.1.02026-09-24
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-09-24
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5
- Download size
- 40 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("depguard")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.