What is the equivalent of \(x) in lower versions of r?

Solution 1:

\ is a syntactic shortcut for the function keyword starting with R 4.1.0. From the documentation:

function( arglist ) expr
\( arglist ) expr

In fact, we can verify the syntactic equivalence ourselves by looking at an unevaluated expression:

quote(\(arglist) expr)
# function(arglist) expr