← Back to all sparks
K

kwb.utils

ANALYTICS
Velocity0.0

General Utility Functions Developed at KWB

The utility layer under KWB's R packages, growing by accretion one helper at a time.

r-packageutilitieskwbhelper-functionscaching
Current state
kwb.utils is the shared toolbox the KWB-R packages build on, and it grows almost entirely by addition. Every release in this window contributes new exported helpers — string and matrix manipulation, caching, file and path handling — while touching existing behaviour only to fix bugs or rename arguments. The newest release adds loadFunctions(), callWithData() and mergeEnvironments(), which extend it from data helpers into loading and calling code.
Where it's heading
The package is consolidating utilities that would otherwise be duplicated across the KWB-R repositories, including functions moved in from sibling packages. Argument renames and deprecations appear regularly, so the API is not treated as frozen — callers are expected to track it. Release gaps have stretched from months to nearly two years, which suggests the useful surface is largely filled in and additions now arrive only as sibling packages need them.
Prediction
The next release will most likely add another small batch of helpers extracted from a KWB project rather than reorganise what exists, following the pattern of every version shown.

Recent moves

  1. 1y ago

    loadFunctions() and callWithData() extend the toolbox to code

    loadFunctions(), callWithData() and mergeEnvironments() push the package past data manipulation into loading and invoking code with supplied environments. multiColumnLookup() gains multiple value columns with drop and includeKeys arguments, and findPartialDuplicates() is reimplemented to fix a bug — the usual mix of new surface plus targeted repair.

    View source ↗
  2. 3y ago

    Twelve new helpers for paths, warnings and extdata files

    The largest single batch of additions in this window: assignObjects(), catchWarning(), extdataFile(), directoryName(), stopFormatted() and more, with hsAddMissingCols() and extractSubstring() reimplemented. subexpressionMatches() renames its regularExpression argument to pattern, continuing the package's habit of tidying argument names as it goes.

    View source ↗
  3. 4y ago

    clipMatrix() added; extractRowRanges() reworked for vectors

    New arguments spread across substSpecialChars(), inRange() and makeUnique(), plus a new clipMatrix(). extractRowRanges() is reworked to accept character vectors and its arguments renamed and reordered — a signature change callers have to follow, of the kind this package makes without ceremony.

    View source ↗
  4. 5y ago

    Caching internals and encoding-aware line reading arrive

    Private cache-directory functions land alongside readLinesWithEncoding(), moved in from fakin.path.app — a clear instance of the consolidation role this package plays. orderBy() gains multi-column ordering and readDictionary() picks up file encoding arguments.

    View source ↗
  5. 6y ago

    Fourteen new functions; assignGlobally() deprecated

    A wide release adding accessors, storage, sampling and text-conversion helpers, with the first serious pruning of the old API: assignGlobally() deprecated and hsSubstSpecChars() renamed to substSpecialChars(). The reproducible-sample function even brings its own S3 print method.

    View source ↗
  6. 6y ago

    listToDepth() and six small string helpers

    A short release adding a generic list function and a handful of one-line string helpers such as left(), right() and space(). Several of these are revisited in the next version, which is how this package tends to settle a new function's shape.

    View source ↗