The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Using depguard in Kaggle, Colab, and other sandboxed notebooks

The problem

Hosted, ephemeral R notebooks (Kaggle, Colab, Binder, and similar) ship with a large pre-installed set of packages at fixed versions. When you install an additional package, its dependencies can silently upgrade or downgrade a package that is already loaded elsewhere in your session – breaking code further down the notebook with no install-time error.

Tools like renv solve this well for projects you fully own and can persist, but assume you can write lockfiles and restore a private library. That often doesn’t fit a throwaway, read-mostly notebook session. depguard fills the narrower gap: lightweight, local-first checks that work without lockfile ownership.

Workflow 1: snapshot before, diff after

Run this before installing anything new:

library(depguard)

snap <- dep_snapshot()

Install what you need as usual:

install.packages("someNewPackage")

Then check what changed:

dep_diff(snap)

Packages that changed and are still loaded in your session are flagged risk = "high" – these are the ones most likely to break code you’ve already run.

Workflow 2: declare a manifest

If you know what your notebook needs up front, declare it once:

dep_manifest(
  dplyr = "1.1.4",
  ggplot2 = "3.5.0",
  quantmod = "0.4.26"
)

Then, any time later in the session (or at the top of a rerun):

dep_check()

This walks the transitive dependency tree of each declared package using only locally installed metadata (no network calls by default) and reports missing packages, version mismatches, and which top-level package pulled in each transitive dependency.

Workflow 3: one-shot health check

If you just want a sensible default at the top of a notebook:

dep_healthcheck()

This checks against a manifest if one exists, or falls back to capturing a baseline snapshot you can diff against later.

Fixing a conflict

If a specific package got silently bumped and broke something, you can roll just that package back to a specific version: ```{r , eval = FALSE} # nolint =======

dep_fix("stringr", "1.5.0")

This performs a single-package rollback only – it does not resolve cascading conflicts the rollback might introduce elsewhere. For full dependency resolution, use renv::restore() or pak’s solver.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.