← Back to all sparks
C

crandep

INFRA · APIS
Velocity0.0

Network Analysis of Dependencies of CRAN Packages

Half CRAN dependency scraper, half extreme-value modelling kit — and the scraper half keeps finding bugs.

crandependency-networkpower-lawmcmcextreme-valuer-package
Current state
crandep does two jobs that rarely share a package: it harvests the CRAN dependency network, and it fits power-law and extreme-value mixture models to the resulting degree distributions. The 2024 releases were all model work — profile posteriors, wrappers, a constrained variant, a TZP-power-law mixture between the two- and three-component models. The 2025 releases are entirely the other half, fixing what the harvester was silently getting wrong.
Where it's heading
The modelling side has settled into a family of mixtures with matching wrapper and profile-posterior functions, and has not gained a new component since mid-2024. Attention has shifted to data quality in the scraper, where two consecutive releases dealt with the same class of problem: rows that should not exist because of trailing commas in CRAN's own metadata, and rows that should exist but did not because orphan packages have no edges. For a package whose science is degree distributions, missing isolated nodes is a modelling error, not a formatting one.
Prediction
Expect further hardening against CRAN metadata quirks in the harvesting functions; the mixture-model side looks feature-complete and is likely to stay quiet unless a new component model is published.

Recent moves

  1. 1y ago

    Dependency harvest split in two so orphan packages stop disappearing

    get_dep_all_packages() changes its return type from a data frame to a list of two — $packages and $dependencies — so that orphan packages with no forward or reverse dependencies of any type are finally represented. Callers must adapt, but the payoff is that isolated nodes stop vanishing from a network whose degree distribution is the whole point of the package.

    View source ↗
  2. 1y ago

    Trailing commas in CRAN metadata no longer produce empty-name rows

    A data-quality fix traced to CRAN itself: some dependency strings in tools::CRAN_package_db() carry trailing commas, which produced rows with an empty package name. Fixing it at the source in get_dep_vec() let the downstream row-deletion workaround be removed. The native pipe was also backed out, widening the R versions the package runs on.

    View source ↗
  3. 2y ago

    Constrained two-component mixture with continuity at the threshold

    Adds a constrained variant of the two-component mixture, assuming a power law in the body and continuity at the threshold, and plumbs a constrained argument through mcmc_mix2(), its wrapper, and the log-posterior. Another member of the mixture family rather than a new direction for it.

    View source ↗
  4. 2y ago

    Argument names normalised to x_max; MCMC wrapper defaults set

    A naming and defaults pass: xmax becomes x_max everywhere, u_max and v_max gain defaults in the MCMC wrappers, and invts defaults to 1.0 so no Metropolis coupling or power posterior is applied unless asked for. The rename breaks calls that used the old argument name.

    View source ↗
  5. 2y ago

    TZP-power-law mixture fills the gap between the 2- and 3-component models

    Adds the TZP-power-law mixture, positioned between the existing two- and three-component models, filling in the family rather than extending it. The name argument is dropped from the wrappers, removing the requirement that input data frames carry a specific column.

    View source ↗
  6. 2y ago

    Profile posteriors and chained MCMC wrappers for the mixture models

    Introduces the profile-posterior functions obtain_u_set_mix2() and obtain_u_set_mix3() plus _wrapper functions that chain threshold selection into the MCMC call — the pattern every later mixture release extends. Note this entry's body is byte-identical to the 0.3.3 entry below it, so 0.3.4's own delta cannot be read from the feed.

    View source ↗