← Back to all sparks
C

common

ANALYTICS
Velocity0.0

Solutions for Common Problems in Base R

A base-R utility belt that grows one small function at a time, on no particular schedule

r-utilitiesbase-r-extensionsinfix-operatorsdata-frame-toolsr-package
Current state
common collects small helpers that base R leaves out — data frame labelling and sorting, infix operators for pasting and equality, UTF-8 superscript and subscript lookups, file and directory search, attribute copying between data frames. It has no dependencies to speak of and deliberately removed the one it had. In practice it is the shared substrate for its author's wider package family, and its source.all() function is maintained specifically to cooperate with the logr logging package.
Where it's heading
The pattern is accretion rather than direction: each release adds a couple of utilities and fixes whatever the last batch broke, with gaps of a year or more between them. Function additions cluster around whatever the author's other packages needed at the time — file search, attribute preservation, group-boundary detection, script sourcing. The 2025 release continues exactly this, extending the infix comparison operators from equality alone to the full set of relational tests.
Prediction
Expect more of the same shape — a handful of small helpers whenever a sibling package needs them — with no sign in these entries of a broader API push.

Recent moves

  1. 8mo ago

    Full set of relational infix operators added

    Rounds out the infix operator set with %ne%, %le%, %ge%, %lt% and %gt%, extending the package past the single %eq% operator it shipped with in 2022. Documentation fixes and video links round out an otherwise small release.

    View source ↗
  2. 2y ago

    source.all() fixed to cooperate with logr

    Repairs source.all() so it works correctly alongside the logr logging package and attempts to capture warnings in its returned dataset. A patch to the function added one release earlier, and a reminder that this package is maintained in service of its siblings.

    View source ↗
  3. 2y ago

    source.all() added for sourcing a directory of scripts

    Adds source.all() for running every script in a directory, plus a data type fix in the subscript and superscript helpers. The function needed a follow-up release before it behaved correctly in a logging context.

    View source ↗
  4. 2y ago

    changed() fixed for single-value input

    Fixes changed() when given only one value, an edge case in the function shipped a month earlier. Standard follow-up to a new addition.

    View source ↗
  5. 2y ago

    changed() identifies grouping boundaries

    Adds changed() for detecting where a grouping variable shifts value, useful for run-length style work on sorted data. The release notes candidly record that the function's code was omitted from the previous release.

    View source ↗
  6. 3y ago

    this.path() dependency removed

    Drops the package's dependency on this.path(), keeping the near-zero dependency footprint that makes it safe as a shared base for other packages. No user-facing behaviour change.

    View source ↗