On Thu, 2 Dec 2021 at 12:40, Ivan Krylov <krylov.r...@gmail.com> wrote:
>
>
> The \(arguments) syntax has been introduced in R 4.1.0:
> https://cran.r-project.org/doc/manuals/r-release/NEWS.html (search for
> "\(x)"). It is the same as function(arguments).
>
> The only benefit is slightly less typing; could be useful if you use
> the native R pipe (also introduced in R 4.1.0, search for "|>") and
> want to call an anonymous function in the right-hand side of the pipe.

Thanks. It is a nice new feature.
I will start using it in my apply fun's eg: apply(mtcars, 2, \(x)
length(unique(x)))

Regards
Martin

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to