Like %||%, but also substitutes y when x has length zero (for
example an empty array in a parsed JSON API response), not only when x
is NULL. This matters when x feeds a single data.frame() column
alongside scalar values: a length-zero x (as opposed to NULL) passes
%||% unchanged and then throws "arguments imply differing number of
rows" (in data.frame()) or "replacement has 0 rows" (in $<-), which
typically aborts and silently drops the whole record it belongs to.
Examples
1 %empty_or% 2
#> [1] 1
NULL %empty_or% 2
#> [1] 2
character(0) %empty_or% 2
#> [1] 2
