← Back to home
Comparison · DevOps

vctrs vs withr

A side-by-side editorial comparison of vctrs and withr — release velocity, themes, recent moves, and the top alternatives to consider.

Shared themes:performance

vctrs vs withr: at a glance

Featurevctrswithr
SectorDevOpsDevOps
Velocity score0.00.0
Sparks · 30d00
Top themesr, tidyverse, type-system, vectorizationstate-management, testing, performance, base-r
Last editorial update2h ago59m ago
WebsiteVisit →Visit →

What is vctrs?

vctrs 0.7 moved conditional recoding down into the tidyverse type system.

vctrs defines the type and size rules underpinning the tidyverse. Its 0.6.x line was pure maintenance — CRAN-requested C changes, R-devel test fixes, ALTREP performance. Version 0.7.0 broke that pattern with a family of conditional and recoding functions that duplicate dplyr verbs at lower cost.

Read the full vctrs trajectory →

What is withr?

withr rebuilt defer() on base R's own on.exit(), and got much faster for it

withr provides the with_ and local_ functions that temporarily change global state and restore it on exit - the cleanup primitive under most of the tidyverse test suites. Version 3.0.0 reimplemented defer() as a thin wrapper over base::on.exit(), which the maintainers made possible by contributing the required arguments to R 3.5 itself. Everything since has been small correctness work.

Read the full withr trajectory →

vctrs vs withr: editorial side-by-side

V
vctrs
DEVOPS
0.0

vctrs 0.7 moved conditional recoding down into the tidyverse type system.

◆ Current state

vctrs defines the type and size rules underpinning the tidyverse. Its 0.6.x line was pure maintenance — CRAN-requested C changes, R-devel test fixes, ALTREP performance. Version 0.7.0 broke that pattern with a family of conditional and recoding functions that duplicate dplyr verbs at lower cost.

◆ Where it's heading

The package is absorbing operations that previously lived in dplyr, implementing them once against the shared type rules so every consumer inherits consistent semantics. Releases since have tightened attribute handling in vec_restore() and cleared non-API C usage that R's checking tools now flag.

◆ Prediction

Expect more tidyverse verbs to acquire vctrs-level implementations, and continued removal of non-API C usage as R narrows what packages are permitted to call.

W
withr
DEVOPS
0.0

withr rebuilt defer() on base R's own on.exit(), and got much faster for it

◆ Current state

withr provides the with_ and local_ functions that temporarily change global state and restore it on exit - the cleanup primitive under most of the tidyverse test suites. Version 3.0.0 reimplemented defer() as a thin wrapper over base::on.exit(), which the maintainers made possible by contributing the required arguments to R 3.5 itself. Everything since has been small correctness work.

◆ Where it's heading

The arc here is a package pushing its own machinery down into base R and then living off the result. Once defer() became on.exit(), the remaining work is about where cleanup is allowed to happen - knitr documents, source() calls, the global environment, session end - and about restoring state correctly when an expression exits early. Releases are now infrequent and CRAN-driven.

◆ Prediction

Expect continued low-volume releases fixing edge cases in where deferred handlers run; with the core delegated to base R, there is little left that would prompt a larger change.

Alternatives to vctrs and withr

Other DevOps products tracked by Sparkpulse, ranked by recent ship velocity. Each card links to a full editorial trajectory and lets you pivot into a head-to-head comparison with either vctrs or withr.

See all vctrs alternatives → · See all withr alternatives →

Recent activity from vctrs and withr

Latest ship moves from both products, interleaved chronologically. ⚡ = editorial spark.

  1. 1mo agowithrlocal_seed() actually preserves the seed now
  2. 3mo agovctrsvctrs 0.7.3 removes a non-API PRVALUE() usage
  3. 4mo agovctrsvctrs 0.7.2 clears unrecognized attributes in vec_restore()
  4. 6mo agovctrsvctrs 0.7.1 fixes protection issues found by rchk
  5. 6mo agovctrsvctrs 0.7.0 adds vectorized if-else and case-when
  6. 1y agowithrlocal_language() no longer warns when set to C
  7. 2y agowithrdefer() becomes a thin wrapper over base::on.exit()
  8. 2y agovctrsvctrs 0.6.5 adjusts C format strings for CRAN
  9. 2y agovctrsvctrs 0.6.4 fixes vec_c() performance with ALTREP vectors
  10. 4y agowithrCleanup works inside Rmd and source(); with_() gains a getter
  11. 4y agowithrNew maintainer; handlers run at session end
  12. 5y agowithrlocal_options() can set NULL; with_seed() controls RNG kind

Frequently asked questions

What is the difference between vctrs and withr?

Both compete on the same themes — performance — within DevOps. vctrs and withr are shipping at a similar cadence (velocity 0.0 vs 0.0, both within Sparkpulse's "active" band). See the at-a-glance table above for a side-by-side breakdown of velocity, recent sparks, and editorial themes.

Is vctrs better than withr?

Sparkpulse doesn't pick a winner — we score release velocity, not feature parity. vctrs and withr are shipping at a similar cadence (velocity 0.0 vs 0.0, both within Sparkpulse's "active" band). For your specific use case, the alternatives sections above list other DevOps products to evaluate alongside.

What are the best alternatives to vctrs?

Top vctrs alternatives in DevOps are ranked by recent ship velocity. Browse the "vctrs alternatives" section above for the current picks, or visit /alternatives/vctrs for the full list with editorial commentary on each.

What are the best alternatives to withr?

Top withr alternatives in DevOps are ranked by recent ship velocity. Browse the "withr alternatives" section above for the current picks, or visit /alternatives/withr for the full list with editorial commentary on each.