I can define and use an anonymous function and call it like this
x <- 1:3 sapply(x, function(x) x)
purrr package, one can define an anonymous function like this
but this only works in the
How less verbose could you make it? You need some kind of indicator that this is a function, some way of saying the arguments, and some way of saying the calculation. The only thing that makes it "verbose" is that "function" has eight letters. If you don't want that then define your function outside the apply and then you get
sapply(x, foo) which is concise and descriptive and well-understood without resort to external dependencies (purrrr) or non-standard evaluation.