As implemented, the logic here obtains a scalar $r$ from from scalar $\mathcal{R}$, mostly because I didn't want to think about array dimensions and broadcasting. Generalizing it should be relatively straightforward, but may need some tests. I think I'd prefer to spin that off.
Originally posted by @dylanhmorris in #482 (comment)