R 4.1.0 famously introduced the |>
("base pipe") operator and Haskell-like lambda function syntax.
I thought it would be possible to combine the two like this:
c(1, 2, 3) |> \(x) 2 * x
This fails for me with:
Error: function 'function' not supported in RHS call of a pipe
I thus assume this is not valid syntax? This works:
c(1, 2, 3) |> (\(x) 2 * x)()
Is there a more elegant way to chain the pipe and the new lambda functions?