← Back to all sparks
B

broadcast

ANALYTICS
Velocity0.0

Broadcasted Array Operations Like NumPy

broadcast is filling in NumPy-style array broadcasting for R, operator by operator.

array-broadcastingrcpptype-consistencylinear-algebrar-package
Current state
broadcast brings dimension-broadcasting semantics to R arrays and lists — elementwise operations between arrays of mismatched shape, plus casting methods between hierarchical lists and dimensional structures. It reached CRAN in September 2025 and has released roughly monthly since, accumulating operators (nor, nand, longest common substring), casting methods (cast_shallow2atomic, cast_hier2dim, hiernames2dimnames), and helpers (vector2array, undim, mbroadcasters).
Where it's heading
The package is in its post-launch consolidation year, and the release notes read accordingly: roughly half of each entry is a consistency correction rather than an addition. Zero-length results now carry the right type, comparison operators accept integer and logical inputs, the comment attribute survives operations, and the nand operator was found to be wrongly defined against C++ short-circuit evaluation. That ratio is what a young package looks like while its edge cases are being found.
Prediction
Expect more operators and casting methods on the same cadence, with continued type-consistency corrections as users exercise unusual input combinations. Nothing in the entries points at an architectural change.

Recent moves

  1. 2mo ago

    nor and longest-common-substring operators added; nand corrected

    Two new operators — Boolean nor and the lcss string operation — plus a correction to nand, which was not actually computing !(x & y) because of C++ short-circuit evaluation. A defect in a Boolean primitive is the kind of thing that silently propagates, so the fix matters more than the additions.

    View source ↗
  2. 5mo ago

    checkNULL, checkNA and ecumprob added

    Two inspection methods and a cumulative-probability function for statistics join the surface, with NA and NaN handling relaxed for complex-number addition and subtraction. The remainder is build hygiene — an Rchk false positive silenced and a rebuild against current Rcpp.

    View source ↗
  3. 8mo ago

    Zero-length results and attribute preservation made consistent

    Type consistency work: zero-length results from bc.b() now return raw when both inputs are raw rather than always logical, the comparison operators accept integer and logical pairs, and the comment attribute survives most methods. Edge-case alignment with the non-degenerate cases.

    View source ↗
  4. 9mo ago

    acast dimnames bug fixed; casting and helper surface widens

    A dimnames defect in acast() that could error out is fixed, and the surface grows in several directions at once — cast_shallow2atomic(), automatic dimnames in cast_hier2dim(), bc_strrep(), vector2array(), undim(), the bcr shorthand and mbroadcasters(). Broadcaster class propagation through bind_array() is the quieter structural change.

    View source ↗
  5. 10mo ago

    recurse_classed replaced by recurse_all in casting methods

    The casting methods' recursion control is generalized from classed lists to classed and dimensional lists, and S3 methods start rejecting unknown ellipsis arguments instead of ignoring them. Installation size and compile time drop with almost no performance cost.

    View source ↗
  6. 11mo ago

    Title case fixed for CRAN submission

    A submission-process release correcting the package title's capitalization. The starting line of the package's public history rather than a change to it.

    View source ↗