This is all very intriguing. Normally when piping into an operator
function, R throws "Error: function '+' not supported in RHS call of a
pipe":
> 1 |> `+`(2)
Error: function '+' not supported in RHS call of a pipe
This is a different error from the above "invalid use of pipe placeholder",
which
> Hi all,
>
> Surprisingly (at least to me), `as.complex(NA_real_)` results in
> `complex(real = NA_real_, imaginary = 0)` rather than `NA_complex_`.
Well, the logic here is really the mathematical equivalence:
if you turn a real number x in to a complex one, say z,
then z = x + i * 0 , i.e.