[R] Fwd: alternative way to define a function

Martin Møller Skarbiniks Pedersen tr@xp|@yer @end|ng |rom gm@||@com
Thu Dec 2 12:23:27 CET 2021


By reading some code today I have just discovered an alternative way to
define a function:
f <- \(x, y) x * y

Is that exactly the same as:
f <- function(x,y) x * y
?

Is there any benefit to the first or second way to define a function?

Regards
Martin

	[[alternative HTML version deleted]]



More information about the R-help mailing list